Skip to content

Commit

Permalink
Fix #498: Suspicious filename records in table es_document_verificati…
Browse files Browse the repository at this point in the history
…on (#525)

Rename selfie filename to person_photo_from_iProov.jpg
  • Loading branch information
banterCZ authored Nov 15, 2022
1 parent f634923 commit 73fe62b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public class DocumentVerificationEntity implements Serializable {
private String otherSideId;

/**
* Name of provider which performed the verification
* Name identifying {@code DocumentVerificationProvider}.
*/
@Column(name = "provider_name")
private String providerName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,13 @@ public void checkPresenceVerification(OwnerId ownerId,
}
logger.debug("Processing a result of an accepted presence check, {}", ownerId);

Image photo = result.getPhoto();
final Image photo = result.getPhoto();
if (photo == null) {
throw new PresenceCheckException("Missing person photo from presence verification, " + ownerId);
}
logger.debug("Obtained a photo from the result, {}", ownerId);

SubmittedDocument submittedDoc = new SubmittedDocument();
final SubmittedDocument submittedDoc = new SubmittedDocument();
// TODO use different random id approach
submittedDoc.setDocumentId(
Ascii.truncate("selfie-photo-" + ownerId.getActivationId(), 36, "...")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public class IProovPresenceCheckProvider implements PresenceCheckProvider {
* Session parameter name of the verification token
*/
private static final String VERIFICATION_TOKEN = "iProovVerificationToken";
private static final String SELFIE_FILENAME = "person_photo_from_iProov.jpg";

private final ObjectMapper objectMapper;

Expand Down Expand Up @@ -257,7 +258,7 @@ private static Image parseImage(final String frame) {
final byte[] photoData = Base64.getDecoder().decode(frameJpeg);

final Image photo = new Image();
photo.setFilename("person_photo_from_id.jpg");
photo.setFilename(SELFIE_FILENAME);
photo.setData(photoData);
return photo;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public class WultraMockPresenceCheckProvider implements PresenceCheckProvider {
* Session parameter name of the verification token
*/
private static final String VERIFICATION_TOKEN = "mockVerificationToken";
private static final String SELFIE_FILENAME = "person_photo_from_mock.jpg";

/**
* Service constructor.
Expand Down Expand Up @@ -84,7 +85,7 @@ public PresenceCheckResult getResult(OwnerId id, SessionInfo sessionInfo) {
if (photo.getData() == null) {
photo.setData(new byte[]{});
}
photo.setFilename("selfie_photo.jpg");
photo.setFilename(SELFIE_FILENAME);

PresenceCheckResult result = new PresenceCheckResult();
result.setStatus(PresenceCheckStatus.ACCEPTED);
Expand Down

0 comments on commit 73fe62b

Please sign in to comment.