Skip to content

Commit

Permalink
fix: static credetnials provider (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
kneekey23 authored Aug 3, 2021
1 parent 231269a commit 25a2c68
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ public final class CRTAWSCredentialsProvider {
shutDownOptions: config.shutDownOptions)
staticOptions.access_key_id = config.accessKey.awsByteCursor
staticOptions.secret_access_key = config.secret.awsByteCursor
staticOptions.session_token = config.sessionToken.awsByteCursor
if let sessionToken = config.sessionToken?.awsByteCursor {
staticOptions.session_token = sessionToken
}

guard let provider = aws_credentials_provider_new_static(allocator.rawValue,
&staticOptions) else { throw AWSCommonRuntimeError() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
public protocol CRTCredentialsProviderStaticConfigOptions {
var accessKey: String { get set}
var secret: String { get set}
var sessionToken: String { get set}
var sessionToken: String? { get set}
var shutDownOptions: CRTCredentialsProviderShutdownOptions? { get set}
}
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,12 @@ struct MockCredentialsProviderProfileOptions: CRTCredentialsProviderProfileOptio
struct MockCredentialsProviderStaticConfigOptions: CRTCredentialsProviderStaticConfigOptions {
public var accessKey: String
public var secret: String
public var sessionToken: String
public var sessionToken: String?
public var shutDownOptions: CRTCredentialsProviderShutdownOptions?

public init(accessKey: String,
secret: String,
sessionToken: String,
sessionToken: String? = nil,
shutDownOptions: CRTCredentialsProviderShutdownOptions? = nil) {
self.accessKey = accessKey
self.secret = secret
Expand Down

0 comments on commit 25a2c68

Please sign in to comment.