-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Auth): provide AuthConfiguration from plugin
- Loading branch information
Showing
10 changed files
with
200 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...h/Sources/AWSCognitoAuthPlugin/StateMachine/CodeGen/Data/PasswordProtectionSettings.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// Copyright Amazon.com Inc. or its affiliates. | ||
// All Rights Reserved. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
import Foundation | ||
import Amplify | ||
|
||
@_spi(InternalAmplifyConfiguration) | ||
public struct PasswordProtectionSettings: Equatable, Codable { | ||
public var minLength: Int? | ||
public var characterPolicy: [PasswordCharacterPolicy] | ||
|
||
public init(minLength: Int?, | ||
characterPolicy: [PasswordCharacterPolicy]) { | ||
self.minLength = minLength | ||
self.characterPolicy = characterPolicy | ||
} | ||
} | ||
|
||
@_spi(InternalAmplifyConfiguration) | ||
public enum PasswordCharacterPolicy: String, Codable { | ||
case lowercase = "REQUIRES_LOWERCASE" | ||
case uppercase = "REQUIRES_UPPERCASE" | ||
case numbers = "REQUIRES_NUMBERS" | ||
case symbols = "REQUIRES_SYMBOLS" | ||
} |
25 changes: 25 additions & 0 deletions
25
...ins/Auth/Sources/AWSCognitoAuthPlugin/StateMachine/CodeGen/Data/SignUpAttributeType.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// Copyright Amazon.com Inc. or its affiliates. | ||
// All Rights Reserved. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
import Foundation | ||
|
||
@_spi(InternalAmplifyConfiguration) | ||
public enum SignUpAttributeType: String, Codable { | ||
case address = "ADDRESS" | ||
case birthDate = "BIRTHDATE" | ||
case email = "EMAIL" | ||
case familyName = "FAMILY_NAME" | ||
case gender = "GENDER" | ||
case givenName = "GIVEN_NAME" | ||
case middleName = "MIDDLE_NAME" | ||
case name = "NAME" | ||
case nickname = "NICKNAME" | ||
case phoneNumber = "PHONE_NUMBER" | ||
case preferredUsername = "PREFERRED_USERNAME" | ||
case profile = "PROFILE" | ||
case website = "WEBSITE" | ||
} |
27 changes: 27 additions & 0 deletions
27
...fyPlugins/Auth/Sources/AWSCognitoAuthPlugin/StateMachine/CodeGen/Data/UserAttribute.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// Copyright Amazon.com Inc. or its affiliates. | ||
// All Rights Reserved. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
import Foundation | ||
import Amplify | ||
|
||
@_spi(InternalAmplifyConfiguration) | ||
public enum UsernameAttribute: String, Codable { | ||
case username = "USERNAME" | ||
case email = "EMAIL" | ||
case phoneNumber = "PHONE_NUMBER" | ||
|
||
public init?(from authUserAttributeKey: AuthUserAttributeKey) { | ||
switch authUserAttributeKey { | ||
case .email: | ||
self = .email | ||
case .phoneNumber: | ||
self = .phoneNumber | ||
default: | ||
return nil | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...s/Auth/Sources/AWSCognitoAuthPlugin/StateMachine/CodeGen/Data/VerificationMechanism.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// Copyright Amazon.com Inc. or its affiliates. | ||
// All Rights Reserved. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
import Foundation | ||
|
||
@_spi(InternalAmplifyConfiguration) | ||
public enum VerificationMechanism: String, Codable { | ||
case email = "EMAIL" | ||
case phoneNumber = "PHONE_NUMBER" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters