Skip to content

Commit

Permalink
Merge pull request #194 from smartSenseSolutions/fix-dependens-on-ser…
Browse files Browse the repository at this point in the history
…vice-offer-update-vc-url
  • Loading branch information
dilipdhankecha2530 authored Jun 13, 2024
2 parents 8fe9266 + bbbba1b commit b2cef06
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void hostPolicy(String hostPolicyJson, String hostedPath) {
FileUtils.writeStringToFile(file, hostPolicyJson, Charset.defaultCharset());
this.s3Utils.uploadFile(hostedPath, file);
} catch (Exception e) {
log.error("Error while hosting policy json on path " + hostedPath, e);
log.error("Error while hosting policy json on path {}", hostedPath, e);
} finally {
CommonUtils.deleteFile(file);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ public ServiceOfferResponse createServiceOffering(CreateServiceOfferingRequest r
}

String serviceName = "service_" + this.getRandomString();
String serviceHostUrl = this.wizardHost + participant.getId() + "/" + serviceName + ".json";

String serviceHostUrl = signerService.formServiceOfferingJsonUrl(participant.getDomain(), participant.getId(), serviceName);

Map<String, String> labelLevelVc = this.createServiceOfferLabelLevel(participant, request, serviceHostUrl);
Map<String, Object> credentialSubject = request.getCredentialSubject();
Expand All @@ -122,7 +123,8 @@ public ServiceOfferResponse createServiceOffering(CreateServiceOfferingRequest r
request.setCredentialSubject(credentialSubject);

Map<String, String> complianceCredential = this.signerService.signService(participant, request, serviceName);
Credential serviceOffVc = this.credentialService.createCredential(complianceCredential.get(SERVICE_VC), serviceHostUrl, CredentialTypeEnum.SERVICE_OFFER.getCredentialType(), "", participant);

Credential serviceOffVc = this.credentialService.createCredential(complianceCredential.get(SERVICE_VC), serviceHostUrl, CredentialTypeEnum.SERVICE_OFFER.getCredentialType(), "", participant);
List<StandardTypeMaster> supportedStandardList = this.getSupportedStandardList(complianceCredential.get(SERVICE_VC));

ServiceOffer serviceOffer = ServiceOffer.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ private String formParticipantJsonUrl(String domain, UUID participantId) {
return this.wizardHost + participantId.toString() + "/" + PARTICIPANT_JSON;
}

private String formServiceOfferingJsonUrl(String domain, UUID participantId, String name) {
public String formServiceOfferingJsonUrl(String domain, UUID participantId, String name) {
if (StringUtils.hasText(domain)) {
return "https://" + domain + "/" + participantId.toString() + "/" + name + JSON_EXTENSION;
}
Expand Down

0 comments on commit b2cef06

Please sign in to comment.