diff --git a/wizard-core/src/main/java/eu/gaiax/wizard/core/service/service_offer/PolicyService.java b/wizard-core/src/main/java/eu/gaiax/wizard/core/service/service_offer/PolicyService.java index db71bf7..c633047 100644 --- a/wizard-core/src/main/java/eu/gaiax/wizard/core/service/service_offer/PolicyService.java +++ b/wizard-core/src/main/java/eu/gaiax/wizard/core/service/service_offer/PolicyService.java @@ -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); } diff --git a/wizard-core/src/main/java/eu/gaiax/wizard/core/service/service_offer/ServiceOfferService.java b/wizard-core/src/main/java/eu/gaiax/wizard/core/service/service_offer/ServiceOfferService.java index cf79d98..fbfcb24 100644 --- a/wizard-core/src/main/java/eu/gaiax/wizard/core/service/service_offer/ServiceOfferService.java +++ b/wizard-core/src/main/java/eu/gaiax/wizard/core/service/service_offer/ServiceOfferService.java @@ -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 labelLevelVc = this.createServiceOfferLabelLevel(participant, request, serviceHostUrl); Map credentialSubject = request.getCredentialSubject(); @@ -122,7 +123,8 @@ public ServiceOfferResponse createServiceOffering(CreateServiceOfferingRequest r request.setCredentialSubject(credentialSubject); Map 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 supportedStandardList = this.getSupportedStandardList(complianceCredential.get(SERVICE_VC)); ServiceOffer serviceOffer = ServiceOffer.builder() diff --git a/wizard-core/src/main/java/eu/gaiax/wizard/core/service/signer/SignerService.java b/wizard-core/src/main/java/eu/gaiax/wizard/core/service/signer/SignerService.java index 3ea1176..bbbb761 100644 --- a/wizard-core/src/main/java/eu/gaiax/wizard/core/service/signer/SignerService.java +++ b/wizard-core/src/main/java/eu/gaiax/wizard/core/service/signer/SignerService.java @@ -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; }