-
Notifications
You must be signed in to change notification settings - Fork 54
Closed
Labels
bugThis issue is a bug.This issue is a bug.
Description
Describe the bug
When using role chaining, the custom user agent on the outer client is not propagated to the nested STS client. This is similar to this issue in the JavaScript SDK
Regression Issue
- Select this option if this issue appears to be a regression.
Expected behavior
The applicationId is propagated to the nested sts client used in role chaining:
- AssumeRole:
user-agent: aws-sdk-kotlin/1.5.65 ua/2.1 api/s3#1.5.65 os/macos#15.7.1 lang/kotlin#2.2.20 md/javaVersion#21.0.8 md/jvmName#OpenJDK_64-Bit_Server_VM md/jvmVersion#21.0.8+9-LTS app/MyCustomApp1.0.0 m/b,E,w,o,v,i,T - ListBuckets:
user-agent: aws-sdk-kotlin/1.5.65 ua/2.1 api/s3#1.5.65 os/macos#15.7.1 lang/kotlin#2.2.20 md/javaVersion#21.0.8 md/jvmName#OpenJDK_64-Bit_Server_VM md/jvmVersion#21.0.8+9-LTS app/MyCustomApp1.0.0 m/b,E,w,o,v,i,T
Current behavior
The applicationId is not present in the userAgent header of the STS AssumeRole request.
- AssumeRole:
user-agent: aws-sdk-kotlin/1.5.65 ua/2.1 api/sts#1.5.65 os/macos#15.7.1 lang/kotlin#2.2.20 md/javaVersion#21.0.8 md/jvmName#OpenJDK_64-Bit_Server_VM md/jvmVersion#21.0.8+9-LTS m/e,E,w - ListBuckets:
user-agent: aws-sdk-kotlin/1.5.65 ua/2.1 api/s3#1.5.65 os/macos#15.7.1 lang/kotlin#2.2.20 md/javaVersion#21.0.8 md/jvmName#OpenJDK_64-Bit_Server_VM md/jvmVersion#21.0.8+9-LTS app/MyCustomApp1.0.0 m/b,E,w,o,v,i,T
Steps to Reproduce
I created a minimal reproduction repo here
- 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 first role:
AWS_PROFILE=first gradle runsuspend fun main() { S3Client { logMode = LogMode.LogRequestWithBody + LogMode.LogResponse applicationId = "MyCustomApp#1.0.0" }.use { s3 -> val response = s3.listBuckets() println("S3 Buckets:") response.buckets?.forEach { bucket -> println("- ${bucket.name}") } } }
Possible Solution
No response
Context
Additionally, the # is omitted. What is the correct way to specify the version of the custom application?
AWS SDK for Kotlin version
1.5.65
Platform (JVM/JS/Native)
JVM
Operating system and version
macOS
Metadata
Metadata
Assignees
Labels
bugThis issue is a bug.This issue is a bug.