Skip to content

Commit

Permalink
feat(trustlist-v2): added did for domain and participant
Browse files Browse the repository at this point in the history
  • Loading branch information
Torsten Egenolf committed May 10, 2024
1 parent 1dc68f3 commit fdc1be8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,6 @@ public interface SignerInformationRepository extends JpaRepository<SignerInforma
List<SignerInformationEntity> getAllByDeletedIsAndDomainIsAndCountryIs(boolean deleted, String domain, String country);


@Query("SELECT DISTINCT s.country FROM SignerInformationEntity s WHERE s.deleted = false AND s.domain = :domain")
List<String> getParticipantsByDomain(@Param("domain") String domain);
}
Original file line number Diff line number Diff line change
Expand Up @@ -219,4 +219,8 @@ public List<SignerInformationEntity> getActiveCertificatesForFilter(String domai
public List<String> getDomainsList() {
return signerInformationRepository.getDomainsList();
}

public List<String> getParticipantsByDomain(String domain) {
return signerInformationRepository.getParticipantsByDomain(domain);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,17 @@ public void job() {
log.error("Failed to process DID-TrustList for domain {} : {}", domain, e.getMessage());
}

//TODO: implement get all participants with given domain (see signerInformationService.getCountryList())
// for (String participant : signerInformationService.getParticipantsByDomain(domain)) {
// String didDocument = null;
// try {
// saveDid(generateContainerPathForDid(domain, participant, null), generateTrustList(domain, participant, null));
// saveDid(generateContainerPathForDid(domain, participant, DSC), generateTrustList(domain, participant, DSC));
// saveDid(generateContainerPathForDid(domain, participant, CSCA), generateTrustList(domain, participant, CSCA));
// } catch (Exception e) {
// log.error("Failed to process DID-TrustList for domain {} : {}", domain, e.getMessage());
// }
// }

for (String participant : signerInformationService.getParticipantsByDomain(domain)) {
String didDocument = null;
try {
saveDid(generateContainerPathForDid(domain, participant, null), generateTrustList(domain, participant, null));
//saveDid(generateContainerPathForDid(domain, participant, DSC), generateTrustList(domain, participant, DSC));
//saveDid(generateContainerPathForDid(domain, participant, CSCA), generateTrustList(domain, participant, CSCA));
} catch (Exception e) {
log.error("Failed to process DID-TrustList for domain {} : {}", domain, e.getMessage());
}
}

}

Expand Down

0 comments on commit fdc1be8

Please sign in to comment.