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

SDK-2531, SDK-2532, SDK-2533 #471

Merged
merged 4 commits into from
Sep 27, 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: 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.10.0-SNAPSHOT</version>
<version>4.0.0-SNAPSHOT</version>
</dependency>
```

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

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

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.10.0-SNAPSHOT</version>
<version>4.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

Expand Down
8 changes: 8 additions & 0 deletions examples/doc-scan/src/main/resources/templates/success.html
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,14 @@ <h2>Identity Profile</h2>
</div>
</div>

<th:block th:if="${sessionResult.getIdentityProfile().getIdentityProfileReport()() != null}">
<div th:if="${sessionResult.getIdentityProfile().getIdentityProfileReport().getMedia() != null}">
Generated Profile Media: <a th:href="${'/media?mediaId=' + sessionResult.getIdentityProfile().getIdentityProfileReport().getMedia().getId()}"
th:text="${sessionResult.getIdentityProfile().getIdentityProfileReport().getMedia().getId()}">
</a>
</div>
</th:block>

<!-- Identity Profile Failure Reason -->
<th:block th:if="${sessionResult.getIdentityProfile().getFailureReason() != null}">
<div class="row pt-4">
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.10.0-SNAPSHOT</version>
<version>4.0.0-SNAPSHOT</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.10.0-SNAPSHOT</version>
<version>4.0.0-SNAPSHOT</version>
<relativePath>../yoti-sdk-parent</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package com.yoti.api.client.docs.session.create;

import com.fasterxml.jackson.annotation.JsonProperty;

public class IdentityProfileSubjectPayload {

@JsonProperty("subject_id")
private final String subjectId;

IdentityProfileSubjectPayload(String subjectId) {
this.subjectId = subjectId;
}

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

public String getSubjectId() {
return subjectId;
}

public static class Builder {

private String subjectId;

Builder() {}

/**
* Sets the subject ID for the Identity Profile requirement
*
* @param subjectId the subject ID
* @return the builder
*/
public Builder withSubjectId(String subjectId) {
this.subjectId = subjectId;
return this;
}

public IdentityProfileSubjectPayload build() {
return new IdentityProfileSubjectPayload(subjectId);
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -55,13 +56,13 @@ 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;

@JsonProperty(Property.SUBJECT)
private final Map<String, Object> subject;
private final IdentityProfileSubjectPayload subject;

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

Expand All @@ -232,7 +233,7 @@ public Object getIdentityProfile() {
*
* @return subject
*/
public Map<String, Object> getSubject() {
public IdentityProfileSubjectPayload getSubject() {
return subject;
}

Expand Down Expand Up @@ -277,9 +278,9 @@ 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 IdentityProfileSubjectPayload subject;
private ResourceCreationContainer resources;
private Boolean createIdentityProfilePreview;

Expand Down Expand Up @@ -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;
}
Expand All @@ -439,7 +440,7 @@ public Builder withIdentityProfile(Map<String, Object> identityProfile) {
* @param subject the subject
* @return the Builder
*/
public Builder withSubject(Map<String, Object> subject) {
public Builder withSubject(IdentityProfileSubjectPayload subject) {
this.subject = subject;
return this;
}
Expand Down
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
@@ -0,0 +1,45 @@
package com.yoti.api.client.docs.session.retrieve;

import java.util.List;

import com.fasterxml.jackson.annotation.JsonProperty;

public class IdentityProfileReportResponse {

@JsonProperty("trust_framework")
private String trustFramework;

@JsonProperty("media")
private MediaResponse media;

@JsonProperty("schemes_compliance")
private List<IdentityProfileSchemeComplianceReportResponse> schemesCompliance;

/**
* The trust framework the report was generated for
*
* @return the trust framework
*/
public String getTrustFramework() {
return trustFramework;
}

/**
* The media object containing the report
*
* @return the report media
*/
public MediaResponse getMedia() {
return media;
}

/**
* The list of schemes used in the trust framework
*
* @return the list of schemes
*/
public List<IdentityProfileSchemeComplianceReportResponse> getSchemesCompliance() {
return schemesCompliance;
}

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.yoti.api.client.docs.session.retrieve;

import java.util.Map;

import com.fasterxml.jackson.annotation.JsonProperty;

public class IdentityProfileResponse {
Expand All @@ -16,7 +14,7 @@ public class IdentityProfileResponse {
private IdentityProfileFailureResponse failureReason;

@JsonProperty(Property.IDENTITY_PROFILE_REPORT)
private Map<String, Object> identityProfileReport;
private IdentityProfileReportResponse identityProfileReport;

public String getSubjectId() {
return subjectId;
Expand All @@ -30,7 +28,7 @@ public IdentityProfileFailureResponse getFailureReason() {
return failureReason;
}

public Map<String, Object> getIdentityProfileReport() {
public IdentityProfileReportResponse getIdentityProfileReport() {
return identityProfileReport;
}

Expand Down
Loading