Skip to content

Commit

Permalink
Merge pull request #39 from amzn/sts_reporting_configuration
Browse files Browse the repository at this point in the history
Allow reporting configuration for AWSSecurityTokenClient.
  • Loading branch information
tachyonics authored Dec 10, 2023
2 parents 4b0da4f + 8ac3ab9 commit cff836c
Showing 1 changed file with 28 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ internal struct AWSSTSExpiringCredentialsRetriever<InvocationReportingType: HTTP
durationSeconds: Int?,
retryConfiguration: HTTPClientRetryConfiguration,
eventLoopProvider: HTTPClient.EventLoopGroupProvider,
reporting: InvocationReportingType) {
reporting: InvocationReportingType,
reportingConfiguration: SmokeAWSClientReportingConfiguration<SecurityTokenModelOperations>) {
self.client = AWSSecurityTokenClient(
credentialsProvider: credentialsProvider,
reporting: reporting,
retryConfiguration: retryConfiguration,
eventLoopProvider: eventLoopProvider)
eventLoopProvider: eventLoopProvider,
reportingConfiguration: reportingConfiguration)
self.roleArn = roleArn
self.roleSessionName = roleSessionName
self.durationSeconds = durationSeconds
Expand Down Expand Up @@ -155,22 +157,25 @@ extension SecurityTokenClientProtocol {
Function that retrieves AssumedRotatingCredentials from the provided token service.
*/
@available(swift, deprecated: 3.0, message: "Use async version")
static func getAssumedRotatingCredentials<InvocationReportingType: HTTPClientCoreInvocationReporting>(roleArn: String,
roleSessionName: String,
credentialsProvider: CredentialsProvider,
durationSeconds: Int?,
reporting: InvocationReportingType,
retryConfiguration: HTTPClientRetryConfiguration,
eventLoopProvider: HTTPClient
.EventLoopGroupProvider) -> StoppableCredentialsProvider? {
static func getAssumedRotatingCredentials<InvocationReportingType: HTTPClientCoreInvocationReporting>(
roleArn: String,
roleSessionName: String,
credentialsProvider: CredentialsProvider,
durationSeconds: Int?,
reporting: InvocationReportingType,
retryConfiguration: HTTPClientRetryConfiguration,
eventLoopProvider: HTTPClient.EventLoopGroupProvider,
reportingConfiguration: SmokeAWSClientReportingConfiguration<SecurityTokenModelOperations> = .none)
-> StoppableCredentialsProvider? {
let credentialsRetriever = AWSSTSExpiringCredentialsRetriever(
credentialsProvider: credentialsProvider,
roleArn: roleArn,
roleSessionName: roleSessionName,
durationSeconds: durationSeconds,
retryConfiguration: retryConfiguration,
eventLoopProvider: eventLoopProvider,
reporting: reporting)
reporting: reporting,
reportingConfiguration: reportingConfiguration)

let delegatedRotatingCredentials: AwsRotatingCredentialsProviderV2
do {
Expand Down Expand Up @@ -264,22 +269,25 @@ extension SecurityTokenClientProtocolV2 {
/**
Function that retrieves AssumedRotatingCredentials from the provided token service.
*/
static func getAssumedRotatingCredentials<InvocationReportingType: HTTPClientCoreInvocationReporting>(roleArn: String,
roleSessionName: String,
credentialsProvider: CredentialsProvider,
durationSeconds: Int?,
reporting: InvocationReportingType,
retryConfiguration: HTTPClientRetryConfiguration,
eventLoopProvider: HTTPClient
.EventLoopGroupProvider) async -> StoppableCredentialsProvider? {
static func getAssumedRotatingCredentials<InvocationReportingType: HTTPClientCoreInvocationReporting>(
roleArn: String,
roleSessionName: String,
credentialsProvider: CredentialsProvider,
durationSeconds: Int?,
reporting: InvocationReportingType,
retryConfiguration: HTTPClientRetryConfiguration,
eventLoopProvider: HTTPClient.EventLoopGroupProvider,
reportingConfiguration: SmokeAWSClientReportingConfiguration<SecurityTokenModelOperations> = .none) async
-> StoppableCredentialsProvider? {
let credentialsRetriever = AWSSTSExpiringCredentialsRetriever(
credentialsProvider: credentialsProvider,
roleArn: roleArn,
roleSessionName: roleSessionName,
durationSeconds: durationSeconds,
retryConfiguration: retryConfiguration,
eventLoopProvider: eventLoopProvider,
reporting: reporting)
reporting: reporting,
reportingConfiguration: reportingConfiguration)

let delegatedRotatingCredentials: AwsRotatingCredentialsProviderV2
do {
Expand Down

0 comments on commit cff836c

Please sign in to comment.