Skip to content

Commit 56045b5

Browse files
committed
PB-70375. Add support for IDV authentication
1 parent 586960d commit 56045b5

24 files changed

Lines changed: 1340 additions & 85 deletions
Lines changed: 51 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,100 @@
11
package com.silanis.esl.api.model;
22
//
3+
34
import com.fasterxml.jackson.annotation.JsonIgnore;
45
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
56
import com.silanis.esl.api.util.SchemaSanitizer;
67

78
import java.util.ArrayList;
89
import java.util.List;
9-
@JsonIgnoreProperties(ignoreUnknown=true)
10+
11+
@JsonIgnoreProperties(ignoreUnknown = true)
1012
public class Auth extends Model
11-
implements java.io.Serializable
12-
{
13-
13+
implements java.io.Serializable {
14+
1415
// Dirty Flag Constants
1516
@JsonIgnore
1617
public static final String FIELD_CHALLENGES = "challenges";
1718
@JsonIgnore
1819
public static final String FIELD_SCHEME = "scheme";
19-
20+
@JsonIgnore
21+
public static final String FIELD_IDV_WORKFLOW = "idvWorkflow";
22+
2023
// Empty Constructor
21-
public Auth ( ) {}
22-
24+
public Auth() {
25+
}
26+
2327
// Fields
2428
protected List<AuthChallenge> _challenges = new ArrayList<AuthChallenge>();
29+
protected IdvWorkflow _idvWorkflow;
2530
protected String _scheme = "NONE";
26-
31+
2732
// Accessors
28-
29-
30-
public Auth setChallenges( List<AuthChallenge> value ){
31-
SchemaSanitizer.throwOnNull(FIELD_CHALLENGES,value);
33+
34+
public IdvWorkflow getIdvWorkflow() {
35+
return _idvWorkflow;
36+
}
37+
38+
public Auth setIdvWorkflow(IdvWorkflow value) {
39+
this._idvWorkflow = value;
40+
setDirty(FIELD_IDV_WORKFLOW);
41+
return this;
42+
}
43+
44+
public Auth setChallenges(List<AuthChallenge> value) {
45+
SchemaSanitizer.throwOnNull(FIELD_CHALLENGES, value);
3246
// TODO With proper compare
3347
// if ( this._challenges == value ) return this;
3448
this._challenges = value;
3549
setDirty(FIELD_CHALLENGES);
3650
return this;
3751
}
52+
3853
// Used internally by aws. Invokes a the corresponding setter if the value is not null
3954
@JsonIgnore
40-
public Auth safeSetChallenges( List<AuthChallenge> value ){
41-
if ( value != null ) { this.setChallenges( value ); }
55+
public Auth safeSetChallenges(List<AuthChallenge> value) {
56+
if (value != null) {
57+
this.setChallenges(value);
58+
}
4259
return this;
4360
}
44-
public List<AuthChallenge> getChallenges(){
61+
62+
public List<AuthChallenge> getChallenges() {
4563
return _challenges;
4664
}
65+
4766
// List adder
48-
public Auth addChallenge( AuthChallenge value ){
49-
if (value == null) { throw new IllegalArgumentException("Argument cannot be null"); }
67+
public Auth addChallenge(AuthChallenge value) {
68+
if (value == null) {
69+
throw new IllegalArgumentException("Argument cannot be null");
70+
}
5071
this._challenges.add(value);
5172
setDirty(FIELD_CHALLENGES);
5273
return this;
5374
}
54-
55-
56-
57-
public Auth setScheme( String value ){
58-
SchemaSanitizer.throwOnNull(FIELD_SCHEME,value);
75+
76+
77+
public Auth setScheme(String value) {
78+
SchemaSanitizer.throwOnNull(FIELD_SCHEME, value);
5979
// TODO With proper compare
6080
// if ( this._scheme == value ) return this;
6181
this._scheme = value;
6282
setDirty(FIELD_SCHEME);
6383
return this;
6484
}
85+
6586
// Used internally by aws. Invokes a the corresponding setter if the value is not null
6687
@JsonIgnore
67-
public Auth safeSetScheme( String value ){
68-
if ( value != null ) { this.setScheme( value ); }
88+
public Auth safeSetScheme(String value) {
89+
if (value != null) {
90+
this.setScheme(value);
91+
}
6992
return this;
7093
}
71-
public String getScheme(){
94+
95+
public String getScheme() {
7296
return _scheme;
7397
}
74-
75-
98+
99+
76100
}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
package com.silanis.esl.api.model;
2+
3+
import com.fasterxml.jackson.annotation.JsonIgnore;
4+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
5+
6+
import static com.silanis.esl.api.util.SchemaSanitizer.throwOnNull;
7+
8+
/**
9+
* Created by schoi on 2021-03-10.
10+
*/
11+
@JsonIgnoreProperties(ignoreUnknown = true)
12+
public class IdvWorkflow extends Model implements java.io.Serializable {
13+
14+
@JsonIgnore
15+
public static final String FIELD_ID = "id";
16+
@JsonIgnore
17+
public static final String FIELD_TYPE = "type";
18+
@JsonIgnore
19+
public static final String FIELD_TENANT = "tenant";
20+
@JsonIgnore
21+
public static final String FIELD_DESC = "desc";
22+
23+
// Empty Constructor
24+
public IdvWorkflow() {
25+
}
26+
27+
// Fields
28+
protected String id;
29+
protected String type;
30+
protected String tenant;
31+
protected String desc;
32+
33+
34+
public IdvWorkflow setId(String value) {
35+
throwOnNull(FIELD_ID, value);
36+
37+
this.id = value;
38+
setDirty(FIELD_ID);
39+
return this;
40+
}
41+
42+
public String getId() {
43+
return id;
44+
}
45+
46+
47+
public IdvWorkflow setType(String value) {
48+
throwOnNull(FIELD_TYPE, value);
49+
50+
this.type = value;
51+
setDirty(FIELD_TYPE);
52+
return this;
53+
}
54+
55+
public String getType() {
56+
return type;
57+
}
58+
59+
60+
public IdvWorkflow setTenant(String value) {
61+
throwOnNull(FIELD_TENANT, value);
62+
63+
this.tenant = value;
64+
setDirty(FIELD_TENANT);
65+
return this;
66+
}
67+
68+
public String getTenant() {
69+
return tenant;
70+
}
71+
72+
73+
public IdvWorkflow setDesc(String value) {
74+
this.desc = value;
75+
setDirty(FIELD_DESC);
76+
return this;
77+
}
78+
79+
public String getDesc() {
80+
return desc;
81+
}
82+
}
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
package com.silanis.esl.api.model;
2+
3+
import com.fasterxml.jackson.annotation.JsonIgnore;
4+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
5+
import com.fasterxml.jackson.annotation.JsonProperty;
6+
7+
import static com.silanis.esl.api.util.SchemaSanitizer.throwOnNull;
8+
9+
/**
10+
* Created by schoi on 2021-05-06.
11+
*/
12+
@JsonIgnoreProperties(ignoreUnknown = true)
13+
public class IdvWorkflowConfiguration extends Model implements java.io.Serializable {
14+
15+
@JsonIgnore
16+
public static final String FIELD_ID = "id";
17+
@JsonIgnore
18+
public static final String FIELD_TYPE = "type";
19+
@JsonIgnore
20+
public static final String FIELD_TENANT = "tenant";
21+
@JsonIgnore
22+
public static final String FIELD_DESC = "desc";
23+
@JsonIgnore
24+
public static final String FIELD_SKIP_WHEN_ACCESSING_SIGNED_DOCUMENTS = "skipWhenAccessingSignedDocuments";
25+
26+
@JsonProperty("id")
27+
protected String workflowId;
28+
@JsonProperty("type")
29+
protected String type;
30+
@JsonProperty("tenant")
31+
protected String tenant;
32+
@JsonProperty("desc")
33+
protected String desc;
34+
@JsonProperty("skipWhenAccessingSignedDocuments")
35+
protected boolean skipWhenAccessingSignedDocuments;
36+
37+
public IdvWorkflowConfiguration setWorkflowId(String value) {
38+
throwOnNull(FIELD_ID, value);
39+
40+
this.workflowId = value;
41+
setDirty(FIELD_ID);
42+
return this;
43+
}
44+
45+
public String getWorkflowId() {
46+
return workflowId;
47+
}
48+
49+
50+
public IdvWorkflowConfiguration setType(String value) {
51+
throwOnNull(FIELD_TYPE, value);
52+
53+
this.type = value;
54+
setDirty(FIELD_TYPE);
55+
return this;
56+
}
57+
58+
public String getType() {
59+
return type;
60+
}
61+
62+
63+
public IdvWorkflowConfiguration setTenant(String value) {
64+
throwOnNull(FIELD_TENANT, value);
65+
66+
this.tenant = value;
67+
setDirty(FIELD_TENANT);
68+
return this;
69+
}
70+
71+
public String getTenant() {
72+
return tenant;
73+
}
74+
75+
76+
public IdvWorkflowConfiguration setDesc(String value) {
77+
this.desc = value;
78+
setDirty(FIELD_DESC);
79+
return this;
80+
}
81+
82+
public String getDesc() {
83+
return desc;
84+
}
85+
86+
87+
public IdvWorkflowConfiguration setSkipWhenAccessingSignedDocuments(boolean value) {
88+
this.skipWhenAccessingSignedDocuments = value;
89+
setDirty(FIELD_SKIP_WHEN_ACCESSING_SIGNED_DOCUMENTS);
90+
return this;
91+
}
92+
93+
public boolean isSkipWhenAccessingSignedDocuments() {
94+
return skipWhenAccessingSignedDocuments;
95+
}
96+
97+
}

sdk/src/main/java/com/silanis/esl/sdk/Authentication.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ public class Authentication {
88
private final AuthenticationMethod method;
99
private List<Challenge> challenges = new ArrayList<Challenge>();
1010
private String phoneNumber;
11+
private IdvWorkflow idvWorkflow;
1112

1213
public Authentication(AuthenticationMethod method) {
1314
this.method = method;
@@ -18,11 +19,17 @@ public Authentication(List<Challenge> challenges) {
1819
this.challenges.addAll(challenges);
1920
}
2021

21-
public Authentication(String phoneNumber) {
22-
this(AuthenticationMethod.SMS);
22+
public Authentication(AuthenticationMethod method, String phoneNumber) {
23+
this(method);
2324
this.phoneNumber = phoneNumber;
2425
}
2526

27+
public Authentication(AuthenticationMethod method, String phoneNumber, IdvWorkflow idvWorkflow) {
28+
this(method);
29+
this.phoneNumber = phoneNumber;
30+
this.idvWorkflow = idvWorkflow;
31+
}
32+
2633
public AuthenticationMethod getMethod() {
2734
return method;
2835
}
@@ -34,4 +41,8 @@ public List<Challenge> getChallenges() {
3441
public String getPhoneNumber() {
3542
return phoneNumber;
3643
}
44+
45+
public IdvWorkflow getIdvWorkflow() {
46+
return idvWorkflow;
47+
}
3748
}

sdk/src/main/java/com/silanis/esl/sdk/AuthenticationMethod.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public class AuthenticationMethod extends EslEnumeration {
1212
public static final AuthenticationMethod SMS = new AuthenticationMethod("SMS", "SMS", 2);
1313
public static final AuthenticationMethod KBA = new AuthenticationMethod("KBA", "KBA", 3);
1414
public static final AuthenticationMethod SSO = new AuthenticationMethod("SSO", "SSO", 4);
15+
public static final AuthenticationMethod IDV = new AuthenticationMethod("ID_VERIFICATION", "IDV", 5);
1516

1617
/**
1718
* DO NOT USE! This is an internal implementation concern. It is there to avoid crashes in existing code when new values are added to the enumerations
@@ -32,6 +33,7 @@ public static final AuthenticationMethod UNRECOGNIZED(String unknownValue){
3233
sdkValues.put(SMS.name(), SMS);
3334
sdkValues.put(KBA.name(), KBA);
3435
sdkValues.put(SSO.name(), SSO);
36+
sdkValues.put(IDV.name(), IDV);
3537
}
3638

3739
private AuthenticationMethod(String apiValue, String sdkValue, int index) {

0 commit comments

Comments
 (0)