From 0bd96e3da21e1d77f2078b028fcf6c2a0bb9ed89 Mon Sep 17 00:00:00 2001 From: arnoweiss Date: Thu, 22 Aug 2024 18:15:17 +0200 Subject: [PATCH 1/4] fix: sample credential offer message --- .github/workflows/validate-schemas.yml | 2 +- .../example/credential-offer-message.json | 41 ++++++++++++++----- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/.github/workflows/validate-schemas.yml b/.github/workflows/validate-schemas.yml index c3590cf..c5d1472 100644 --- a/.github/workflows/validate-schemas.yml +++ b/.github/workflows/validate-schemas.yml @@ -37,7 +37,7 @@ jobs: if [[ -f "$schema_file" ]]; then echo "Validating $json_file against $schema_file" - check-jsonschema --schemafile "$schema_file" "$json_file" + check-jsonschema --schemafile --verbose "$schema_file" "$json_file" else echo "WARNING: Schema file not found for $json_file" fi diff --git a/issuance/message/example/credential-offer-message.json b/issuance/message/example/credential-offer-message.json index d5a271e..afa675b 100644 --- a/issuance/message/example/credential-offer-message.json +++ b/issuance/message/example/credential-offer-message.json @@ -7,19 +7,40 @@ "credentials": [ { "@context": [ - "https://www.w3.org/2018/credentials/v1", - "http://example.org/context" + "https://w3id.org/tractusx-trust/v0.8" ], - "@type": "UniversityDegreeCredential", - "issuer": "did:web:issuer", - "credentialSubject": { - "id": "did:web:holder", - "degree": { - "type": "BachelorDegree", - "name": "Bachelor of Science and Arts" - } + "@type": "CredentialObject", + "credentialType": [ + "VerifiableCredential", + "CompanyCredential" + ], + "format": "ldp_vc", + "offerReason": "reissue", + "bindingMethods": [ + "did:web" + ], + "cryptographicSuites": [ + "JsonWebKey2020" + ], + "issuancePolicy": { + "@context":"https://www.w3.org/ns/odrl.jsonld", + "permission": [ + { + "action": "use", + "constraint": { + "and": [ + { + "leftOperand": "iatp:CredentialPrereq", + "operator": "eq", + "rightOperand": "active" + } + ] + } + } + ] } } + } ] } \ No newline at end of file From cd985de2d04209032aaa8ef97d309df77ed5147d Mon Sep 17 00:00:00 2001 From: arnoweiss Date: Thu, 22 Aug 2024 18:18:16 +0200 Subject: [PATCH 2/4] fix: schema action --- .github/workflows/validate-schemas.yml | 2 +- issuance/message/example/credential-offer-message.json | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/validate-schemas.yml b/.github/workflows/validate-schemas.yml index c5d1472..ffda63c 100644 --- a/.github/workflows/validate-schemas.yml +++ b/.github/workflows/validate-schemas.yml @@ -37,7 +37,7 @@ jobs: if [[ -f "$schema_file" ]]; then echo "Validating $json_file against $schema_file" - check-jsonschema --schemafile --verbose "$schema_file" "$json_file" + check-jsonschema --schemafile "$schema_file" "$json_file" --verbose else echo "WARNING: Schema file not found for $json_file" fi diff --git a/issuance/message/example/credential-offer-message.json b/issuance/message/example/credential-offer-message.json index afa675b..8d2cd07 100644 --- a/issuance/message/example/credential-offer-message.json +++ b/issuance/message/example/credential-offer-message.json @@ -40,7 +40,6 @@ ] } } - } ] } \ No newline at end of file From 86a67049f6558146e138a95caba41df606df0c83 Mon Sep 17 00:00:00 2001 From: arnoweiss Date: Thu, 22 Aug 2024 18:21:44 +0200 Subject: [PATCH 3/4] fix: make constraint an array --- .../example/credential-offer-message.json | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/issuance/message/example/credential-offer-message.json b/issuance/message/example/credential-offer-message.json index 8d2cd07..7139db2 100644 --- a/issuance/message/example/credential-offer-message.json +++ b/issuance/message/example/credential-offer-message.json @@ -23,19 +23,21 @@ "JsonWebKey2020" ], "issuancePolicy": { - "@context":"https://www.w3.org/ns/odrl.jsonld", + "@context": "https://www.w3.org/ns/odrl.jsonld", "permission": [ { "action": "use", - "constraint": { - "and": [ - { - "leftOperand": "iatp:CredentialPrereq", - "operator": "eq", - "rightOperand": "active" - } - ] - } + "constraint": [ + { + "and": [ + { + "leftOperand": "iatp:CredentialPrereq", + "operator": "eq", + "rightOperand": "active" + } + ] + } + ] } ] } From 3c8477aa0235e28597ed49acdb85727f5b3c7321 Mon Sep 17 00:00:00 2001 From: arnoweiss Date: Thu, 22 Aug 2024 18:26:10 +0200 Subject: [PATCH 4/4] fix: remove AND --- .../example/credential-offer-message.json | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/issuance/message/example/credential-offer-message.json b/issuance/message/example/credential-offer-message.json index 7139db2..9d5dd9a 100644 --- a/issuance/message/example/credential-offer-message.json +++ b/issuance/message/example/credential-offer-message.json @@ -27,17 +27,11 @@ "permission": [ { "action": "use", - "constraint": [ - { - "and": [ - { - "leftOperand": "iatp:CredentialPrereq", - "operator": "eq", - "rightOperand": "active" - } - ] - } - ] + "constraint": { + "leftOperand": "iatp:CredentialPrereq", + "operator": "eq", + "rightOperand": "active" + } } ] }