🧹 Slim cloud-provider SDKs out of the MQL embedding path#8456
Draft
chris-rock wants to merge 1 commit into
Draft
🧹 Slim cloud-provider SDKs out of the MQL embedding path#8456chris-rock wants to merge 1 commit into
chris-rock wants to merge 1 commit into
Conversation
Contributor
Test Results9 978 tests 9 972 ✅ 3m 9s ⏱️ Results for commit 8613ff1. ♻️ This comment has been updated with latest results. |
d00c806 to
ac0ddc2
Compare
Embedding the MQL evaluator pulled ~50+ AWS/cloud-SDK packages into a consumer's build graph even when no vault, asset, or cloud feature is used. Remove the two remaining edges with the registry pattern already used for vault backends, so a consumer importing only llx + mqlc + exec + resources + inventory builds with zero cloud-provider SDKs. - upstream/sts.go no longer imports upstream/tokenauth (which pulls the AWS SigV4 signer). The TokenProvider interface and a resolver hook live in upstream; tokenauth self-registers from init(). This clears the inventory → upstream → tokenauth → AWS edge (inventory: 54 → 0). - cli/config no longer imports the AWS SDK directly for its "aws-ssm-ps://" loader. The loader moves to cli/config/awsssm behind a remote-config-loader registry and self-registers from init(). This clears the exec → upstream/health → cli/config → AWS edge (exec: 57 → 0). The mql binary blank-imports both implementations in main, so the CLI is unchanged; other binaries opt in as needed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ac0ddc2 to
8613ff1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Embedding the MQL evaluator dragged ~50+ AWS/cloud-SDK packages into a consumer's build graph even when no vault, asset, or cloud feature is used. The vault half of this was fixed in v13.21.1; this PR removes the two remaining edges, both via the same registry pattern.
After this change, a consumer importing only
llx + mqlc + exec + resources + inventorybuilds with zero cloud-provider SDK packages.The two edges
1.
inventory → upstream → tokenauth → AWS(the reported edge)upstream/sts.goimportedupstream/tokenauthfor external token exchange, andtokenauthpulls the AWS SigV4 signer. Sinceinventoryembedsupstream's protobuf types, andllx.RuntimerequiresAssetUpdated(*inventory.Asset), every embedder inherited the AWS SDK. Now theTokenProviderinterface and a resolver hook live inupstream;tokenauthself-registers frominit().2.
exec → upstream/health → cli/config → AWS(a second, independent edge)cli/configdirectly imported the AWS SDK for itsaws-ssm-ps://config loader, and the eval path reachescli/configthroughhealth's panic reporting. Moved the AWS SSM backend intocli/config/awsssm, dispatched via a new remote-config-loader registry; it self-registers frominit().The
mqlbinary blank-imports both implementations inmain(alongside the existingvault/register), so the CLI is unchanged. Other binaries opt in as needed; if external token exchange oraws-ssm-ps://is used without the import, a clear error explains how to enable it.Before / after (cloud-SDK package count via
go list -deps)providers-sdk/v1/inventoryexeccli/configllx,mqlc,resourcesapps/mql(the binary)Notes for reviewers
vaultregistry (providers-sdk/v1/vault/registry.go) andvault/register.aws-ssm-ps://config must blank-import the relevant package. Themqlbinary does; cnquery/cnspec mains should add the same imports. The runtime error message names the package to import.tokenauth.TokenProvideris retained as an alias ofupstream.TokenProvider.Test plan
go build ./...— clean.go test ./cli/config/awsssm/ ./providers-sdk/v1/upstream/...— pass (SSM path parsing, token resolver, health).go mod tidy— no change.go list -depscounts above verified.cli/config.Test_autodetectConfig/test_systemConfig_returnedfails identically onmain(depends on absence of a local~/.config/mondoo/mondoo.yml); untouched by this PR.🤖 Generated with Claude Code