-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(predictions): add public definitions for no light challenge supp…
…ort (#3617) * feat(predictions): add public definitions for no light challenge support * Add missing files * fix swiftlint issue * feat(predictions): add implementation for no light support (#3618) * feat(predictions): add implementation for no light support * fix swiftlint issue * address review comments * address review comments * address review comments
- Loading branch information
1 parent
bdfa37a
commit 15489e7
Showing
16 changed files
with
356 additions
and
72 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
15 changes: 15 additions & 0 deletions
15
...ugins/Predictions/AWSPredictionsPlugin/Liveness/Model/FaceLivenessSession+Challenge.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,15 @@ | ||
// | ||
// Copyright Amazon.com Inc. or its affiliates. | ||
// All Rights Reserved. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
import Foundation | ||
|
||
extension FaceLivenessSession { | ||
public static let supportedChallenges: [Challenge] = [ | ||
Challenge(version: "2.0.0", type: .faceMovementAndLightChallenge), | ||
Challenge(version: "1.0.0", type: .faceMovementChallenge) | ||
] | ||
} |
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
AmplifyPlugins/Predictions/AWSPredictionsPlugin/Liveness/Service/Challenge.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 | ||
|
||
@_spi(PredictionsFaceLiveness) | ||
public struct Challenge { | ||
public let version: String | ||
public let type: ChallengeType | ||
|
||
public init(version: String, type: ChallengeType) { | ||
self.version = version | ||
self.type = type | ||
} | ||
|
||
public func queryParameterString() -> String { | ||
return self.type.rawValue + "_" + self.version | ||
} | ||
} | ||
|
||
@_spi(PredictionsFaceLiveness) | ||
public enum ChallengeType: String, Codable { | ||
case faceMovementChallenge = "FaceMovementChallenge" | ||
case faceMovementAndLightChallenge = "FaceMovementAndLightChallenge" | ||
} |
Oops, something went wrong.