fix: aws profile bedrock auth#2831
Conversation
Allow Bedrock users to authenticate via AWS profile name (supporting SSO, IAM, and other credential types configured in ~/.aws/config) as an alternative to bearer token authentication. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The AWS profile auth marker was being overwritten by existing API key credentials during login, causing the UI to prompt for an API key even when the user selected SSO authentication. Also adds unit and integration tests for the AWS profile auth path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: ForgeCode <noreply@forgecode.dev>
|
Hey @zulrang does this PR worked for you. |
|
Action required: PR inactive for 5 days. |
|
Hi all! Would love to see this PR come to fruition. What's missing? |
|
@Qkessler I want someone to test this change using aws-profile login. And test with Anthropic models |
|
Any docs to build locally I can try on my x86_64 machine? Should cargo install --path . do it? |
|
@Qkessler clone the repo and |
|
Sadly, the current PR state doesn't work for me. Here's what the set up process looks like after There's aws-profiles that are triggered through particular credential commands. For example, on this |
|
Worked for me successfully with Azure AD SAML-based credentials (with temporary STS credentials in ~/.aws/credentials). |
|
using this branch as my daily driver with bedrock. i don't have permissions for using an api key so this is a lifesaver. thanks! 😊 |
|
Thanks @zulrang |
Summary
aws_profileauth method to the Bedrock provider, allowing users to authenticate using an AWS profile name (SSO, IAM, etc.) instead of requiring a bearer tokenGoogleAdcpattern: newAuthMethod::AwsProfilevariant,AuthDetails::AwsProfile, andAwsProfileStrategythat validates profile credentialsBedrockProviderto support both bearer token (existing) and profile-based SigV4 authentication via aBedrockAuthModeenumChanges across 15+ files
forge_domain):AwsProfilevariants inAuthMethodandAuthDetailsenumsforge_infra):AwsProfileStrategywith SSO credential validationforge_repo):BedrockAuthModeenum, dual auth path ininit()forge_services): Fixed marker overwrite bug inprovider_auth.rsforge_main): "AWS Profile (SSO/IAM)" display name, skip API key prompt for markersprovider.jsonupdated with"aws_profile"auth method for bedrockssofeature added toaws-configworkspace depTest plan
test_new_with_aws_profile_credentials,test_new_with_empty_aws_profile_failstest_real_sso_profile_converse(ignored in CI, validated manually withcore-test-bedrockSSO profile)forge provider login bedrock→ select AWS Profile → enter profile name + region → no API key prompt → login succeedsCloses #2830