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

Release 3.10.0 #482

Merged
merged 31 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
75746c6
SDK: Bump DEVELOPMENT version to 3.10.0-SNAPSHOT
MrBurtyyy Jul 10, 2024
4244aef
SDK-2437: Add support for setting sandbox response configuration for …
MrBurtyyy Jul 10, 2024
d5da728
SDK-2445: [AB] Add text-extraction task recommendation to the GET ses…
MrBurtyyy Aug 12, 2024
528dbd1
SDK-2467: [AB] Allow the brand ID to be set at session creation (as p…
MrBurtyyy Aug 9, 2024
e5c0b03
SDK-2309: Add support for setting biometric consent flow for a session
MrBurtyyy Sep 23, 2024
26b71ed
SDK-2340: Allow Relying Business to configure if expanded document fi…
MrBurtyyy Sep 23, 2024
364d037
SDK-2340: Add missing javadoc comments / add missing test
bucky-boy Sep 23, 2024
721a8cf
SDK-2486: Add support for primary colour dark mode to be set at sdk c…
Sep 22, 2024
ec18bef
SDK-2486: Add support for dark mode to be set at sdk config creation
Sep 22, 2024
e1224a6
SDK-2486: Amended Java Doc comments / helper methods should always us…
bucky-boy Sep 23, 2024
8b913d3
Merge pull request #456 from getyoti/SDK-2486
artem-yoti Sep 23, 2024
e5a6e86
NA: Straighten out a unit test
bucky-boy Sep 23, 2024
c2f3552
NA: UTs can just use assertThrows instead of try-catch
bucky-boy Sep 23, 2024
537c4e7
SDK-2339: Allow the Relying Business to retrieve expanded document fi…
MrBurtyyy Sep 23, 2024
1538ee0
NA: Standardise structure of UTs in DocScanServiceTest
bucky-boy Sep 23, 2024
bddc4a5
SDK-2493: Add new helper methods for session notifications
MrBurtyyy Sep 23, 2024
6ecb704
SDK-2521: Support detected document_type in IDV Sandbox SDK
bucky-boy Sep 23, 2024
6649c24
SDK-2507: Allow the Relying Business to set response delay for tasks …
MrBurtyyy Sep 24, 2024
234f730
SDK-2478: Allow the Relying Business to retrieve tracked devices for …
MrBurtyyy Sep 24, 2024
7f531f2
SDK-2478: Allow the Relying Business to delete tracked device metadat…
MrBurtyyy Sep 24, 2024
6279ca6
NA: Drop unhelpful tests on GetSessionResult
bucky-boy Sep 24, 2024
8c2a1bc
NA: Make remaining tests in GetSessionResultCheckTest a little more h…
bucky-boy Sep 24, 2024
9cd130e
NA: Consolidate remaining tests in GetSessionResultCheckTest
bucky-boy Sep 24, 2024
9bd58a7
NA: We don't need the UTs to test jackson for us
bucky-boy Sep 24, 2024
a7b674d
NA: Consolidate tests for GetSessionResultTest
bucky-boy Sep 24, 2024
fad292c
NA: Straighten out ResourceContainerTest
bucky-boy Sep 24, 2024
5123a0b
SDK-2528: Helper method for finding the Resources that belong to a Check
bucky-boy Sep 24, 2024
1c07134
SDK-2309: [MB] The biometric_consent_flow is EARLY not EAGER
bucky-boy Sep 25, 2024
703d501
Release 3.10.0: Update example project to show new properties
MrBurtyyy Sep 26, 2024
1888d34
RELEASE-3.10.0: Make sessionId request parameter optional in IDV demo…
MrBurtyyy Oct 22, 2024
8b2ca6b
Release 3.10.0: Set version for release
MrBurtyyy Dec 9, 2024
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: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ If you are using Maven, you need to add the following dependency:
<dependency>
<groupId>com.yoti</groupId>
<artifactId>yoti-sdk-api</artifactId>
<version>3.9.0</version>
<version>3.10.0</version>
</dependency>
```

If you are using Gradle, here is the dependency to add:

`compile group: 'com.yoti', name: 'yoti-sdk-api', version: '3.9.0'`
`compile group: 'com.yoti', name: 'yoti-sdk-api', version: '3.10.0'`

You will find all classes packaged under `com.yoti.api`

Expand Down
2 changes: 1 addition & 1 deletion examples/doc-scan/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<dependency>
<groupId>com.yoti</groupId>
<artifactId>yoti-sdk-api</artifactId>
<version>3.9.0</version>
<version>3.10.0</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package com.yoti.docscan.demo.controller;

import java.util.List;

import javax.servlet.http.HttpSession;

import com.yoti.api.client.Media;
import com.yoti.api.client.docs.DocScanClient;
import com.yoti.api.client.docs.DocScanException;
import com.yoti.api.client.docs.session.create.CreateSessionResult;
import com.yoti.api.client.docs.session.devicemetadata.MetadataResponse;
import com.yoti.api.client.docs.session.retrieve.GetSessionResult;
import com.yoti.docscan.demo.service.DocScanService;

Expand All @@ -23,6 +26,7 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
Expand Down Expand Up @@ -68,8 +72,13 @@ public String getIndex(final Model model, HttpSession httpSession) {
}

@RequestMapping(value = "/success", method = RequestMethod.GET)
public String getUserSession(final Model model, HttpSession httpSession) {
String sessionId = (String) httpSession.getAttribute(DOC_SCAN_SESSION_ID);
public String getUserSession(@RequestParam(value = "sessionId", required = false) String sessionIdQueryParam, final Model model, HttpSession httpSession) {
String sessionId;
if (sessionIdQueryParam != null) {
sessionId = sessionIdQueryParam;
} else {
sessionId = (String) httpSession.getAttribute(DOC_SCAN_SESSION_ID);
}

if (sessionId == null || sessionId.equals("")) {
return "redirect:/";
Expand Down Expand Up @@ -117,6 +126,11 @@ public ResponseEntity<byte[]> getMedia(
return new ResponseEntity<>(media.getContent(), headers, HttpStatus.OK);
}

@RequestMapping(value = "/tracked-devices", method = RequestMethod.GET)
public @ResponseBody List<MetadataResponse> getTrackedDevices(@RequestParam(value = "sessionId") String sessionId) throws DocScanException {
return docScanService.getTrackedDevices(sessionId);
}

@RequestMapping(value = "/privacy-policy", method = RequestMethod.GET)
public String showPrivacyPolicyPage() {
return "privacy";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.yoti.docscan.demo.service;

import java.util.Arrays;
import java.util.List;

import com.yoti.api.client.Media;
import com.yoti.api.client.docs.DocScanClient;
Expand All @@ -22,6 +23,7 @@
import com.yoti.api.client.docs.session.create.objective.ProofOfAddressObjective;
import com.yoti.api.client.docs.session.create.task.RequestedIdDocTextExtractionTask;
import com.yoti.api.client.docs.session.create.task.RequestedSupplementaryDocTextExtractionTask;
import com.yoti.api.client.docs.session.devicemetadata.MetadataResponse;
import com.yoti.api.client.docs.session.retrieve.GetSessionResult;
import com.yoti.api.client.spi.remote.call.YotiConstants;

Expand Down Expand Up @@ -148,4 +150,8 @@ public String getIframeUrl(CreateSessionResult createSessionResult) {
public Media getMedia(String sessionId, String mediaId) throws DocScanException {
return docScanClient.getMediaContent(sessionId, mediaId);
}

public List<MetadataResponse> getTrackedDevices(String sessionId) throws DocScanException {
return docScanClient.getTrackedDevices(sessionId);
}
}
45 changes: 45 additions & 0 deletions examples/doc-scan/src/main/resources/templates/success.html
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,40 @@ <h5>Media</h5>
</div>
</div>

<!-- Expanded Document Fields -->
<div class="card" th:if="${document.getExpandedDocumentFields() != null}">
<div class="card-header" th:id="${'expanded-document-fields-' + iter.index}">
<h4 class="mb-0">
<button class="btn btn-link" type="button" data-toggle="collapse"
th:attr="data-target='#collapse-expanded-document-fields-' + ${iter.index}"
th:attrappend="aria-controls='collapse-expanded-document-fields-' + ${iter.index}"
aria-expanded="true">
Expanded Document Fields
</button>
</h4>
</div>
<div th:id="${'collapse-expanded-document-fields-' + iter.index}" class="collapse"
th:aria-labelledby="${'expanded-document-fields-' + iter.index}">
<div class="card-body">
<th:block th:if="${document.getExpandedDocumentFields().getMedia() != null}">
<h5>Media</h5>
<table class="table table-striped table-light">
<tbody>
<tr>
<td>ID</td>
<td>
<a th:href="${'/media?mediaId=' + document.getDocumentFields().getMedia().getId()}"
th:text="${document.getDocumentFields().getMedia().getId()}">
</a>
</td>
</tr>
</tbody>
</table>
</th:block>
</div>
</div>
</div>

<!-- Document ID Photo -->
<div class="card" th:if="${document.getDocumentIdPhoto() != null}">
<div class="card-header" th:id="${'document-id-photo-' + iter.index}">
Expand Down Expand Up @@ -1010,6 +1044,17 @@ <h4 class="mb-0">
</th:block>
</th:block>

<div class="row pt-4">
<div class="col">
<h2>
Tracked Devices
<a th:href="${'/tracked-devices?sessionId=' + sessionResult.getSessionId()}">
<span class="badge badge-success" th:href="${'/tracked-devices?sessionId=' + sessionResult.getSessionId()}" th:text="GET">
</span>
</a>
</h2>
</div>
</div>
</div>

<div th:replace="fragments/components :: footer"></div>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>com.yoti</groupId>
<artifactId>yoti-sdk</artifactId>
<packaging>pom</packaging>
<version>3.9.0</version>
<version>3.10.0</version>
<name>Yoti SDK</name>
<description>Java SDK for simple integration with the Yoti platform</description>
<url>https://github.com/getyoti/yoti-java-sdk</url>
Expand Down
2 changes: 1 addition & 1 deletion yoti-sdk-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>com.yoti</groupId>
<artifactId>yoti-sdk-parent</artifactId>
<version>3.9.0</version>
<version>3.10.0</version>
<relativePath>../yoti-sdk-parent</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.io.IOException;
import java.security.KeyPair;
import java.security.Security;
import java.util.List;

import com.yoti.api.client.InitialisationException;
import com.yoti.api.client.KeyPairSource;
Expand All @@ -14,6 +15,7 @@
import com.yoti.api.client.docs.session.create.SessionSpec;
import com.yoti.api.client.docs.session.create.facecapture.CreateFaceCaptureResourcePayload;
import com.yoti.api.client.docs.session.create.facecapture.UploadFaceCaptureImagePayload;
import com.yoti.api.client.docs.session.devicemetadata.MetadataResponse;
import com.yoti.api.client.docs.session.instructions.Instructions;
import com.yoti.api.client.docs.session.retrieve.CreateFaceCaptureResourceResponse;
import com.yoti.api.client.docs.session.retrieve.GetSessionResult;
Expand Down Expand Up @@ -242,6 +244,31 @@ public SessionConfigurationResponse getSessionConfiguration(String sessionId) th
return docScanService.fetchSessionConfiguration(sdkId, keyPair, sessionId);
}

/**
* Fetches details of the devices tracked at key points in completing the session.
*
* @param sessionId the session ID
*
* @return the list of tracked devices information
* @throws DocScanException if an error has occurred
*/
public List<MetadataResponse> getTrackedDevices(String sessionId) throws DocScanException {
LOG.debug("Fetching tracked devices for session '{}'", sessionId);
return docScanService.getTrackedDevices(sdkId, keyPair, sessionId);
}

/**
* Deletes the tracked devices metadata for the given sessionID.
*
* @param sessionId the session ID
*
* @throws DocScanException if an error has occurred
*/
public void deleteTrackedDevices(String sessionId) throws DocScanException {
LOG.debug("Deleting tracked devices for session '{}'", sessionId);
docScanService.deleteTrackedDevices(sdkId, keyPair, sessionId);
}

private KeyPair loadKeyPair(KeyPairSource kpSource) throws InitialisationException {
try {
LOG.debug("Loading key pair from '{}'", kpSource);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ private DocScanConstants() { }
public static final String CHECK_COMPLETION = "CHECK_COMPLETION";
public static final String SESSION_COMPLETION = "SESSION_COMPLETION";
public static final String CLIENT_SESSION_TOKEN_DELETED = "CLIENT_SESSION_TOKEN_DELETED";
public static final String NEW_PDF_SUPPLIED = "NEW_PDF_SUPPLIED";
public static final String INSTRUCTIONS_EMAIL_REQUESTED = "INSTRUCTIONS_EMAIL_REQUESTED";
public static final String THANK_YOU_EMAIL_REQUESTED = "THANK_YOU_EMAIL_REQUESTED";
public static final String FIRST_BRANCH_VISIT = "FIRST_BRANCH_VISIT";

public static final String ALWAYS = "ALWAYS";
public static final String FALLBACK = "FALLBACK";
Expand Down Expand Up @@ -83,4 +87,11 @@ private DocScanConstants() { }

public static final String GBP = "GBP";

public static final String EARLY = "EARLY";
public static final String JUST_IN_TIME = "JUST_IN_TIME";

public static final String ON = "ON";
public static final String OFF = "OFF";
public static final String AUTO = "AUTO";

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.yoti.api.client.docs.session.create.SessionSpec;
import com.yoti.api.client.docs.session.create.facecapture.CreateFaceCaptureResourcePayload;
import com.yoti.api.client.docs.session.create.facecapture.UploadFaceCaptureImagePayload;
import com.yoti.api.client.docs.session.devicemetadata.MetadataResponse;
import com.yoti.api.client.docs.session.instructions.Instructions;
import com.yoti.api.client.docs.session.retrieve.CreateFaceCaptureResourceResponse;
import com.yoti.api.client.docs.session.retrieve.GetSessionResult;
Expand All @@ -39,6 +40,7 @@
import com.yoti.api.client.spi.remote.call.factory.UnsignedPathFactory;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
Expand All @@ -52,6 +54,9 @@
final class DocScanService {

private static final Logger LOG = LoggerFactory.getLogger(DocScanService.class);

private static final TypeReference<List<MetadataResponse>> METADATA_RESPONSE_TYPE_REF = new TypeReference<List<MetadataResponse>>() {};

private static final int HTTP_STATUS_NO_CONTENT = 204;
private static final String YOTI_MULTIPART_BOUNDARY = "yoti-doc-scan-boundary";

Expand Down Expand Up @@ -527,6 +532,53 @@ public void triggerIbvEmailNotification(String sdkId, KeyPair keyPair, String se
}
}

public List<MetadataResponse> getTrackedDevices(String sdkId, KeyPair keyPair, String sessionId) throws DocScanException {
notNullOrEmpty(sdkId, "SDK ID");
notNull(keyPair, "Application key Pair");
notNullOrEmpty(sessionId, "sessionId");

String path = unsignedPathFactory.createFetchTrackedDevices(sdkId, sessionId);
LOG.info("Fetching tracked devices at '{}'", path);

try {
SignedRequest signedRequest = signedRequestBuilderFactory.create()
.withKeyPair(keyPair)
.withBaseUrl(apiUrl)
.withEndpoint(path)
.withHttpMethod(HTTP_GET)
.build();

return signedRequest.execute(METADATA_RESPONSE_TYPE_REF);
} catch (GeneralSecurityException | ResourceException ex) {
throw new DocScanException("Error executing the GET: " + ex.getMessage(), ex);
} catch (IOException | URISyntaxException ex) {
throw new DocScanException("Error building the request: " + ex.getMessage(), ex);
}
}

public void deleteTrackedDevices(String sdkId, KeyPair keyPair, String sessionId) throws DocScanException {
notNullOrEmpty(sdkId, "SDK ID");
notNull(keyPair, "Application key Pair");
notNullOrEmpty(sessionId, "sessionId");

String path = unsignedPathFactory.createDeleteTrackedDevices(sdkId, sessionId);
LOG.info("Deleting tracked devices at '{}'", path);

try {
signedRequestBuilderFactory.create()
.withKeyPair(keyPair)
.withBaseUrl(apiUrl)
.withEndpoint(path)
.withHttpMethod(HTTP_DELETE)
.build()
.execute();
} catch (GeneralSecurityException | ResourceException ex) {
throw new DocScanException("Error executing the GET: " + ex.getMessage(), ex);
} catch (IOException | URISyntaxException ex) {
throw new DocScanException("Error building the request: " + ex.getMessage(), ex);
}
}

private String findContentType(SignedRequestResponse response) {
List<String> contentTypeValues = null;
for (Map.Entry<String, List<String>> entry : response.getResponseHeaders().entrySet()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,42 @@ public Builder forClientSessionCompletion() {
return withTopic(DocScanConstants.CLIENT_SESSION_TOKEN_DELETED);
}

/**
* Adds NEW_PDF_SUPPLIED to the list of topics that trigger notification messages
*
* @return the builder
*/
public Builder forNewPdfSupplied() {
return withTopic(DocScanConstants.NEW_PDF_SUPPLIED);
}

/**
* Adds INSTRUCTIONS_EMAIL_REQUESTED to the list of topics that trigger notification messages
*
* @return the builder
*/
public Builder forInstructionsEmailRequested() {
return withTopic(DocScanConstants.INSTRUCTIONS_EMAIL_REQUESTED);
}

/**
* Adds THANK_YOU_EMAIL_REQUESTED to the list of topics that trigger notification messages
*
* @return the builder
*/
public Builder forThankYouEmailRequested() {
return withTopic(DocScanConstants.THANK_YOU_EMAIL_REQUESTED);
}

/**
* Adds FIRST_BRANCH_VISIT to the list of topics that trigger notification messages
*
* @return the builder
*/
public Builder forFirstBranchVisit() {
return withTopic(DocScanConstants.FIRST_BRANCH_VISIT);
}

/**
* Adds a topic to the list of topics that trigger notification messages
*
Expand Down
Loading
Loading