Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ public class IdrepoProfileRegistryPluginImpl implements ProfileRegistryPlugin {
@Value("${mosip.signup.mosipid.uispec.maxuploadfilesize-jsonpath:$[0].jsonSpec[0].spec.maxUploadFileSize}")
private String maxUploadFileSizeJsonpath;

@Value("${mosip.signup.mosipid.uispec.resetPasswordChallengeFields-jsonpath:$[0].jsonSpec[0].spec.resetPasswordChallengeFields}")
private String resetPasswordChallengeFieldsJsonpath;

@Value("${mosip.signup.mosipid.uispec.errors-jsonpath:$[0].jsonSpec[0].spec.errors}")
private String errorsJsonpath;

Expand Down Expand Up @@ -244,6 +247,17 @@ private Object readMaxUploadFileSize(String responseJson) {
return maxUploadFileSize;
}

private Object readResetPasswordChallengeFields(String responseJson) {
Object resetPasswordChallengeFields;
try {
resetPasswordChallengeFields = JsonPath.read(responseJson, resetPasswordChallengeFieldsJsonpath);
} catch (PathNotFoundException e) {
log.error("resetPasswordChallengeFields not found in schema");
return Collections.emptyList();
}
return resetPasswordChallengeFields;
}

/**
* Generate combined JsonNode from List<JsonNode> dynamicFields and List<JsonNode> documentCategories
* @return JsonNode containing the allowed values.
Expand Down Expand Up @@ -543,6 +557,7 @@ public JsonNode getUISpecification() {
ObjectNode i18nValues = readI18nValues(responseJson);
JsonNode allowedValues = readAllowedValues(responseJson);
Object maxUploadFileSize = readMaxUploadFileSize(responseJson);
Object resetPasswordChallengeFields = readResetPasswordChallengeFields(responseJson);

return objectMapper.valueToTree(
Map.ofEntries(
Expand All @@ -551,7 +566,8 @@ public JsonNode getUISpecification() {
Map.entry("i18nValues", i18nValues),
Map.entry("language", Map.of("mandatory", mandatoryLanguages, "optional", optionalLanguages)),
Map.entry("allowedValues", allowedValues),
Map.entry("maxUploadFileSize", maxUploadFileSize)
Map.entry("maxUploadFileSize", maxUploadFileSize),
Map.entry("resetPasswordChallengeFields",resetPasswordChallengeFields)
)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ mosip.signup.idrepo.get-status.endpoint=http://credentialrequest.idrepo/v1/crede
mosip.signup.mosipid.get-ui-spec.endpoint=http://masterdata.kernel/v1/masterdata/uispec/esignet-signup/latest?type=schema
mosip.signup.mosipid.uispec.errors={required:{en:"This field is required"},passwordMismatch:{en:"Passwords is not matching please check your password"}}

mosip.signup.mosipid.dynamic-fields.endpoint=http://masterdata.kernel/v1/masterdata/dynamicfields?pageNumber=%d&pageSize=%d"
mosip.signup.mosipid.dynamic-fields.endpoint=http://masterdata.kernel/v1/masterdata/dynamicfields?pageNumber=%d&pageSize=%d

# for multiple languages scenario, the languages should be appended followed by ampersand as ?languages=eng&languages=fra&languages=khm
mosip.signup.mosipid.doc-types-category.endpoint=http://masterdata.kernel/v1/masterdata/applicanttype/000/languages?languages=eng
Expand Down