From 4af456d7cb0796408aed297828a54193e2b09415 Mon Sep 17 00:00:00 2001 From: nikhilPank <49190426+nikhilPank@users.noreply.github.com> Date: Tue, 2 Jan 2024 13:26:44 +0000 Subject: [PATCH] SDK-2381: Update IDV example project defaults (#420) Updated IDV examples so sessions configurations uses more desirable values. --- .../src/controllers/index.controller.js | 7 ++----- .../allow.expired.document.check.controller.js | 4 ++-- ...llow.non.latin.document.check.controller.js | 4 ++-- ...thenticity.and.identity.check.controller.js | 10 +++++----- .../document.comparison.check.controller.js | 10 +++++----- .../face.comparison.check.controller.js | 18 +++++++----------- .../use-cases/face.match.check.controller.js | 16 +++++----------- .../use-cases/watchlist.check.controller.js | 8 ++++---- 8 files changed, 32 insertions(+), 45 deletions(-) diff --git a/examples/idv-identity-checks/src/controllers/index.controller.js b/examples/idv-identity-checks/src/controllers/index.controller.js index 449182b6..fb2b53bc 100644 --- a/examples/idv-identity-checks/src/controllers/index.controller.js +++ b/examples/idv-identity-checks/src/controllers/index.controller.js @@ -9,10 +9,7 @@ const config = require('../../config'); * Create an IDV session. */ async function createSession() { - const idvClient = new IDVClient( - config.YOTI_CLIENT_SDK_ID, - config.YOTI_PEM - ); + const idvClient = new IDVClient(config.YOTI_CLIENT_SDK_ID, config.YOTI_PEM); const subject = { subject_id: 'subject_id_string', @@ -28,7 +25,7 @@ async function createSession() { const sessionSpec = new SessionSpecificationBuilder() .withClientSessionTokenTtl(600) - .withResourcesTtl(90000) + .withResourcesTtl(86400) .withUserTrackingId('some-user-tracking-id') .withSubject(subject) .withIdentityProfileRequirements(identityProfileRequirements) diff --git a/examples/idv/src/controllers/use-cases/allow.expired.document.check.controller.js b/examples/idv/src/controllers/use-cases/allow.expired.document.check.controller.js index 5c9dc6ca..890977c8 100644 --- a/examples/idv/src/controllers/use-cases/allow.expired.document.check.controller.js +++ b/examples/idv/src/controllers/use-cases/allow.expired.document.check.controller.js @@ -27,11 +27,11 @@ async function createSession() { const sessionSpec = new SessionSpecificationBuilder() .withClientSessionTokenTtl(600) - .withResourcesTtl(90000) + .withResourcesTtl(86400) .withUserTrackingId('some-user-tracking-id') .withRequestedTask( new RequestedTextExtractionTaskBuilder() - .withManualCheckAlways() + .withManualCheckFallback() .build() ) // With OrthogonalRestrictionsFilterBuilder diff --git a/examples/idv/src/controllers/use-cases/allow.non.latin.document.check.controller.js b/examples/idv/src/controllers/use-cases/allow.non.latin.document.check.controller.js index ef528c2a..b600dc19 100644 --- a/examples/idv/src/controllers/use-cases/allow.non.latin.document.check.controller.js +++ b/examples/idv/src/controllers/use-cases/allow.non.latin.document.check.controller.js @@ -27,11 +27,11 @@ async function createSession() { const sessionSpec = new SessionSpecificationBuilder() .withClientSessionTokenTtl(600) - .withResourcesTtl(90000) + .withResourcesTtl(86400) .withUserTrackingId('some-user-tracking-id') .withRequestedTask( new RequestedTextExtractionTaskBuilder() - .withManualCheckAlways() + .withManualCheckFallback() .build() ) // With OrthogonalRestrictionsFilterBuilder diff --git a/examples/idv/src/controllers/use-cases/authenticity.and.identity.check.controller.js b/examples/idv/src/controllers/use-cases/authenticity.and.identity.check.controller.js index 554dec61..4ec19347 100644 --- a/examples/idv/src/controllers/use-cases/authenticity.and.identity.check.controller.js +++ b/examples/idv/src/controllers/use-cases/authenticity.and.identity.check.controller.js @@ -20,11 +20,11 @@ async function createSession() { const sessionSpec = new SessionSpecificationBuilder() .withClientSessionTokenTtl(600) - .withResourcesTtl(90000) + .withResourcesTtl(86400) .withUserTrackingId('some-user-tracking-id') .withRequestedCheck( new RequestedDocumentAuthenticityCheckBuilder() - .withManualCheckAlways() + .withManualCheckFallback() .build() ) .withRequestedCheck( @@ -33,7 +33,7 @@ async function createSession() { ) .withRequestedTask( new RequestedTextExtractionTaskBuilder() - .withManualCheckAlways() + .withManualCheckFallback() .withChipDataDesired() .withCreateExpandedDocumentFields(true) // default is false .build() @@ -49,8 +49,8 @@ async function createSession() { .withSuccessUrl(`${config.YOTI_APP_BASE_URL}/success`) .withErrorUrl(`${config.YOTI_APP_BASE_URL}/error`) .withAllowHandoff(true) - .withIdDocumentTextExtractionGenericRetries(5) - .withIdDocumentTextExtractionReclassificationRetries(5) + .withIdDocumentTextExtractionGenericRetries(3) + .withIdDocumentTextExtractionReclassificationRetries(3) .build() ) .withRequiredDocument( diff --git a/examples/idv/src/controllers/use-cases/document.comparison.check.controller.js b/examples/idv/src/controllers/use-cases/document.comparison.check.controller.js index 1bfa3251..50249842 100644 --- a/examples/idv/src/controllers/use-cases/document.comparison.check.controller.js +++ b/examples/idv/src/controllers/use-cases/document.comparison.check.controller.js @@ -23,7 +23,7 @@ async function createSession() { const sessionSpec = new SessionSpecificationBuilder() .withClientSessionTokenTtl(600) - .withResourcesTtl(90000) + .withResourcesTtl(86400) .withUserTrackingId('some-user-tracking-id') .withRequestedCheck( new RequestedIdDocumentComparisonCheckBuilder() @@ -31,14 +31,14 @@ async function createSession() { ) .withRequestedTask( new RequestedTextExtractionTaskBuilder() - .withManualCheckAlways() + .withManualCheckFallback() .withChipDataDesired() .withCreateExpandedDocumentFields(true) // default is false .build() ) .withRequestedTask( new RequestedSupplementaryDocTextExtractionTaskBuilder() - .withManualCheckAlways() + .withManualCheckFallback() .build() ) .withRequiredDocument( @@ -67,8 +67,8 @@ async function createSession() { .withPresetIssuingCountry('GBR') .withSuccessUrl(`${config.YOTI_APP_BASE_URL}/success`) .withErrorUrl(`${config.YOTI_APP_BASE_URL}/error`) - .withIdDocumentTextExtractionGenericRetries(5) - .withIdDocumentTextExtractionReclassificationRetries(5) + .withIdDocumentTextExtractionGenericRetries(3) + .withIdDocumentTextExtractionReclassificationRetries(3) .build() ) .build(); diff --git a/examples/idv/src/controllers/use-cases/face.comparison.check.controller.js b/examples/idv/src/controllers/use-cases/face.comparison.check.controller.js index e09f801f..23261195 100644 --- a/examples/idv/src/controllers/use-cases/face.comparison.check.controller.js +++ b/examples/idv/src/controllers/use-cases/face.comparison.check.controller.js @@ -17,18 +17,14 @@ async function createSession() { const sessionSpec = new SessionSpecificationBuilder() .withClientSessionTokenTtl(600) - .withResourcesTtl(90000) + .withResourcesTtl(86400) .withUserTrackingId('some-user-tracking-id') - // For zoom liveness check [only one type of liveness check to be enabled at a time] - .withRequestedCheck(new RequestedLivenessCheckBuilder() - .forZoomLiveness() - .build()) - // For static liveness check - // .withRequestedCheck( - // new RequestedLivenessCheckBuilder() - // .forStaticLiveness() - // .build() - // ) + + .withRequestedCheck( + new RequestedLivenessCheckBuilder() + .forStaticLiveness() + .build() + ) .withRequestedCheck(new RequestedFaceComparisonCheckBuilder() .withManualCheckNever() .build()) diff --git a/examples/idv/src/controllers/use-cases/face.match.check.controller.js b/examples/idv/src/controllers/use-cases/face.match.check.controller.js index cc105d44..50092c96 100644 --- a/examples/idv/src/controllers/use-cases/face.match.check.controller.js +++ b/examples/idv/src/controllers/use-cases/face.match.check.controller.js @@ -19,20 +19,14 @@ async function createSession() { const sessionSpec = new SessionSpecificationBuilder() .withClientSessionTokenTtl(600) - .withResourcesTtl(90000) + .withResourcesTtl(86400) .withUserTrackingId('some-user-tracking-id') - // For zoom liveness check [only one type of liveness check to be enabled at a time] + .withRequestedCheck( new RequestedLivenessCheckBuilder() - .forZoomLiveness() + .forStaticLiveness() .build() ) - // For static liveness check - // .withRequestedCheck( - // new RequestedLivenessCheckBuilder() - // .forStaticLiveness() - // .build() - // ) .withRequestedCheck( new RequestedFaceMatchCheckBuilder() .withManualCheckNever() @@ -50,8 +44,8 @@ async function createSession() { .withErrorUrl(`${config.YOTI_APP_BASE_URL}/error`) .withPrivacyPolicyUrl(`${config.YOTI_APP_BASE_URL}/privacy-policy`) .withEarlyBiometricConsentFlow() // or withJustInTimeBiometricConsentFlow() - .withIdDocumentTextExtractionGenericRetries(5) - .withIdDocumentTextExtractionReclassificationRetries(5) + .withIdDocumentTextExtractionGenericRetries(3) + .withIdDocumentTextExtractionReclassificationRetries(3) .build() ) .build(); diff --git a/examples/idv/src/controllers/use-cases/watchlist.check.controller.js b/examples/idv/src/controllers/use-cases/watchlist.check.controller.js index fa28e18b..1664b49f 100644 --- a/examples/idv/src/controllers/use-cases/watchlist.check.controller.js +++ b/examples/idv/src/controllers/use-cases/watchlist.check.controller.js @@ -60,7 +60,7 @@ async function createSession() { const sessionSpec = new SessionSpecificationBuilder() .withClientSessionTokenTtl(600) - .withResourcesTtl(90000) + .withResourcesTtl(86400) .withUserTrackingId('some-user-tracking-id') .withRequestedCheck( new RequestedWatchlistScreeningCheckBuilder() @@ -75,7 +75,7 @@ async function createSession() { ) .withRequestedTask( new RequestedTextExtractionTaskBuilder() - .withManualCheckAlways() + .withManualCheckFallback() .withChipDataDesired() .withCreateExpandedDocumentFields(true) // default is false .build() @@ -89,8 +89,8 @@ async function createSession() { .withPresetIssuingCountry('GBR') .withSuccessUrl(`${config.YOTI_APP_BASE_URL}/success`) .withErrorUrl(`${config.YOTI_APP_BASE_URL}/error`) - .withIdDocumentTextExtractionGenericRetries(5) - .withIdDocumentTextExtractionReclassificationRetries(5) + .withIdDocumentTextExtractionGenericRetries(3) + .withIdDocumentTextExtractionReclassificationRetries(3) .build() ) .build();