fix: get_identity 403 in Cloud OAuth mode - #198
Closed
zzstoatzz wants to merge 1 commit into
Closed
Conversation
OAuth access tokens are workspace-scoped and cannot call account-level
endpoints like /me/ or /accounts/{id}. get_identity only short-circuited
to the OAuth grant description when workspace_id was None, so passing a
workspace_id fell through to the full Cloud identity path and failed
with 403 on /accounts/{account_id}.
Always describe the OAuth grant when an OAuth token is present, and
drop the now-unreachable service-account fallback.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
📊 ObservabilityView eval run traces in Logfire: prefect-mcp-server-evals @ 62c4365 |
Evaluation Results20 tests ±0 6 ✅ - 13 3m 47s ⏱️ -20s For more details on these failures, see this check. Results for commit 62c4365. ± Comparison against base commit 2940a3e. |
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.
this PR makes
get_identitywork in Cloud OAuth mode when aworkspace_idis passed — it previously fell through to the account-level Cloud identity path and failed with403: MCP OAuth tokens require a consented workspace-scoped Cloud API pathon/accounts/{account_id}.details
/me/,/accounts/{id}), soget_identitynow always returns the OAuth grant description (withselected_workspacewhen aworkspace_idis given) whenever an OAuth token is presentCloudUnauthorizedErrorfallback inside the Cloud pathget_identity(workspace_id=...)returned the 403 in both consented workspaces🤖 Generated with Claude Code