Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow reporting configuration for AWSSecurityTokenClient. #39

Merged
merged 1 commit into from
Dec 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading