Skip to content

Commit

Permalink
fix: chain returned as JWT's
Browse files Browse the repository at this point in the history
  • Loading branch information
rglauco committed Oct 30, 2023
1 parent dd516ab commit 10b4033
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ public ResponseEntity<String> resolveEntityStatement(
response.put("metadata", metadata);
response.put("trust_chain",trust_chain);

logger.info("resolve endpoint for {}, {}", sub, anchor);

if ("json".equals(format)) {
logger.info("resolve endpoint for {}, {}", sub, anchor);
return ResponseEntity.ok()
.contentType(MediaType.APPLICATION_JSON)
.body(response.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,9 +555,9 @@ public void validate() throws OIDCException {
acrMap.put(OIDCProfile.CIE.value(), AcrValue.L2.value());
}

if (Validator.isNullOrEmpty(logoutRedirectURL)) {
throw new ConfigException("no-logout-redirect-url");
}
// if (Validator.isNullOrEmpty(logoutRedirectURL)) {
// throw new ConfigException("no-logout-redirect-url");
// }

validateRequestedClaims();
validateUserKeyClaim();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ else if (Validator.isNullOrEmpty(tcb.getFinalMetadata())) {
.setSubject(subject)
.setType(metadataType)
.setExpiresOn(tcb.getExpiresOn())
.setChain(tcb.getChainAsString())
.setChain(tcb.getChain())
.setPartiesInvolved(tcb.getPartiesInvolvedAsString())
.setProcessingStart(LocalDateTime.now())
.setActive(true)
Expand All @@ -607,7 +607,7 @@ else if (Validator.isNullOrEmpty(tcb.getFinalMetadata())) {
else {
trustChain = trustChain
.setExpiresOn(tcb.getExpiresOn())
.setChain(tcb.getChainAsString())
.setChain(tcb.getChain())
.setPartiesInvolved(tcb.getPartiesInvolvedAsString())
.setProcessingStart(LocalDateTime.now())
.setActive(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ public TrustChainBuilder(String subject, String metadataType, JWTHelper jwtHelpe
this.subject = subject;
}

public String getChain() {
StringJoiner sj = new StringJoiner(",", "[", "]");
for (EntityConfiguration ec : trustPath) {
sj.add(ec.getJwt());
}
return sj.toString();
}

public String getChainAsString() {
StringJoiner sj = new StringJoiner(",", "[", "]");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public void testTrustChainBuilderClass() {
catched = false;

try {
tcb.getChain();
tcb.getChainAsString();
tcb.getExpiresOn();
tcb.getFinalMetadata();
Expand Down

0 comments on commit 10b4033

Please sign in to comment.