-
Notifications
You must be signed in to change notification settings - Fork 633
Open
Labels
bugThis issue is a bug.This issue is a bug.needs-triageThis issue or PR still needs to be triaged.This issue or PR still needs to be triaged.
Description
Checkboxes for prior research
- I've gone through Developer Guide and API reference
- I've checked AWS Forums and StackOverflow.
- I've searched for previous similar issues and didn't find any solution.
Describe the bug
When using role chaining, the custom user agent on the outer client is not propagated to the nested STS client.
Regression Issue
- Select this option if this issue appears to be a regression.
SDK version number
3.911.0
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
v18.20.2
Reproduction Steps
- Create the following content in
~/.aws/config
file:[profile second] credential_process=/usr/bin/get-credentials region=us-west-2 [profile first] source_profile=second role_arn=arn:aws:iam::123456789012:role/Role
- Use the SDK with the
first
role:AWS_PROFILE=first npm run start
(start
invokes the following script)import { S3Client, ListBucketsCommand } from '@aws-sdk/client-s3'; const s3Client = new S3Client({ defaultUserAgentProvider: () => Promise.resolve(["my-user-agent", "1"]), // or customUserAgent logger: { ...console } }); const command = new ListBucketsCommand({}); const response = await s3Client.send(command);
Observed Behavior
Observe two AWS requests in CloudTrail. The AssumeRole request retains the default user-agent
. The ListBuckets request contains the custom user agent:
aws-sdk-js/3.911.0 ua/2.1 os/darwin#24.6.0 lang/js md/nodejs#18.20.2 api/sts#3.911.0 m/E,w,v
vsmy-user-agent m/E,T,i,o
Expected Behavior
Both requests contain the my-user-agent m/E,T,i,o
user agent value.
Possible Solution
Propagate the custom user agent values to the nested STS client.
Note: other configuration to the outer client, like custom middleware, is not propagated to the nested client as well
Additional Information/Context
No response
Metadata
Metadata
Assignees
Labels
bugThis issue is a bug.This issue is a bug.needs-triageThis issue or PR still needs to be triaged.This issue or PR still needs to be triaged.