-
Notifications
You must be signed in to change notification settings - Fork 637
Open
Labels
bugThis issue is a bug.This issue is a bug.closing-soonThis issue will automatically close in 4 days unless further comments are made.This issue will automatically close in 4 days unless further comments are made.p2This is a standard priority issueThis is a standard priority issue
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/configfile:[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
firstrole:AWS_PROFILE=first npm run start(startinvokes 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,vvsmy-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.closing-soonThis issue will automatically close in 4 days unless further comments are made.This issue will automatically close in 4 days unless further comments are made.p2This is a standard priority issueThis is a standard priority issue