Repository navigation
fix(llm): align Bedrock GatewayProvider config keys with DB schema - #3732
Conversation
|
Thanks @kimsehwan96. Good catch — the key mismatch between |
The GatewayProvider bedrock branch reads aws_access_key_id, aws_secret_access_key, and region_name from the provider config, but llm_provider_configs.AWSBedrockConfig stores them as access_key_id, secret_access_key, and region. This mismatch causes credentials to silently fall back to the node IAM role. Signed-off-by: kimsehwan96 <[email protected]>
Update existing tests to use DB schema key names (region, access_key_id, secret_access_key, session_token) instead of boto3-style names. Add assertions verifying credentials are correctly mapped to boto3 kwargs, and add tests for no-credentials and default-region edge cases. Signed-off-by: Mihai Criveti <[email protected]>
The DB schema exposes profile_name via the Admin UI but GatewayProvider never mapped it to the langchain-aws credentials_profile_name kwarg, causing the same silent IAM-fallback bug this PR fixes for access key credentials. Signed-off-by: Mihai Criveti <[email protected]>
ReviewThe core fix is correct — Changes made during reviewTest fixes (commit 2):
Verified
|
crivetimihai
left a comment
There was a problem hiding this comment.
LGTM — fix is correct, profile_name gap addressed, tests cover all credential mapping paths.
8e5b729 to
fb0ae7a
Compare
…3732) * fix(llm): align Bedrock GatewayProvider config keys with DB schema The GatewayProvider bedrock branch reads aws_access_key_id, aws_secret_access_key, and region_name from the provider config, but llm_provider_configs.AWSBedrockConfig stores them as access_key_id, secret_access_key, and region. This mismatch causes credentials to silently fall back to the node IAM role. Signed-off-by: kimsehwan96 <[email protected]> * test(llm): align Bedrock GatewayProvider tests with DB schema keys Update existing tests to use DB schema key names (region, access_key_id, secret_access_key, session_token) instead of boto3-style names. Add assertions verifying credentials are correctly mapped to boto3 kwargs, and add tests for no-credentials and default-region edge cases. Signed-off-by: Mihai Criveti <[email protected]> * fix(llm): forward Bedrock profile_name to credentials_profile_name The DB schema exposes profile_name via the Admin UI but GatewayProvider never mapped it to the langchain-aws credentials_profile_name kwarg, causing the same silent IAM-fallback bug this PR fixes for access key credentials. Signed-off-by: Mihai Criveti <[email protected]> --------- Signed-off-by: kimsehwan96 <[email protected]> Signed-off-by: Mihai Criveti <[email protected]> Co-authored-by: Mihai Criveti <[email protected]>
…BM#3732) * fix(llm): align Bedrock GatewayProvider config keys with DB schema The GatewayProvider bedrock branch reads aws_access_key_id, aws_secret_access_key, and region_name from the provider config, but llm_provider_configs.AWSBedrockConfig stores them as access_key_id, secret_access_key, and region. This mismatch causes credentials to silently fall back to the node IAM role. Signed-off-by: kimsehwan96 <[email protected]> * test(llm): align Bedrock GatewayProvider tests with DB schema keys Update existing tests to use DB schema key names (region, access_key_id, secret_access_key, session_token) instead of boto3-style names. Add assertions verifying credentials are correctly mapped to boto3 kwargs, and add tests for no-credentials and default-region edge cases. Signed-off-by: Mihai Criveti <[email protected]> * fix(llm): forward Bedrock profile_name to credentials_profile_name The DB schema exposes profile_name via the Admin UI but GatewayProvider never mapped it to the langchain-aws credentials_profile_name kwarg, causing the same silent IAM-fallback bug this PR fixes for access key credentials. Signed-off-by: Mihai Criveti <[email protected]> --------- Signed-off-by: kimsehwan96 <[email protected]> Signed-off-by: Mihai Criveti <[email protected]> Co-authored-by: Mihai Criveti <[email protected]>
🔗 Related Issue
Close: #3761
📝 Summary
GatewayProvider.get_llm()reads Bedrock credentials using boto3-style key names (aws_access_key_id,aws_secret_access_key,region_name), but the Admin UI stores them viallm_provider_configs.AWSBedrockConfigwhich uses shorter key names (access_key_id,secret_access_key,region).This mismatch causes
config.get("aws_access_key_id")to always returnNone, silently falling back to the node IAM role instead of using the user-configured credentials.🏷️ Type of Change
🧪 Verification
make lintmake testmake coverage✅ Checklist
make black isort pre-commit)📓 Notes (optional)