Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat(gx signer changes) gaiax compliance signer changes #190

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public class StringPool {
public static final String ACTION = "action";
public static final String SUBTYPE = "subType";
public static final String JSON_EXTENSION = ".json";
public static final String AGGREGATION_OF = "gx:aggregationOf";
public static final String AGGREGATION_OF = "gx:aggregationOfExists";
public static final String DEPENDS_ON = "gx:dependsOn";

public static final String CUSTOM_ATTRIBUTE = "gx:customAttribute";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ private void validateAggregationOf(CreateServiceOfferingRequest request) throws
}
JsonNode jsonNode = this.objectMapper.readTree(this.objectMapper.writeValueAsString(request.getCredentialSubject()));

JsonNode aggregationOfArray = jsonNode.at("/gx:aggregationOf");
JsonNode aggregationOfArray = jsonNode.at("/gx:aggregationOfExists");

List<String> ids = new ArrayList<>();
aggregationOfArray.forEach(item -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ private void createParticipantCreationJob(Participant participant) {

public Map<String, String> signService(Participant participant, CreateServiceOfferingRequest request, String name) {
Map<String, String> response = new HashMap<>();
String id = this.wizardHost + participant.getId() + "/" + name + JSON_EXTENSION;
String id = participant.getDomain() + participant.getId() + "/" + name + JSON_EXTENSION;
Map<String, Object> providedBy = new HashMap<>();
providedBy.put(ID, request.getParticipantJsonUrl());
request.getCredentialSubject().put("gx:providedBy", providedBy);
Expand All @@ -288,7 +288,7 @@ public Map<String, String> signService(Participant participant, CreateServiceOff
.serviceOffering(VerifiableCredential.ServiceOffering.builder()
.context(this.contextConfig.serviceOffer())
.type(StringPool.VERIFIABLE_CREDENTIAL)
.id(participant.getDid())
.id(id)
.issuer(participant.getDid())
.issuanceDate(issuanceDate)
.credentialSubject(request.getCredentialSubject())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public class ResourceController extends BaseController {
{"id":"https://wizard-api.smart-x.smartsenselabs.com/12081064-8878-477e-8092-564a240c69e2/participant.json" }
],
"gx:license": [ "http://smartproof.in/.well-known/license"],
"gx:aggregationOf": [{"id":"https://wizard-api.smart-x.smartsenselabs.com/12081064-8878-477e-8092-564a240c69e2/resource_b5b7e6b0-ae24-4458-b3f9-27572abc39e7.json"}],
"gx:aggregationOfExists": [{"id":"https://wizard-api.smart-x.smartsenselabs.com/12081064-8878-477e-8092-564a240c69e2/resource_b5b7e6b0-ae24-4458-b3f9-27572abc39e7.json"}],
"gx:customAttribute": "https://docs.gaia-x.eu/technical-committee/policy-rules-committee/trust-framework/latest/resource/"
}

Expand Down Expand Up @@ -188,7 +188,7 @@ public CommonResponse<Resource> createResource(@PathVariable(StringPool.PARTICIP
{"id":"https://wizard-api.smart-x.smartsenselabs.com/12081064-8878-477e-8092-564a240c69e2/participant.json" }
],
"gx:license": [ "http://smartproof.in/.well-known/license"],
"gx:aggregationOf": [{"id":"https://wizard-api.smart-x.smartsenselabs.com/12081064-8878-477e-8092-564a240c69e2/resource_b5b7e6b0-ae24-4458-b3f9-27572abc39e7.json"}],
"gx:aggregationOfExists": [{"id":"https://wizard-api.smart-x.smartsenselabs.com/12081064-8878-477e-8092-564a240c69e2/resource_b5b7e6b0-ae24-4458-b3f9-27572abc39e7.json"}],
"gx:customAttribute": "https://docs.gaia-x.eu/technical-committee/policy-rules-committee/trust-framework/latest/resource/"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class ServiceOfferController extends BaseController {
"gx:accessType": "physical",
"gx:formatType": "pdf"
},
"gx:aggregationOf": [
"gx:aggregationOfExists": [
{
"id": "https://exmaple.com/12081064-8878-477e-8092-564a240c69e2/resource_9a40cafd-43ed-41b0-a53e-4e2af164fde5.json"
}
Expand Down Expand Up @@ -769,7 +769,7 @@ public class ServiceOfferController extends BaseController {
"gx:accessType": "physical",
"gx:formatType": "pdf"
},
"gx:aggregationOf": [
"gx:aggregationOfExists": [
{
"id": "https://example.com/125/resource_9a40cafd-43ed-41b0-a53e-4e2af164fde5.json"
}
Expand Down Expand Up @@ -822,7 +822,7 @@ public class ServiceOfferController extends BaseController {
"gx:accessType": "physical",
"gx:formatType": "pdf"
},
"gx:aggregationOf": [
"gx:aggregationOfExists": [
{
"id": "https://example.com/125/resource_86e8a7a9-c341-4049-abc7-dcf20e1736fe.json"
}
Expand Down Expand Up @@ -957,7 +957,7 @@ public CommonResponse<ServiceOfferResponse> createServiceOffering(@Valid @Reques
"gx:accessType": "physical",
"gx:formatType": "pdf"
},
"gx:aggregationOf": [
"gx:aggregationOfExists": [
{
"id": "https://exmaple.com/12081064-8878-477e-8092-564a240c69e2/resource_9a40cafd-43ed-41b0-a53e-4e2af164fde5.json"
}
Expand Down Expand Up @@ -1038,7 +1038,7 @@ public void validateServiceOfferRequest(@Valid @RequestBody CreateServiceOfferin
"gx:accessType": "physical",
"gx:formatType": "pdf"
},
"gx:aggregationOf": [
"gx:aggregationOfExists": [
{
"id": "https://exmaple.com/12081064-8878-477e-8092-564a240c69e2/resource_9a40cafd-43ed-41b0-a53e-4e2af164fde5.json"
}
Expand Down Expand Up @@ -1748,7 +1748,7 @@ public void validateServiceOfferRequest(@Valid @RequestBody CreateServiceOfferin
"gx:accessType": "physical",
"gx:formatType": "pdf"
},
"gx:aggregationOf": [
"gx:aggregationOfExists": [
{
"id": "https://example.com/125/resource_9a40cafd-43ed-41b0-a53e-4e2af164fde5.json"
}
Expand Down Expand Up @@ -1801,7 +1801,7 @@ public void validateServiceOfferRequest(@Valid @RequestBody CreateServiceOfferin
"gx:accessType": "physical",
"gx:formatType": "pdf"
},
"gx:aggregationOf": [
"gx:aggregationOfExists": [
{
"id": "https://example.com/125/resource_86e8a7a9-c341-4049-abc7-dcf20e1736fe.json"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private String getPolicyJsonString() {
}

private JsonNode getServiceOfferVc() {
final String serviceOfferVcString = "{\"selfDescriptionCredential\":{\"@context\":\"https://www.w3.org/2018/credentials/v1\",\"type\":[\"VerifiablePresentation\"],\"verifiableCredential\":[{\"@context\":[\"https://www.w3.org/2018/credentials/v1\",\"https://w3id.org/security/suites/jws-2020/v1\",\"https://registry.lab.gaia-x.eu/development/api/trusted-shape-registry/v1/shapes/jsonld/trustframework#\"],\"credentialSubject\":{\"@Context\":[\"https://www.w3.org/2018/credentials/v1\",\"https://w3id.org/security/suites/jws-2020/v1\",\"https://registry.lab.gaia-x.eu/development/api/trusted-shape-registry/v1/shapes/jsonld/trustframework#\"],\"gx:termsAndConditions\":\"The PARTICIPANT signing the Self-Description agrees as follows:\\n- to update its descriptions about any changes, be it technical, organizational, or legal - especially but not limited to contractual in regards to the indicated attributes present in the descriptions.\\n\\nThe keypair used to sign Verifiable Credentials will be revoked where Gaia-X Association becomes aware of any inaccurate statements in regards to the claims which result in a non-compliance with the Trust Framework and policy rules defined in the Policy Rules and Labelling Document (PRLD).\",\"id\":\"https://sscspl.dev.smart-x.smartsenselabs.com/42573548-3816-4558-a8b1-8bcf70232912/participant.json#2\",\"type\":\"gx:GaiaXTermsAndConditions\"},\"id\":\"did:web:sscspl.dev.smart-x.smartsenselabs.com\",\"issuanceDate\":\"2023-09-15T13:37:08.264138715Z\",\"issuer\":\"did:web:sscspl.dev.smart-x.smartsenselabs.com\",\"type\":[\"VerifiableCredential\"]},{\"issuanceDate\":\"2023-09-15T13:42:37.550764021Z\",\"credentialSubject\":{\"type\":\"gx:PhysicalResource\",\"gx:name\":\"Nissan\",\"gx:description\":\"The Nissan Micra replaced the Japanese-market Nissan Cherry. It was exclusive to Nissan Japanese dealership network Nissan Cherry Store until 1999 when the \\\"Cherry\\\" network was combined into Nissan Red Stage until 2003. \",\"gx:maintainedBy\":[{\"id\":\"https://nissan.dev.smart-x.smartsenselabs.com/0861008f-1d6b-4b0d-b666-3ee8683ade40/participant.json#0\"},{\"id\":\"https://mercedes.dev.smart-x.smartsenselabs.com/c314e97f-fd7a-4162-bb7a-f4ee1c5891bd/participant.json#0\"}],\"gx:locationAddress\":[{\"gx:countryCode\":\"DE-BE\"}],\"@context\":[\"https://www.w3.org/2018/credentials/v1\",\"https://registry.lab.gaia-x.eu/development/api/trusted-shape-registry/v1/shapes/jsonld/trustframework#\"],\"id\":\"https://wizard-api.dev.smart-x.smartsenselabs.com/0861008f-1d6b-4b0d-b666-3ee8683ade40/resource_87af6309-ebe6-4038-a4e6-733617f94703.json\"},\"id\":\"https://wizard-api.dev.smart-x.smartsenselabs.com/0861008f-1d6b-4b0d-b666-3ee8683ade40/resource_87af6309-ebe6-4038-a4e6-733617f94703.json\",\"type\":[\"VerifiableCredential\"],\"@context\":[\"https://www.w3.org/2018/credentials/v1\",\"https://registry.lab.gaia-x.eu/development/api/trusted-shape-registry/v1/shapes/jsonld/trustframework#\"],\"issuer\":\"did:web:nissan.dev.smart-x.smartsenselabs.com\"},{\"type\":\"VerifiableCredential\",\"id\":\"did:web:sscspl.dev.smart-x.smartsenselabs.com\",\"issuer\":\"did:web:sscspl.dev.smart-x.smartsenselabs.com\",\"issuanceDate\":\"2023-09-15T13:44:06.883841578Z\",\"credentialSubject\":{\"gx:termsAndConditions\":{\"gx:URL\":\"https://www.smartsensesolutions.com/privacy-policy\",\"gx:hash\":\"8d70597183df65c4e5f700fd753026f9d75b5b63d32d00bd28774f7537d89af5\"},\"gx:policy\":[\"https://wizard-api.dev.smart-x.smartsenselabs.com/42573548-3816-4558-a8b1-8bcf70232912/service_swzt_policy.json\"],\"gx:dataAccountExport\":{\"gx:requestType\":\"Support Center\",\"gx:accessType\":\"Digital\",\"gx:formatType\":[\"application/3gpdash-qoe-report+xml\"]},\"gx:aggregationOf\":[{\"id\":\"https://wizard-api.dev.smart-x.smartsenselabs.com/0861008f-1d6b-4b0d-b666-3ee8683ade40/resource_87af6309-ebe6-4038-a4e6-733617f94703.json\"}],\"gx:dataProtectionRegime\":[\"LGPD2019\",\"GDPR2016\",\"PDPA2012\",\"CCPA2018\",\"VCDPA2021\"],\"type\":\"gx:ServiceOffering\",\"gx:labelLevel\":\"https://wizard-api.dev.smart-x.smartsenselabs.com/42573548-3816-4558-a8b1-8bcf70232912/labelLevel_54ad3541-ef23-4463-bb04-4ac4729307df.json\",\"gx:providedBy\":{\"id\":\"https://sscspl.dev.smart-x.smartsenselabs.com/42573548-3816-4558-a8b1-8bcf70232912/participant.json#0\"},\"id\":\"https://wizard-api.dev.smart-x.smartsenselabs.com/42573548-3816-4558-a8b1-8bcf70232912/service_swzt.json\",\"gx:name\":\"Federated Catalogue - SS Dev\",\"gx:description\":\"Federated Catalogue developed by Smart Sense for the Dev environment\"},\"@context\":[\"https://www.w3.org/2018/credentials/v1\",\"https://w3id.org/security/suites/jws-2020/v1\"]}]}}";
final String serviceOfferVcString = "{\"selfDescriptionCredential\":{\"@context\":\"https://www.w3.org/2018/credentials/v1\",\"type\":[\"VerifiablePresentation\"],\"verifiableCredential\":[{\"@context\":[\"https://www.w3.org/2018/credentials/v1\",\"https://w3id.org/security/suites/jws-2020/v1\",\"https://registry.lab.gaia-x.eu/development/api/trusted-shape-registry/v1/shapes/jsonld/trustframework#\"],\"credentialSubject\":{\"@Context\":[\"https://www.w3.org/2018/credentials/v1\",\"https://w3id.org/security/suites/jws-2020/v1\",\"https://registry.lab.gaia-x.eu/development/api/trusted-shape-registry/v1/shapes/jsonld/trustframework#\"],\"gx:termsAndConditions\":\"The PARTICIPANT signing the Self-Description agrees as follows:\\n- to update its descriptions about any changes, be it technical, organizational, or legal - especially but not limited to contractual in regards to the indicated attributes present in the descriptions.\\n\\nThe keypair used to sign Verifiable Credentials will be revoked where Gaia-X Association becomes aware of any inaccurate statements in regards to the claims which result in a non-compliance with the Trust Framework and policy rules defined in the Policy Rules and Labelling Document (PRLD).\",\"id\":\"https://sscspl.dev.smart-x.smartsenselabs.com/42573548-3816-4558-a8b1-8bcf70232912/participant.json#2\",\"type\":\"gx:GaiaXTermsAndConditions\"},\"id\":\"did:web:sscspl.dev.smart-x.smartsenselabs.com\",\"issuanceDate\":\"2023-09-15T13:37:08.264138715Z\",\"issuer\":\"did:web:sscspl.dev.smart-x.smartsenselabs.com\",\"type\":[\"VerifiableCredential\"]},{\"issuanceDate\":\"2023-09-15T13:42:37.550764021Z\",\"credentialSubject\":{\"type\":\"gx:PhysicalResource\",\"gx:name\":\"Nissan\",\"gx:description\":\"The Nissan Micra replaced the Japanese-market Nissan Cherry. It was exclusive to Nissan Japanese dealership network Nissan Cherry Store until 1999 when the \\\"Cherry\\\" network was combined into Nissan Red Stage until 2003. \",\"gx:maintainedBy\":[{\"id\":\"https://nissan.dev.smart-x.smartsenselabs.com/0861008f-1d6b-4b0d-b666-3ee8683ade40/participant.json#0\"},{\"id\":\"https://mercedes.dev.smart-x.smartsenselabs.com/c314e97f-fd7a-4162-bb7a-f4ee1c5891bd/participant.json#0\"}],\"gx:locationAddress\":[{\"gx:countryCode\":\"DE-BE\"}],\"@context\":[\"https://www.w3.org/2018/credentials/v1\",\"https://registry.lab.gaia-x.eu/development/api/trusted-shape-registry/v1/shapes/jsonld/trustframework#\"],\"id\":\"https://wizard-api.dev.smart-x.smartsenselabs.com/0861008f-1d6b-4b0d-b666-3ee8683ade40/resource_87af6309-ebe6-4038-a4e6-733617f94703.json\"},\"id\":\"https://wizard-api.dev.smart-x.smartsenselabs.com/0861008f-1d6b-4b0d-b666-3ee8683ade40/resource_87af6309-ebe6-4038-a4e6-733617f94703.json\",\"type\":[\"VerifiableCredential\"],\"@context\":[\"https://www.w3.org/2018/credentials/v1\",\"https://registry.lab.gaia-x.eu/development/api/trusted-shape-registry/v1/shapes/jsonld/trustframework#\"],\"issuer\":\"did:web:nissan.dev.smart-x.smartsenselabs.com\"},{\"type\":\"VerifiableCredential\",\"id\":\"did:web:sscspl.dev.smart-x.smartsenselabs.com\",\"issuer\":\"did:web:sscspl.dev.smart-x.smartsenselabs.com\",\"issuanceDate\":\"2023-09-15T13:44:06.883841578Z\",\"credentialSubject\":{\"gx:termsAndConditions\":{\"gx:URL\":\"https://www.smartsensesolutions.com/privacy-policy\",\"gx:hash\":\"8d70597183df65c4e5f700fd753026f9d75b5b63d32d00bd28774f7537d89af5\"},\"gx:policy\":[\"https://wizard-api.dev.smart-x.smartsenselabs.com/42573548-3816-4558-a8b1-8bcf70232912/service_swzt_policy.json\"],\"gx:dataAccountExport\":{\"gx:requestType\":\"Support Center\",\"gx:accessType\":\"Digital\",\"gx:formatType\":[\"application/3gpdash-qoe-report+xml\"]},\"gx:aggregationOfExists\":[{\"id\":\"https://wizard-api.dev.smart-x.smartsenselabs.com/0861008f-1d6b-4b0d-b666-3ee8683ade40/resource_87af6309-ebe6-4038-a4e6-733617f94703.json\"}],\"gx:dataProtectionRegime\":[\"LGPD2019\",\"GDPR2016\",\"PDPA2012\",\"CCPA2018\",\"VCDPA2021\"],\"type\":\"gx:ServiceOffering\",\"gx:labelLevel\":\"https://wizard-api.dev.smart-x.smartsenselabs.com/42573548-3816-4558-a8b1-8bcf70232912/labelLevel_54ad3541-ef23-4463-bb04-4ac4729307df.json\",\"gx:providedBy\":{\"id\":\"https://sscspl.dev.smart-x.smartsenselabs.com/42573548-3816-4558-a8b1-8bcf70232912/participant.json#0\"},\"id\":\"https://wizard-api.dev.smart-x.smartsenselabs.com/42573548-3816-4558-a8b1-8bcf70232912/service_swzt.json\",\"gx:name\":\"Federated Catalogue - SS Dev\",\"gx:description\":\"Federated Catalogue developed by Smart Sense for the Dev environment\"},\"@context\":[\"https://www.w3.org/2018/credentials/v1\",\"https://w3id.org/security/suites/jws-2020/v1\"]}]}}";

try {
return this.objectMapper.readTree(serviceOfferVcString);
Expand Down
Loading
Loading