[feature] gcloud permissions: pick a project, read its IAM roles in-panel - #15
Merged
Conversation
|
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.



permissionsfor gcloud used to answer "IAM roles are per-project and per-resource; patchbay does not resolve them yet" and hand back agcloud projects get-iam-policyline to paste — a bare command where an action would have worked, which is the one thing CONTRIBUTING says the panel does not do. It now runs the read itself.The shape change. A Google account has no roles of its own, only roles on a project, so permissions became optionally scoped, following
verify_profileexactly:Probe::permission_scopes()andpermissions_in(scope), both defaulted — the other 24 probes are untouched, gh and wrangler behave as before.PermissionsReportgainsscope, omitted from JSON when there is none.projects list(skipping non-ACTIVE lifecycle states, and inserting the configured project even when it is absent from the list, sinceresourcemanager.projects.listis a separate grant) andget-iam-policyfiltered to the active account.collect_roles/members_includewalk both the flattened and unflattened policy shapes and re-check members client-side, so a role held by someone else can never be reported as yours.pb permsgains--scopeand--list-scopes; MCPget_permissionsgains an optionalscopebeside a newlist_permission_scopestool (smoke.sh's tool-name assertion updated).PERMISSIONS_TOOLSset is gone — which tools can report permissions is the backend's fact, not a list in the UI that goes stale.Two deliberate calls. The unscoped read resolves the active configuration's
core/projectand reads that — the same moveverifymakes with the active profile — rather than answering a question it could work out for itself. And the copyable line survives in exactly one place: when there is no gcloud onPATH, so patchbay genuinely cannot answer.Verified. 624 workspace tests pass, including 13 new gcloud cases (projects-list parsing, active flagging, unlistable-but-configured project, IAM→roles, foreign-member rejection, empty bindings, refusal, reauth flattening, unparseable output, no-project, scoped-other-project, and a
GhProbecase proving an unmodified probe returns empty scopes and delegates). fmt + clippy-D warnings(workspace and src-tauri) +bun run buildclean; no lockfile change. Live-checked against real gcloud:--list-scopeslists and stars the configured project; an expired login reports one actionable sentence rather than a four-line paste of Google's reauth text.