Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/sast.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env:
# List of paths (space separated) to ignore
# Supports PATTERNS
# EXCLUDE_PATHS: 'foo bar/baz file.txt dir/*.yml'
EXCLUDE_PATHS: 'client/generator-templates src/main/generated'
EXCLUDE_PATHS: 'client/generator-templates client/src/main/generated'
# List of rules (space separated) to ignore
# EXCLUDE_RULES: 'generic.secrets.security.detected-aws-account-id.detected-aws-account-id'
# See https://github.com/semgrep/semgrep-rules for rules registry
Expand Down
1 change: 1 addition & 0 deletions client/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ src/main/generated/com/regula/documentreader/webclient/model/OutData.java
src/main/generated/com/regula/documentreader/webclient/model/OutDataTransactionImagesFieldValue.java
src/main/generated/com/regula/documentreader/webclient/model/PArrayField.java
src/main/generated/com/regula/documentreader/webclient/model/ParsedData.java
src/main/generated/com/regula/documentreader/webclient/model/ParsingErrorCodes.java
src/main/generated/com/regula/documentreader/webclient/model/ParsingNotificationCodes.java
src/main/generated/com/regula/documentreader/webclient/model/PerDocumentConfig.java
src/main/generated/com/regula/documentreader/webclient/model/PhotoIdentItem.java
Expand Down
9 changes: 0 additions & 9 deletions client/generator-templates/pojo.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -337,16 +337,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
}
}
{{^hasChildren}}
{{^isAdditionalPropertiesTrue}}

Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Map.Entry<String, JsonElement> entry : entries) {
if (!{{classname}}.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `{{classname}}` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
}
}
{{/isAdditionalPropertiesTrue}}
{{#requiredVars}}
{{#-first}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,22 +78,13 @@ public static GsonBuilder createGson() {
"131072", com.regula.documentreader.webclient.model.IdentResult.class);
classByDiscriminatorValue.put(
"16", com.regula.documentreader.webclient.model.FiberResult.class);
classByDiscriminatorValue.put(
"16384", com.regula.documentreader.webclient.model.FiberResult.class);
classByDiscriminatorValue.put(
"16777216",
com.regula.documentreader.webclient.model.OCRSecurityTextResult.class);
classByDiscriminatorValue.put(
"2", com.regula.documentreader.webclient.model.SecurityFeatureResult.class);
classByDiscriminatorValue.put(
"2048", com.regula.documentreader.webclient.model.IdentResult.class);
classByDiscriminatorValue.put(
"2097152", com.regula.documentreader.webclient.model.IdentResult.class);
classByDiscriminatorValue.put(
"2147483648",
com.regula.documentreader.webclient.model.SecurityFeatureResult.class);
classByDiscriminatorValue.put(
"256", com.regula.documentreader.webclient.model.PhotoIdentResult.class);
classByDiscriminatorValue.put(
"262144", com.regula.documentreader.webclient.model.IdentResult.class);
classByDiscriminatorValue.put(
Expand Down Expand Up @@ -158,22 +149,13 @@ public static GsonBuilder createGson() {
"131072", com.regula.documentreader.webclient.model.IdentResult.class);
classByDiscriminatorValue.put(
"16", com.regula.documentreader.webclient.model.FiberResult.class);
classByDiscriminatorValue.put(
"16384", com.regula.documentreader.webclient.model.FiberResult.class);
classByDiscriminatorValue.put(
"16777216",
com.regula.documentreader.webclient.model.OCRSecurityTextResult.class);
classByDiscriminatorValue.put(
"2", com.regula.documentreader.webclient.model.SecurityFeatureResult.class);
classByDiscriminatorValue.put(
"2048", com.regula.documentreader.webclient.model.IdentResult.class);
classByDiscriminatorValue.put(
"2097152", com.regula.documentreader.webclient.model.IdentResult.class);
classByDiscriminatorValue.put(
"2147483648",
com.regula.documentreader.webclient.model.SecurityFeatureResult.class);
classByDiscriminatorValue.put(
"256", com.regula.documentreader.webclient.model.PhotoIdentResult.class);
classByDiscriminatorValue.put(
"262144", com.regula.documentreader.webclient.model.IdentResult.class);
classByDiscriminatorValue.put(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;

/** AreaArray */
@javax.annotation.Generated(
Expand Down Expand Up @@ -204,17 +202,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}

Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Map.Entry<String, JsonElement> entry : entries) {
if (!AreaArray.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(
String.format(
"The field `%s` in the JSON string is not defined in the `AreaArray` properties. JSON: %s",
entry.getKey(), jsonElement.toString()));
}
}

// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AreaArray.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;

/** Checked fragment coordinates */
@javax.annotation.Generated(
Expand Down Expand Up @@ -203,17 +201,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}

Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Map.Entry<String, JsonElement> entry : entries) {
if (!AreaContainer.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(
String.format(
"The field `%s` in the JSON string is not defined in the `AreaContainer` properties. JSON: %s",
entry.getKey(), jsonElement.toString()));
}
}

// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AreaContainer.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
import com.regula.documentreader.webclient.JSON;
import java.io.IOException;
import java.util.HashSet;
import java.util.Map;
import java.util.Objects;
import java.util.Set;

/** AuthParams */
@javax.annotation.Generated(
Expand Down Expand Up @@ -569,16 +567,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}

Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Map.Entry<String, JsonElement> entry : entries) {
if (!AuthParams.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(
String.format(
"The field `%s` in the JSON string is not defined in the `AuthParams` properties. JSON: %s",
entry.getKey(), jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
// validate the optional field `livenessParams`
if (jsonObj.get("livenessParams") != null && !jsonObj.get("livenessParams").isJsonNull()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;

/** AuthenticityCheckList */
@javax.annotation.Generated(
Expand Down Expand Up @@ -166,17 +164,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}

Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Map.Entry<String, JsonElement> entry : entries) {
if (!AuthenticityCheckList.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(
String.format(
"The field `%s` in the JSON string is not defined in the `AuthenticityCheckList` properties. JSON: %s",
entry.getKey(), jsonElement.toString()));
}
}

// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AuthenticityCheckList.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
import com.regula.documentreader.webclient.JSON;
import java.io.IOException;
import java.util.HashSet;
import java.util.Map;
import java.util.Objects;
import java.util.Set;

/** AuthenticityCheckListItem */
@javax.annotation.Generated(
Expand Down Expand Up @@ -131,17 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}

Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Map.Entry<String, JsonElement> entry : entries) {
if (!AuthenticityCheckListItem.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(
String.format(
"The field `%s` in the JSON string is not defined in the `AuthenticityCheckListItem` properties. JSON: %s",
entry.getKey(), jsonElement.toString()));
}
}

// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AuthenticityCheckListItem.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;

/** AuthenticityCheckResult */
@javax.annotation.Generated(
Expand Down Expand Up @@ -224,17 +222,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}

Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Map.Entry<String, JsonElement> entry : entries) {
if (!AuthenticityCheckResult.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(
String.format(
"The field `%s` in the JSON string is not defined in the `AuthenticityCheckResult` properties. JSON: %s",
entry.getKey(), jsonElement.toString()));
}
}

// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AuthenticityCheckResult.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,27 +223,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
case "16":
FiberResult.validateJsonElement(jsonElement);
break;
case "16384":
FiberResult.validateJsonElement(jsonElement);
break;
case "16777216":
OCRSecurityTextResult.validateJsonElement(jsonElement);
break;
case "2":
SecurityFeatureResult.validateJsonElement(jsonElement);
break;
case "2048":
IdentResult.validateJsonElement(jsonElement);
break;
case "2097152":
IdentResult.validateJsonElement(jsonElement);
break;
case "2147483648":
SecurityFeatureResult.validateJsonElement(jsonElement);
break;
case "256":
PhotoIdentResult.validateJsonElement(jsonElement);
break;
case "262144":
IdentResult.validateJsonElement(jsonElement);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
import com.regula.documentreader.webclient.JSON;
import java.io.IOException;
import java.util.HashSet;
import java.util.Map;
import java.util.Objects;
import java.util.Set;

/** AuthenticityResult */
@javax.annotation.Generated(
Expand Down Expand Up @@ -138,17 +136,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}

Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Map.Entry<String, JsonElement> entry : entries) {
if (!AuthenticityResult.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(
String.format(
"The field `%s` in the JSON string is not defined in the `AuthenticityResult` properties. JSON: %s",
entry.getKey(), jsonElement.toString()));
}
}

// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AuthenticityResult.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
@JsonAdapter(AuthenticityResultType.Adapter.class)
public enum AuthenticityResultType {

/** No authenticity control procedure */
NONE(0l),

/** Document luminescence check in UV light */
UV_LUMINESCENCE(1l),

Expand All @@ -53,27 +50,18 @@ public enum AuthenticityResultType {
/** Invisible Personal Information (IPI) visualization */
IPI(128l),

/** Document photo check in IR light */
IR_PHOTO(256l),

/** Owner&#39;s photo embedding check (is photo printed or sticked) */
PHOTO_EMBED_TYPE(512l),

/** OVI check. Deprecated, use Document liveness check instead */
OVI(1024l),

/** IR luminescence check */
IR_LUMINESCENCE(2048l),

/** Hologram presence check. Deprecated */
HOLOGRAMS(4096l),

/** Owner&#39;s photo area advanced check (photo shape, size, position, etc.) */
PHOTO_AREA(8192l),

/** UV background check */
UV_BACKGROUND(16384l),

/** Portrait comparison check (document printed vs chip vs live) */
PORTRAIT_COMPARISON(32768l),

Expand Down Expand Up @@ -102,10 +90,7 @@ public enum AuthenticityResultType {
EXTENDED_MRZ_CHECK(8388608l),

/** Encrypted IPI */
ENCRYPTED_IPI(16777216l),

/** Flag for status-only authenticity */
STATUS_ONLY(2147483648l);
ENCRYPTED_IPI(16777216l);

private Long value;

Expand Down
Loading