fix: inject fallback profileArn for Builder-ID/OIDC accounts - #7
Open
marktantongco wants to merge 1 commit into
Open
fix: inject fallback profileArn for Builder-ID/OIDC accounts#7marktantongco wants to merge 1 commit into
marktantongco wants to merge 1 commit into
Conversation
ListAvailableProfiles returns AccessDeniedException for OIDC tokens that only have data-plane scopes (completions/analysis/conversations). When profileArn resolution fails, inject the kiro-cli hardcoded fallback ARN (baked into the binary at crates/fig_api_client/src/profile_resolver.rs) so the data-plane GenerateAssistantResponse request succeeds. This enables Builder-ID accounts to work without explicit profileArn.
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.
Problem
Builder-ID/OIDC accounts fail with
ValidationException: profileArn is required for this requestwhen using Cybx-GateawayQue. TheListAvailableProfilesAPI returnsAccessDeniedExceptionbecause the OIDC token only has data-plane scopes (completions/analysis/conversations), not the control-plane scope needed for profile discovery.Root Cause
ResolveProfileArn()inproxy/kiro_api.gocallsListAvailableProfileswhich fails for Builder-ID tokens. When resolution fails, the code logs a warning but leavesprofileArnempty. The downstreamGenerateAssistantResponserequest then fails because AWS requires theprofileArnfield in the data-plane request body.Fix
When
ResolveProfileArnfails, inject the kiro-cli hardcoded fallback ARN:arn:aws:codewhisperer:{region}:638616132270:profile/AAAACCCCXXXXThis ARN is baked into the kiro binary's
fig_api_clientcrate (profile_resolver.rs:70) and is accepted by the AWS CodeWhisperer control- and data-plane.Changes
Backend/proxy/kiro_api.go: AddedfallbackProfileArn()andisValidRegion()helpersBackend/proxy/kiro.go: Inject fallback ARN afterResolveProfileArnfails (line ~488)Verification
go build ./...— compiles successfullyResolveProfileArntests pass