-
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): Update public API request and options parameters (#3373)
* feat(auth): Update public API request and options parameters * Update comments * Address review comments
- Loading branch information
1 parent
f857a08
commit a3288d4
Showing
11 changed files
with
128 additions
and
16 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
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
34 changes: 34 additions & 0 deletions
34
Amplify/Categories/Auth/Request/AuthPasswordlessMagicLinkRequest.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,34 @@ | ||
// | ||
// Copyright Amazon.com Inc. or its affiliates. | ||
// All Rights Reserved. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
import Foundation | ||
|
||
/// Request to sign in a user with Passwordless Magic Link flow | ||
public struct AuthPasswordlessMagicLinkRequest: AmplifyOperationRequest { | ||
|
||
/// Extra request options defined in `AuthPasswordlessMagicLinkRequest.Options` | ||
public var options: Options | ||
|
||
public init(options: Options) { | ||
self.options = options | ||
} | ||
} | ||
|
||
public extension AuthPasswordlessMagicLinkRequest { | ||
|
||
struct Options { | ||
|
||
/// Extra plugin specific options, only used in special circumstances when the existing options do not provide | ||
/// a way to utilize the underlying auth plugin functionality. See plugin documentation for expected | ||
/// key/values | ||
public let pluginOptions: Any? | ||
|
||
public init(pluginOptions: Any? = nil) { | ||
self.pluginOptions = pluginOptions | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
Amplify/Categories/Auth/Request/AuthPasswordlessOTPRequest.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,34 @@ | ||
// | ||
// Copyright Amazon.com Inc. or its affiliates. | ||
// All Rights Reserved. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
import Foundation | ||
|
||
/// Request to sign in a user with Passwordless OTP flow | ||
public struct AuthPasswordlessOTPRequest: AmplifyOperationRequest { | ||
|
||
/// Extra request options defined in `AuthPasswordlessOTPRequest.Options` | ||
public var options: Options | ||
|
||
public init(options: Options) { | ||
self.options = options | ||
} | ||
} | ||
|
||
public extension AuthPasswordlessOTPRequest { | ||
|
||
struct Options { | ||
|
||
/// Extra plugin specific options, only used in special circumstances when the existing options do not provide | ||
/// a way to utilize the underlying auth plugin functionality. See plugin documentation for expected | ||
/// key/values | ||
public let pluginOptions: Any? | ||
|
||
public init(pluginOptions: Any? = nil) { | ||
self.pluginOptions = pluginOptions | ||
} | ||
} | ||
} |
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
17 changes: 17 additions & 0 deletions
17
...s/Auth/Sources/AWSCognitoAuthPlugin/Models/Options/AWSAuthSignInPasswordlessOptions.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,17 @@ | ||
// | ||
// Copyright Amazon.com Inc. or its affiliates. | ||
// All Rights Reserved. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
import Foundation | ||
|
||
public struct AWSAuthSignInPasswordlessOptions { | ||
|
||
public let clientMetadata: [String: String]? | ||
|
||
public init(clientMetadata: [String: String]? = nil) { | ||
self.clientMetadata = clientMetadata | ||
} | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
...urces/AWSCognitoAuthPlugin/Models/Options/AWSAuthSignUpAndSignInPasswordlessOptions.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,20 @@ | ||
// | ||
// Copyright Amazon.com Inc. or its affiliates. | ||
// All Rights Reserved. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
import Foundation | ||
|
||
public struct AWSAuthSignUpAndSignInPasswordlessOptions { | ||
|
||
public let userAttributes: [String: String]? | ||
public let clientMetadata: [String: String]? | ||
|
||
public init(userAttributes: [String: String]? = nil, | ||
clientMetadata: [String: String]? = nil) { | ||
self.userAttributes = userAttributes | ||
self.clientMetadata = clientMetadata | ||
} | ||
|
||
} |
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