Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: kickoff release #133

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions HostApp/HostApp/Views/ExampleLivenessView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ struct ExampleLivenessView: View {
viewModel.presentationState = .error(.socketClosed)
case .failure(.countdownNoFace), .failure(.countdownFaceTooClose), .failure(.countdownMultipleFaces):
viewModel.presentationState = .error(.countdownFaceTooClose)
case .failure(.invalidSignature):
viewModel.presentationState = .error(.invalidSignature)
default:
viewModel.presentationState = .liveness
}
Expand Down Expand Up @@ -70,6 +72,8 @@ struct ExampleLivenessView: View {
LivenessCheckErrorContentView.faceMatchTimeOut
case .countdownNoFace, .countdownFaceTooClose, .countdownMultipleFaces:
LivenessCheckErrorContentView.failedDuringCountdown
case .invalidSignature:
LivenessCheckErrorContentView.invalidSignature
default:
LivenessCheckErrorContentView.unexpected
}
Expand Down
5 changes: 5 additions & 0 deletions HostApp/HostApp/Views/LivenessCheckErrorContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ extension LivenessCheckErrorContentView {
name: "Check failed during countdown",
description: "Avoid moving closer during countdown and ensure only one face is in front of camera."
)

static let invalidSignature = LivenessCheckErrorContentView(
name: "The signature on the request is invalid.",
description: "Ensure the device time is correct and try again."
)
}

struct LivenessCheckErrorContentView_Previews: PreviewProvider {
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ let package = Package(
targets: ["FaceLiveness"]),
],
dependencies: [
.package(url: "https://github.com/aws-amplify/amplify-swift", exact: "2.29.1")
.package(url: "https://github.com/aws-amplify/amplify-swift", exact: "2.29.3")
],
targets: [
.target(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ public struct FaceLivenessDetectionError: Error, Equatable {
recoverySuggestion: ""
)

public static let invalidSignature = FaceLivenessDetectionError(
code: 17,
message: "The signature on the request is invalid.",
recoverySuggestion: "Ensure the device time is correct and try again."
)

public static func == (lhs: FaceLivenessDetectionError, rhs: FaceLivenessDetectionError) -> Bool {
lhs.code == rhs.code
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public struct FaceLivenessDetectorView: View {
case .userCancelled:
return .userCancelled
case .timedOut:
return .sessionTimedOut
return .faceInOvalMatchExceededTimeLimitError
case .socketClosed:
return .socketClosed
default:
Expand Down Expand Up @@ -273,6 +273,8 @@ private func map(detectionCompletion: @escaping (Result<Void, FaceLivenessDetect
detectionCompletion(.failure(.serviceUnavailable))
case .failure(.sessionNotFound):
detectionCompletion(.failure(.sessionNotFound))
case .failure(.invalidSignature):
detectionCompletion(.failure(.invalidSignature))
default:
detectionCompletion(.failure(.unknown))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ final class MockLivenessCaptureSession: LivenessCaptureSession {
displayLink?.invalidate()
}

override func startSession(frame: CGRect) throws -> CALayer {
override func configureCamera(frame: CGRect) throws -> CALayer {
videoRenderView = VideoRenderView(frame: frame)
let asset = AVAsset(url: inputFile)
// Setup display link
Expand Down
Loading