Skip to content

Commit

Permalink
Update testcase.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sichan Yoo committed Aug 14, 2023
1 parent 0224534 commit 33a6aaa
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//
// Copyright Amazon.com Inc. or its affiliates.
// All Rights Reserved.
//
// SPDX-License-Identifier: Apache-2.0
//

import AwsCommonRuntimeKit
import ClientRuntime
import Foundation

/// Creates a provider that that sources credentials using GetRoleCredentialsRequest to the AWS Single
/// Sign-On Service to maintain short-lived sessions.
/// [Details link](https://docs.aws.amazon.com/sdkref/latest/guide/feature-sso-credentials.html)
/// - Parameters:
/// - bootstrap: Connection bootstrap to use for any network connections made while sourcing credentials.
/// - tlsContext: Client TLS context to use when querying STS web identity provider.
/// - fileBasedConfiguration: The file based configuration to read the configuration from.
/// - profileFileNameOverride: (Optional) Override of what profile to use to source credentials from ('default' by default)
/// - shutdownCallback: (Optional) shutdown callback
/// - Returns: `CredentialsProvider`
/// - Throws: CommonRuntimeError.crtError
///
public struct SSOCredentialsProvider: CredentialsSourcedByCRT {
let crtCredentialsProvider: CRTCredentialsProvider
public init(
profileName: String? = nil,
configFilePath: String? = nil,
credentialsFilePath: String? = nil
) throws {
let fileBasedConfig = try CRTFileBasedConfiguration(
configFilePath: configFilePath,
credentialsFilePath: credentialsFilePath
)
self.crtCredentialsProvider = try CRTCredentialsProvider(source: .process(
fileBasedConfiguration: fileBasedConfig,
profileFileNameOverride: profileName
))
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//
// Copyright Amazon.com Inc. or its affiliates.
// All Rights Reserved.
//
// SPDX-License-Identifier: Apache-2.0
//

import Foundation
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ extension EventStreamTestClient: EventStreamTestClientProtocol {
/// - Parameter TestStreamOpInput : [no documentation found]
///
/// - Returns: `TestStreamOpOutputResponse` : [no documentation found]
///
/// - Throws: One of the exceptions listed below __Possible Exceptions__.
///
/// __Possible Exceptions:__
/// - `SomeError` : You don't have permission.
public func testStreamOp(input: TestStreamOpInput) async throws -> TestStreamOpOutputResponse
{
let context = ClientRuntime.HttpContextBuilder()
Expand Down

0 comments on commit 33a6aaa

Please sign in to comment.