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

feat(predictions): Add support for a no light freshness challenge #2841

Merged
merged 9 commits into from
Jul 2, 2024

Conversation

vincetran
Copy link
Member

@vincetran vincetran commented Jun 4, 2024

  • PR title and description conform to Pull Request guidelines.

Issue #, if available: N/A

Description of changes:
This adds support for a no-light challenge to the Prediction plugin's Face LIveness feature and adds telemetry tracking as requested by the Rekognition team. There's no API change to the core plugin API and additive changes to the FaceLivenessSessionInformation data class that's used as part of the API.

Notable callouts:

  • FaceLivenessSessionInformation
    • Changed the String challenge parameter to be nullable. This is required to allow backward compatibility with the existing Liveness UI component library.
    • Added a new parameter challengeVersions to replace the previous challenge which takes in a List<Challenge>. These Challenges represent both the challenge name and the version for that challenge.
    • Added a new parameter preCheckViewEnabled which signifies if the default "Start View" was enabled. Used for telemetry.
    • Added a new parameter attemptCount which signifies how many times the user attempted to perform the liveness check. Used for telemetry.
  • Added a new supported challenge called FaceMovementChallenge that will live alongside the existing supported FaceMovementAndLightChallenge
  • Updated the websocket endpoint generation to use a Uri.Builder() for code cleanliness
  • Added support for a new web socket event called ChallengeType which is used for determining what type of challenge is requested from the backend to render to the user.

How did you test these changes?

  • Updated and added unit tests for the new ChallengeType event
  • Tested with a corresponding Amplify UI change that accepts the new challenge type and renders it
  • Tested with the existing version of Amplify UI to ensure backwards compatibility

Documentation update required?

  • No
  • Yes (Please include a PR link for the documentation update)

General Checklist

  • Added Unit Tests
  • Added Integration Tests
  • Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@vincetran vincetran added the predictions Related to the Predictions category/plugins label Jun 4, 2024
@vincetran vincetran requested a review from a team as a code owner June 4, 2024 20:34
Copy link
Member

@tylerjroach tylerjroach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add some tests on the new UrlBuilder being used on the websocket?

@vincetran vincetran force-pushed the liveness-no-light-sku-support branch from 11f2e23 to 13e4a1b Compare June 19, 2024 21:44
@vincetran vincetran force-pushed the liveness-no-light-sku-support branch from fae9a82 to b51112b Compare June 26, 2024 20:06
@vincetran vincetran force-pushed the liveness-no-light-sku-support branch from 14f2487 to ea3d768 Compare July 2, 2024 14:05
@vincetran vincetran requested a review from phantumcode July 2, 2024 17:52
@vincetran vincetran merged commit f37e5b0 into main Jul 2, 2024
3 checks passed
@vincetran vincetran deleted the liveness-no-light-sku-support branch July 2, 2024 18:25
@vincetran vincetran restored the liveness-no-light-sku-support branch July 2, 2024 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
predictions Related to the Predictions category/plugins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants