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

Bump hamcrest.version from 2.2 to 3.0 #477

Open
wants to merge 40 commits into
base: DEVELOPMENT
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
40 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
7e5a121
DEVELOPMENT: Bump version to 4.0.0-SNAPSHOT
MrBurtyyy Sep 27, 2024
81d5b99
SDK-2531: Update SessionSpec to use strongly typed object for Identit…
MrBurtyyy Sep 27, 2024
6e85c96
SDK-2532: Update SessionSpec to use strongly typed object for Identit…
MrBurtyyy Sep 27, 2024
7ae7fd5
SDK-2533: Change IdentityProfileResponse to use a stronly typed objec…
MrBurtyyy Sep 27, 2024
f751604
SDK-2532: Rename IdentityProfileSubjectPayload -> SubjectPayload
MrBurtyyy Sep 27, 2024
84992e3
NA: Inline JSON property name in IDV classes
MrBurtyyy Sep 27, 2024
0b634d1
NA: Optimize imports
MrBurtyyy Sep 27, 2024
85e526a
Bump org.apache.commons:commons-lang3 from 3.13.0 to 3.17.0
dependabot[bot] Sep 27, 2024
19baae6
Bump slf4j.version from 2.0.9 to 2.0.16
dependabot[bot] Sep 30, 2024
8be82c5
NA: Update README with breaking changes in 4.0.0
MrBurtyyy Sep 30, 2024
bfcc6eb
Bump hamcrest.version from 2.2 to 3.0
dependabot[bot] Oct 1, 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
Prev Previous commit
Next Next commit
SDK-2531: Update SessionSpec to use strongly typed object for Identit…
…y Profile requirements
MrBurtyyy committed Sep 27, 2024
commit 81d5b99d05a1d94a79e8fca2c7b6519d0483dddf
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@
import com.yoti.api.client.docs.session.create.check.RequestedCheck;
import com.yoti.api.client.docs.session.create.filters.RequiredDocument;
import com.yoti.api.client.docs.session.create.identityprofile.advanced.AdvancedIdentityProfileRequirementsPayload;
import com.yoti.api.client.docs.session.create.identityprofile.simple.IdentityProfileRequirementsPayload;
import com.yoti.api.client.docs.session.create.resources.ResourceCreationContainer;
import com.yoti.api.client.docs.session.create.task.RequestedTask;

@@ -55,7 +56,7 @@ public class SessionSpec {
private final IbvOptions ibvOptions;

@JsonProperty(Property.IDENTITY_PROFILE_REQUIREMENTS)
private final Map<String, Object> identityProfile;
private final IdentityProfileRequirementsPayload identityProfile;

@JsonProperty(Property.ADVANCED_IDENTITY_PROFILE_REQUIREMENTS)
private final AdvancedIdentityProfileRequirementsPayload advancedIdentityProfileRequirements;
@@ -81,7 +82,7 @@ public class SessionSpec {
Boolean blockBiometricConsent,
IbvOptions ibvOptions,
ZonedDateTime sessionDeadline,
Map<String, Object> identityProfile,
IdentityProfileRequirementsPayload identityProfile,
Map<String, Object> subject,
ResourceCreationContainer resources,
Boolean createIdentityProfilePreview,
@@ -223,7 +224,7 @@ public ZonedDateTime getSessionDeadline() {
*
* @return Identity Profile
*/
public Object getIdentityProfile() {
public IdentityProfileRequirementsPayload getIdentityProfile() {
return identityProfile;
}

@@ -277,7 +278,7 @@ public static class Builder {
private Boolean blockBiometricConsent;
private IbvOptions ibvOptions;
private ZonedDateTime sessionDeadline;
private Map<String, Object> identityProfile;
private IdentityProfileRequirementsPayload identityProfile;
private AdvancedIdentityProfileRequirementsPayload advancedIdentityProfileRequirementsPayload;
private Map<String, Object> subject;
private ResourceCreationContainer resources;
@@ -428,7 +429,7 @@ public Builder withSessionDeadline(ZonedDateTime sessionDeadline) {
* @param identityProfile the Identity Profile
* @return the Builder
*/
public Builder withIdentityProfile(Map<String, Object> identityProfile) {
public Builder withIdentityProfile(IdentityProfileRequirementsPayload identityProfile) {
this.identityProfile = identityProfile;
return this;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
package com.yoti.api.client.docs.session.create.identityprofile.simple;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonInclude(JsonInclude.Include.NON_NULL)
public class IdentityProfileRequirementsPayload {

@JsonProperty("trust_framework")
private final String trustFramework;

@JsonProperty("scheme")
private final IdentityProfileSchemePayload scheme;

IdentityProfileRequirementsPayload(String trustFramework, IdentityProfileSchemePayload scheme) {
this.trustFramework = trustFramework;
this.scheme = scheme;
}

public static Builder builder() {
return new Builder();
}

public String getTrustFramework() {
return trustFramework;
}

public IdentityProfileSchemePayload getScheme() {
return scheme;
}

public static class Builder {

private String trustFramework;
private IdentityProfileSchemePayload scheme;

Builder() {}

/**
* Sets the trust framework name for the Identity Profile requirement
*
* @param trustFramework the name of the trust framework
* @return the builder
*/
public Builder withTrustFramework(String trustFramework) {
this.trustFramework = trustFramework;
return this;
}

/**
* Sets the scheme for the Identity Profile requirement
*
* @param scheme the scheme
* @return the builder
*/
public Builder withScheme(IdentityProfileSchemePayload scheme) {
this.scheme = scheme;
return this;
}

public IdentityProfileRequirementsPayload build() {
return new IdentityProfileRequirementsPayload(trustFramework, scheme);
}

}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
package com.yoti.api.client.docs.session.create.identityprofile.simple;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonInclude(JsonInclude.Include.NON_NULL)
public class IdentityProfileSchemePayload {

@JsonProperty("type")
private final String type;

@JsonProperty("objective")
private final String objective;

IdentityProfileSchemePayload(String type, String objective) {
this.type = type;
this.objective = objective;
}

public static Builder builder() {
return new Builder();
}

public String getType() {
return type;
}

public String getObjective() {
return objective;
}

public static class Builder {

private String type;
private String objective;

Builder() {}

/**
* Sets the type of the scheme for the Identity Profile
*
* @param type the type of scheme
* @return the builder
*/
public Builder withType(String type) {
this.type = type;
return this;
}

/**
* Sets the objective of the scheme for the Identity Profile
*
* @param objective the objective of the scheme
* @return the builder
*/
public Builder withObjective(String objective) {
this.objective = objective;
return this;
}

public IdentityProfileSchemePayload build() {
return new IdentityProfileSchemePayload(type, objective);
}

}

}
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@
import com.yoti.api.client.docs.session.create.check.RequestedDocumentAuthenticityCheck;
import com.yoti.api.client.docs.session.create.check.RequestedLivenessCheck;
import com.yoti.api.client.docs.session.create.filters.RequiredDocument;
import com.yoti.api.client.docs.session.create.identityprofile.simple.IdentityProfileRequirementsPayload;
import com.yoti.api.client.docs.session.create.resources.ResourceCreationContainer;
import com.yoti.api.client.docs.session.create.task.RequestedIdDocTextExtractionTask;

@@ -57,6 +58,7 @@ public class SessionSpecTest {
@Mock ZonedDateTime sessionDeadlineMock;
@Mock ResourceCreationContainer resourceCreationContainerMock;
@Mock ImportTokenPayload importTokenMock;
@Mock IdentityProfileRequirementsPayload identityProfileRequirementsPayloadMock;

@Test
public void shouldBuildWithMinimalConfiguration() {
@@ -215,33 +217,12 @@ public void withSessionDeadline_shouldSetTheSessionDeadline() {
}

@Test
public void shouldBuildWithIdentityProfileRequirements() throws IOException {
Map<String, Object> scheme = new HashMap<>();
scheme.put(IdentityProperty.TYPE, "A_TYPE");
scheme.put(IdentityProperty.OBJECTIVE, "AN_OBJECTIVE");

Map<String, Object> identityProfile = new HashMap<>();
identityProfile.put(IdentityProperty.TRUST_FRAMEWORK, "A_FRAMEWORK");
identityProfile.put(IdentityProperty.SCHEME, scheme);

JsonNode json = toSessionSpecJson(identityProfile);

assertThat(
json.get(IdentityProperty.TRUST_FRAMEWORK).asText(),
is(equalTo(identityProfile.get(IdentityProperty.TRUST_FRAMEWORK)))
);

JsonNode schemeJsonNode = json.get(IdentityProperty.SCHEME);
assertThat(schemeJsonNode.get(IdentityProperty.TYPE).asText(), is(equalTo(scheme.get(IdentityProperty.TYPE))));
assertThat(schemeJsonNode.get(IdentityProperty.OBJECTIVE).asText(), is(equalTo(scheme.get(IdentityProperty.OBJECTIVE))));
}

private static JsonNode toSessionSpecJson(Map<String, Object> obj) throws IOException {
SessionSpec session = SessionSpec.builder()
.withIdentityProfile(obj)
public void withIdentityProfile_shouldSetTheIdentityProfile() {
SessionSpec result = SessionSpec.builder()
.withIdentityProfile(identityProfileRequirementsPayloadMock)
.build();

return MAPPER.readTree(MAPPER.writeValueAsString(session.getIdentityProfile()).getBytes(DEFAULT_CHARSET));
assertThat(result.getIdentityProfile(), is(identityProfileRequirementsPayloadMock));
}

@Test