Skip to content

Custom applicationId not propagated to nested STS client #1717

@jackrein

Description

@jackrein

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:

  1. 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
  2. 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.

  1. 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
  2. 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

  1. 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
  2. Use the SDK with the first role: AWS_PROFILE=first gradle run
    suspend 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

No one assigned

    Labels

    bugThis issue is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions