Skip to content

Commit

Permalink
Merge pull request #29 from eu-digital-green-certificates/fix/identity
Browse files Browse the repository at this point in the history
Fix/Workaround: remove unsupported VerificationMethod
  • Loading branch information
epicsoft-llc authored Oct 11, 2021
2 parents 8a95eb6 + 86dccf5 commit 5440496
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,38 +20,40 @@

package eu.europa.ec.dgc.validation.decorator.entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;

@Data
public class ValidationServiceIdentityResponse {

private String id;

private List<VerificationMethod> verificationMethod = new ArrayList<>();

@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public static final class VerificationMethod {

private String id;

private String type;

private String controller;

private PublicKeyJwk publicKeyJwk;
}

@Data
public static final class PublicKeyJwk {

private String x5c;

private String kid;

private String alg;

private String use;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,14 @@ public ValidationServiceIdentityResponse identity(final ServiceProperties servic
log.debug("REST Call to '{}' starting", url);
final ResponseEntity<ValidationServiceIdentityResponse> response = restTpl
.getForEntity(url, ValidationServiceIdentityResponse.class);
return response.getBody();

// Workaround: remove unsupported VerificationMethod
final ValidationServiceIdentityResponse resBody = response.getBody();
if (resBody.getVerificationMethod() != null) {
resBody.getVerificationMethod().removeIf(method -> method.getPublicKeyJwk() == null);
}

return resBody;
}

/**
Expand Down

0 comments on commit 5440496

Please sign in to comment.