Repository navigation
[codex] Port GSuite WASM capabilities to Reborn #4326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
6d9af2f
Port GSuite WASM capabilities to Reborn
6e4337e
Fix GSuite Reborn PR review findings
392fafb
Address follow-up GSuite review comments
fa88138
Fix GSuite Reborn parity test expectations
f170b7b
Merge remote-tracking branch 'origin/reborn-integration' into codex/g…
02c9c35
Fix Reborn credential resolver merge test
6198a88
Fix clippy in WASM runtime contract test
b7ff17b
Fix clippy in GSuite capability test
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Medium · 55% confidence] No positive / over-scope test for scope-based account selection (the PR's stated priority)
tests reviewer
This PR's entire purpose is to thread
provider_scopesfrom the manifest into runtime-credential selection so product-auth picks a least-privilege Google account. The propagation chain is well covered by new tests: the manifest validator (v2::tests::validate_runtime_credential_provider_scopes_*andmanifest_v2_contract), the obligation emission (runtime_credentials_contract::capability_access_resolves_product_auth_account_runtime_credentials, assertingprovider_scopes: vec!["repo"]), and the host obligation handler (builtin_obligation_handler_contract.rs:1333-1364, asserting a non-emptydrive.readonlyscope reachescredential_requirements[0].provider_scopes).The actual selection DECISION that those scopes drive is
account_has_provider_scopesincrates/ironclaw_reborn_composition/src/product_auth_runtime_credentials.rs:170(required.all(|r| account.scopes.any(|s| s == r))), consumed byProductAuthRuntimeCredentialResolver::resolve_access_secret. Of the 11 resolver tests in that module'smod tests, exactly one passes a non-emptyprovider_scopes(resolver_requires_requested_provider_scopes, line 482), and it asserts only the NEGATIVE branch: account holdsgmail.send, request requiresdrive, resultAuthRequired. Every test that asserts a successfulOk(secret)selection (lines 285/327/370/413/701) passesprovider_scopes: &[].Result: the positive branch of
account_has_provider_scopesis never exercised end-to-end, and the over-scoped case the PR explicitly calls out ("can it select an over-scoped/wrong account") has zero coverage. A regression inverting the filter (e.g.!account.scopes.contains, or swapping the subset/superset direction so adocuments.readonly-only account satisfies adocumentswrite requirement) would still pass every existing test, because no positive selection ever supplies a required scope. This is the same caller-level coverage class the repo's testing.md "Test Through the Caller" rule mandates for a predicate that gates a secret read. (Selection module is pre-existing, not edited by this PR; anchored here on the in-scope obligation test this PR modified.)Fix: Add
tests::product_auth_runtime_credentials::resolver_selects_account_whose_scopes_superset_requiredcovering the positive/over-scope path: create one Configured UserReusable google account whosescopesare a strict superset of the request (e.g. account has [.../drive,.../gmail.send], requestprovider_scopes = [".../drive"]) and assertresolve_access_secretreturnsOk(access_secret); plustests::product_auth_runtime_credentials::resolver_requires_exact_scope_string_not_readonly_variantasserting adocuments-only account does NOT satisfy adocuments.readonlyrequirement (and vice versa), pinning the exact-string match semantics. Both belong in themod testsof crates/ironclaw_reborn_composition/src/product_auth_runtime_credentials.rs.