Skip to content

Commit

Permalink
feat: update swift sdk dependency to 0.31.0 (#3351)
Browse files Browse the repository at this point in the history
  • Loading branch information
atierian authored Nov 8, 2023
1 parent 21aa9b5 commit 870e83d
Show file tree
Hide file tree
Showing 84 changed files with 1,303 additions and 1,209 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ struct VerifyPasswordSRP: Action {
let identifier = "VerifyPasswordSRP"

let stateData: SRPStateData
let authResponse: InitiateAuthOutputResponse
let authResponse: InitiateAuthOutput
let clientMetadata: ClientMetadata

init(stateData: SRPStateData,
authResponse: InitiateAuthOutputResponse,
authResponse: InitiateAuthOutput,
clientMetadata: ClientMetadata) {
self.stateData = stateData
self.authResponse = authResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ protocol CognitoIdentityBehavior {
/// Generates (or retrieves) a Cognito ID. Supplying multiple logins will create an implicit linked account.
/// This is a public API. You do not need any credentials to call this API.
/// Throws GetIdOutputError
func getId(input: GetIdInput) async throws -> GetIdOutputResponse
func getId(input: GetIdInput) async throws -> GetIdOutput

/// Returns credentials for the provided identity ID.
/// Any provided logins will be validated against supported login providers. If the token is for cognito-identity.amazonaws.com,
/// it will be passed through to AWS Security Token Service with the appropriate role for the token.
/// This is a public API. You do not need any credentials to call this API.
/// Throws GetCredentialsForIdentityOutputError
func getCredentialsForIdentity(
input: GetCredentialsForIdentityInput) async throws -> GetCredentialsForIdentityOutputResponse
input: GetCredentialsForIdentityInput) async throws -> GetCredentialsForIdentityOutput

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,82 +11,82 @@ import ClientRuntime
protocol CognitoUserPoolBehavior {

/// Throws InitiateAuthOutputError
func initiateAuth(input: InitiateAuthInput) async throws -> InitiateAuthOutputResponse
func initiateAuth(input: InitiateAuthInput) async throws -> InitiateAuthOutput

/// Throws RespondToAuthChallengeOutputError
func respondToAuthChallenge(
input: RespondToAuthChallengeInput) async throws -> RespondToAuthChallengeOutputResponse
input: RespondToAuthChallengeInput) async throws -> RespondToAuthChallengeOutput

/// Throws SignUpOutputError
func signUp(input: SignUpInput) async throws -> SignUpOutputResponse
func signUp(input: SignUpInput) async throws -> SignUpOutput

/// Throws ConfirmSignUpOutputError
func confirmSignUp(input: ConfirmSignUpInput) async throws -> ConfirmSignUpOutputResponse
func confirmSignUp(input: ConfirmSignUpInput) async throws -> ConfirmSignUpOutput

/// Throws GlobalSignOutOutputError
func globalSignOut(input: GlobalSignOutInput) async throws -> GlobalSignOutOutputResponse
func globalSignOut(input: GlobalSignOutInput) async throws -> GlobalSignOutOutput

/// Throws RevokeTokenOutputError
func revokeToken(input: RevokeTokenInput) async throws -> RevokeTokenOutputResponse
func revokeToken(input: RevokeTokenInput) async throws -> RevokeTokenOutput

// MARK: - User Attribute API's

/// Throws GetUserAttributeVerificationCodeOutputError
func getUserAttributeVerificationCode(input: GetUserAttributeVerificationCodeInput) async throws -> GetUserAttributeVerificationCodeOutputResponse
func getUserAttributeVerificationCode(input: GetUserAttributeVerificationCodeInput) async throws -> GetUserAttributeVerificationCodeOutput

/// Throws GetUserOutputError
func getUser(input: GetUserInput) async throws -> GetUserOutputResponse
func getUser(input: GetUserInput) async throws -> GetUserOutput

/// Throws UpdateUserAttributesOutputError
func updateUserAttributes(input: UpdateUserAttributesInput) async throws -> UpdateUserAttributesOutputResponse
func updateUserAttributes(input: UpdateUserAttributesInput) async throws -> UpdateUserAttributesOutput

/// Verifies the specified user attributes in the user pool.
/// Throws VerifyUserAttributeOutputError
func verifyUserAttribute(input: AWSCognitoIdentityProvider.VerifyUserAttributeInput) async throws -> AWSCognitoIdentityProvider.VerifyUserAttributeOutputResponse
func verifyUserAttribute(input: AWSCognitoIdentityProvider.VerifyUserAttributeInput) async throws -> AWSCognitoIdentityProvider.VerifyUserAttributeOutput

/// Changes the password for a specified user in a user pool.
/// Throws ChangePasswordOutputError
func changePassword(input: ChangePasswordInput) async throws -> ChangePasswordOutputResponse
func changePassword(input: ChangePasswordInput) async throws -> ChangePasswordOutput

/// Delete the signed in user from the user pool.
/// Throws DeleteUserOutputError
func deleteUser(input: DeleteUserInput) async throws -> DeleteUserOutputResponse
func deleteUser(input: DeleteUserInput) async throws -> DeleteUserOutput

/// Resends sign up code
/// Throws ResendConfirmationCodeOutputError
func resendConfirmationCode(input: ResendConfirmationCodeInput) async throws -> ResendConfirmationCodeOutputResponse
func resendConfirmationCode(input: ResendConfirmationCodeInput) async throws -> ResendConfirmationCodeOutput

/// Resets password
/// Throws ForgotPasswordOutputError
func forgotPassword(input: ForgotPasswordInput) async throws -> ForgotPasswordOutputResponse
func forgotPassword(input: ForgotPasswordInput) async throws -> ForgotPasswordOutput

/// Confirm Reset password
/// Throws ConfirmForgotPasswordOutputError
func confirmForgotPassword(input: ConfirmForgotPasswordInput) async throws -> ConfirmForgotPasswordOutputResponse
func confirmForgotPassword(input: ConfirmForgotPasswordInput) async throws -> ConfirmForgotPasswordOutput

/// Lists the devices
func listDevices(input: ListDevicesInput) async throws -> ListDevicesOutputResponse
func listDevices(input: ListDevicesInput) async throws -> ListDevicesOutput

/// Updates the device status
func updateDeviceStatus(input: UpdateDeviceStatusInput) async throws -> UpdateDeviceStatusOutputResponse
func updateDeviceStatus(input: UpdateDeviceStatusInput) async throws -> UpdateDeviceStatusOutput

/// Forgets the specified device.
func forgetDevice(input: ForgetDeviceInput) async throws -> ForgetDeviceOutputResponse
func forgetDevice(input: ForgetDeviceInput) async throws -> ForgetDeviceOutput

/// Confirms tracking of the device. This API call is the call that begins device tracking.
/// Throws ConfirmDeviceOutputError
func confirmDevice(input: ConfirmDeviceInput) async throws -> ConfirmDeviceOutputResponse
func confirmDevice(input: ConfirmDeviceInput) async throws -> ConfirmDeviceOutput

/// Creates a new request to associate a new software token for the user
/// Throws AssociateSoftwareTokenOutputError
func associateSoftwareToken(input: AssociateSoftwareTokenInput) async throws -> AssociateSoftwareTokenOutputResponse
func associateSoftwareToken(input: AssociateSoftwareTokenInput) async throws -> AssociateSoftwareTokenOutput

/// Register a user's entered time-based one-time password (TOTP) code and mark the user's software token MFA status as "verified" if successful.
/// Throws VerifySoftwareTokenOutputError
func verifySoftwareToken(input: VerifySoftwareTokenInput) async throws -> VerifySoftwareTokenOutputResponse
func verifySoftwareToken(input: VerifySoftwareTokenInput) async throws -> VerifySoftwareTokenOutput

/// Set the user's multi-factor authentication (MFA) method preference, including which MFA factors are activated and if any are preferred.
/// Throws SetUserMFAPreferenceOutputError
func setUserMFAPreference(input: SetUserMFAPreferenceInput) async throws -> SetUserMFAPreferenceOutputResponse
func setUserMFAPreference(input: SetUserMFAPreferenceInput) async throws -> SetUserMFAPreferenceOutput

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ protocol SignInResponseBehavior {
var session: Swift.String? { get }
}

extension RespondToAuthChallengeOutputResponse: SignInResponseBehavior { }
extension RespondToAuthChallengeOutput: SignInResponseBehavior { }

extension InitiateAuthOutputResponse: SignInResponseBehavior { }
extension InitiateAuthOutput: SignInResponseBehavior { }
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Amplify
import Foundation
import AWSCognitoIdentityProvider

extension SignUpOutputResponse {
extension SignUpOutput {

var authResponse: AuthSignUpResult {
if self.userConfirmed {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ struct SignInEvent: StateMachineEvent {

case initiateMigrateAuth(SignInEventData, DeviceMetadata)

case respondPasswordVerifier(SRPStateData, InitiateAuthOutputResponse, ClientMetadata)
case respondPasswordVerifier(SRPStateData, InitiateAuthOutput, ClientMetadata)

case retryRespondPasswordVerifier(SRPStateData, InitiateAuthOutputResponse, ClientMetadata)
case retryRespondPasswordVerifier(SRPStateData, InitiateAuthOutput, ClientMetadata)

case initiateDeviceSRP(Username, SignInResponseBehavior)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class FetchAuthAWSCredentialsTests: XCTestCase {
let expectation = expectation(description: "fetchAWSCredentials")
let identityProviderFactory: BasicAuthorizationEnvironment.CognitoIdentityFactory = {
MockIdentity(mockGetCredentialsResponse: { _ in
return GetCredentialsForIdentityOutputResponse()
return GetCredentialsForIdentityOutput()
})
}
let authorizationEnvironment = BasicAuthorizationEnvironment(
Expand Down Expand Up @@ -75,7 +75,7 @@ class FetchAuthAWSCredentialsTests: XCTestCase {
let expectation = expectation(description: "fetchAWSCredentials")
let identityProviderFactory: BasicAuthorizationEnvironment.CognitoIdentityFactory = {
MockIdentity(mockGetCredentialsResponse: { _ in
return GetCredentialsForIdentityOutputResponse(identityId: "identityId")
return GetCredentialsForIdentityOutput(identityId: "identityId")
})
}
let authorizationEnvironment = BasicAuthorizationEnvironment(
Expand Down Expand Up @@ -117,7 +117,7 @@ class FetchAuthAWSCredentialsTests: XCTestCase {

let identityProviderFactory: BasicAuthorizationEnvironment.CognitoIdentityFactory = {
MockIdentity(mockGetCredentialsResponse: { _ in
return GetCredentialsForIdentityOutputResponse(
return GetCredentialsForIdentityOutput(
credentials: CognitoIdentityClientTypes.Credentials(
accessKeyId: expectedAccessKey,
expiration: Date(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ class RefreshHostedUITokensTests: XCTestCase {
private func identityProviderFactory() throws -> CognitoUserPoolBehavior {
return MockIdentityProvider(
mockInitiateAuthResponse: { _ in
return InitiateAuthOutputResponse(
return InitiateAuthOutput(
authenticationResult: .init(
accessToken: "accessTokenNew",
expiresIn: 100,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class RefreshUserPoolTokensTests: XCTestCase {
let identityProviderFactory: BasicSRPAuthEnvironment.CognitoUserPoolFactory = {
MockIdentityProvider(
mockInitiateAuthResponse: { _ in
return InitiateAuthOutputResponse()
return InitiateAuthOutput()
}
)
}
Expand Down Expand Up @@ -78,7 +78,7 @@ class RefreshUserPoolTokensTests: XCTestCase {
let identityProviderFactory: BasicSRPAuthEnvironment.CognitoUserPoolFactory = {
MockIdentityProvider(
mockInitiateAuthResponse: { _ in
return InitiateAuthOutputResponse(
return InitiateAuthOutput(
authenticationResult: .init(
accessToken: "accessTokenNew",
expiresIn: 100,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class InitiateAuthSRPTests: XCTestCase {
MockIdentityProvider(
mockInitiateAuthResponse: { _ in
initiateAuthInvoked.fulfill()
return InitiateAuthOutputResponse()
return InitiateAuthOutput()
}
)
}
Expand Down Expand Up @@ -83,7 +83,7 @@ class InitiateAuthSRPTests: XCTestCase {
let identityProviderFactory: BasicSRPAuthEnvironment.CognitoUserPoolFactory = {
MockIdentityProvider(
mockInitiateAuthResponse: { _ in
return InitiateAuthOutputResponse()
return InitiateAuthOutput()
}
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class VerifyDevicePasswordSRPSignatureTests: XCTestCase {
private func signature() throws -> String {
let action = VerifyDevicePasswordSRP(
stateData: .testData,
authResponse: InitiateAuthOutputResponse.validTestData
authResponse: InitiateAuthOutput.validTestData
)

return try action.signature(
Expand Down
Loading

0 comments on commit 870e83d

Please sign in to comment.