From 02a9148e9c3c448632acb40eb9935d70e0dd3250 Mon Sep 17 00:00:00 2001 From: aminbenmansour Date: Fri, 27 Oct 2023 16:22:03 +0100 Subject: [PATCH 1/4] chore(acdc): vLEI schemas, credentials and data OOBIs caching script --- config/keri/acdc/credentials/.gitkeep | 0 config/keri/acdc/oobis/.gitkeep | 0 config/keri/acdc/schemas/.gitkeep | 0 config/keri/scripts/vlei.sh | 7 +++++++ 4 files changed, 7 insertions(+) create mode 100644 config/keri/acdc/credentials/.gitkeep create mode 100644 config/keri/acdc/oobis/.gitkeep create mode 100644 config/keri/acdc/schemas/.gitkeep create mode 100755 config/keri/scripts/vlei.sh diff --git a/config/keri/acdc/credentials/.gitkeep b/config/keri/acdc/credentials/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/config/keri/acdc/oobis/.gitkeep b/config/keri/acdc/oobis/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/config/keri/acdc/schemas/.gitkeep b/config/keri/acdc/schemas/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/config/keri/scripts/vlei.sh b/config/keri/scripts/vlei.sh new file mode 100755 index 0000000..a5a5532 --- /dev/null +++ b/config/keri/scripts/vlei.sh @@ -0,0 +1,7 @@ +#! /bin/bash + +# A vLEI server makes schemas, credentials and data OOBIs (added through durls field) discoverable by other entities + +CONFIG_DIR="config/keri/acdc" + +vLEI-server -p 7723 --schema-dir "${CONFIG_DIR}/schemas" --cred-dir "${CONFIG_DIR}/credentials" --oobi-dir "${CONFIG_DIR}/oobis" \ No newline at end of file From c34aaaad2e2f90f9b9bb242a565f3f3d1560f5b2 Mon Sep 17 00:00:00 2001 From: aminbenmansour Date: Sat, 28 Oct 2023 04:57:11 +0100 Subject: [PATCH 2/4] chore(keri): add vLEI dependency --- backend.Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend.Dockerfile b/backend.Dockerfile index a0f27de..503000f 100644 --- a/backend.Dockerfile +++ b/backend.Dockerfile @@ -34,6 +34,12 @@ RUN apt install pip -y && \ mkdir -p /usr/local/var/keri && \ pip install -e . +# vLEI spec leverage `did:keri` to make acdc schemas, credentials and OOBIs (through durls field) discoverable +WORKDIR /vLEI +RUN git clone -b dev https://github.com/WebOfTrust/vLEI.git . && \ + git checkout ed982313dab86bfada3825857601a10d71ce9631 && \ + pip install -e ./ + COPY --from=buildstage /work/build/install/ / WORKDIR /waltid-web-wallet From cf86e5c715a28dcddbda9acd9c225f682fd8e09d Mon Sep 17 00:00:00 2001 From: aminbenmansour Date: Mon, 30 Oct 2023 02:19:10 +0100 Subject: [PATCH 3/4] chore(acdc): a schema template and data requisites for a basic ACDC --- .../keri/acdc/credentials/attributes/.gitkeep | 0 .../credentials/attributes/parent-test.json | 3 + .../acdc/schemas/custom-parent-schema.json | 81 +++++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 config/keri/acdc/credentials/attributes/.gitkeep create mode 100644 config/keri/acdc/credentials/attributes/parent-test.json create mode 100644 config/keri/acdc/schemas/custom-parent-schema.json diff --git a/config/keri/acdc/credentials/attributes/.gitkeep b/config/keri/acdc/credentials/attributes/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/config/keri/acdc/credentials/attributes/parent-test.json b/config/keri/acdc/credentials/attributes/parent-test.json new file mode 100644 index 0000000..b295d69 --- /dev/null +++ b/config/keri/acdc/credentials/attributes/parent-test.json @@ -0,0 +1,3 @@ +{ + "customAttribute": "test" +} \ No newline at end of file diff --git a/config/keri/acdc/schemas/custom-parent-schema.json b/config/keri/acdc/schemas/custom-parent-schema.json new file mode 100644 index 0000000..2629839 --- /dev/null +++ b/config/keri/acdc/schemas/custom-parent-schema.json @@ -0,0 +1,81 @@ +{ + "$id": "", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Custom Parent Credential", + "description": "A parent custom schema that have no dependencies. All attributes are under key 'a'", + "type": "object", + "credentialType": "CustomParentCredential", + "version": "1.0.0", + "properties": { + "v": { + "description": "Credential Version", + "type": "string" + }, + "d": { + "description": "Credential SAID", + "type": "string" + }, + "u": { + "description": "One time use nonce - optional", + "type": "string" + }, + "i": { + "description": "Issuer AID", + "type": "string" + }, + "ri": { + "description": "Credential Registry Identifier", + "type": "string" + }, + "s": { + "description": "Schema SAID", + "type": "string" + }, + "a": { + "oneOf": [ + { + "description": "Attributes block SAID", + "type": "string" + }, + { + "$id": "", + "description": "Attributes block", + "type": "object", + "properties": { + "d": { + "description": "Attributes block SAID", + "type": "string" + }, + "i": { + "description": "Issuee AID", + "type": "string" + }, + "dt": { + "description": "Issuance date time", + "type": "string", + "format": "date-time" + }, + "customAttribute": { + "description": "As d, i and dt are required properties, customAttribute is the one that we defined that actually make our ACDC unique. We can define multiple other attributes", + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "i", + "customAttribute" + ] + } + ] + } + }, + "additionalProperties": false, + "required": [ + "v", + "i", + "ri", + "s", + "d", + "a" + ] +} From a51694780826c265209eec2f90eccc80d378c573 Mon Sep 17 00:00:00 2001 From: aminbenmansour Date: Mon, 30 Oct 2023 02:20:26 +0100 Subject: [PATCH 4/4] chore(acdc): a schema template with edges and rules --- .../credentials/attributes/child-test.json | 6 + config/keri/acdc/credentials/edges/.gitkeep | 0 .../acdc/credentials/edges/child-edge.json | 1 + config/keri/acdc/credentials/rules/.gitkeep | 0 .../acdc/credentials/rules/child-rule.json | 1 + ...stom-child-schema-wth-edges-and-rules.json | 176 ++++++++++++++++++ 6 files changed, 184 insertions(+) create mode 100644 config/keri/acdc/credentials/attributes/child-test.json create mode 100644 config/keri/acdc/credentials/edges/.gitkeep create mode 100644 config/keri/acdc/credentials/edges/child-edge.json create mode 100644 config/keri/acdc/credentials/rules/.gitkeep create mode 100644 config/keri/acdc/credentials/rules/child-rule.json create mode 100644 config/keri/acdc/schemas/custom-child-schema-wth-edges-and-rules.json diff --git a/config/keri/acdc/credentials/attributes/child-test.json b/config/keri/acdc/credentials/attributes/child-test.json new file mode 100644 index 0000000..4437587 --- /dev/null +++ b/config/keri/acdc/credentials/attributes/child-test.json @@ -0,0 +1,6 @@ +{ + "requester": { + "customObjectAttribute": "Test" + }, + "customAttribute": 2 +} diff --git a/config/keri/acdc/credentials/edges/.gitkeep b/config/keri/acdc/credentials/edges/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/config/keri/acdc/credentials/edges/child-edge.json b/config/keri/acdc/credentials/edges/child-edge.json new file mode 100644 index 0000000..9cb3df6 --- /dev/null +++ b/config/keri/acdc/credentials/edges/child-edge.json @@ -0,0 +1 @@ +{"d": "", "requester": {"n": "", "s": ""}} \ No newline at end of file diff --git a/config/keri/acdc/credentials/rules/.gitkeep b/config/keri/acdc/credentials/rules/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/config/keri/acdc/credentials/rules/child-rule.json b/config/keri/acdc/credentials/rules/child-rule.json new file mode 100644 index 0000000..bef3884 --- /dev/null +++ b/config/keri/acdc/credentials/rules/child-rule.json @@ -0,0 +1 @@ +{"d": "", "privacyDisclaimer": {"l": "It is the sole responsibility of Holders of a CustomChildCredential to present that credential in a privacy-preserving manner using the mechanisms provided in the Issuance and Presentation Exchange (IPEX) protocol specification and the Authentic Chained Data Container (ACDC) specification. https://github.com/WebOfTrust/IETF-IPEX and https://github.com/trustoverip/tswg-acdc-specification."}} \ No newline at end of file diff --git a/config/keri/acdc/schemas/custom-child-schema-wth-edges-and-rules.json b/config/keri/acdc/schemas/custom-child-schema-wth-edges-and-rules.json new file mode 100644 index 0000000..ce594f3 --- /dev/null +++ b/config/keri/acdc/schemas/custom-child-schema-wth-edges-and-rules.json @@ -0,0 +1,176 @@ +{ + "$id": "", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Custom Child Credential", + "description": "A child custom schema means that it will have dependencies to the parent schema. It will also include rules to act as a Ricardian Contract", + "type": "object", + "credentialType": "CustomChildCredential", + "version": "1.0.0", + "properties": { + "v": { + "description": "Credential Version", + "type": "string" + }, + "d": { + "description": "Credential SAID", + "type": "string" + }, + "u": { + "description": "One time use nonce - optional", + "type": "string" + }, + "i": { + "description": "Issuer AID", + "type": "string" + }, + "ri": { + "description": "Credential Registry Identifier", + "type": "string" + }, + "s": { + "description": "Schema SAID", + "type": "string" + }, + "a": { + "oneOf": [ + { + "description": "Attributes block SAID", + "type": "string" + }, + { + "$id": "", + "description": "Attributes block", + "type": "object", + "properties": { + "d": { + "description": "Attributes block SAID", + "type": "string" + }, + "i": { + "description": "Issuee AID", + "type": "string" + }, + "dt": { + "description": "Issuance date time", + "type": "string", + "format": "date-time" + }, + "requester": { + "description": "Defining tightly related attributes together in one object. This is helpful for SD and enhances IPEX protocol interactions depending on the use case!", + "type": "object", + "properties": { + "customObjectAttribute": { + "description": "First custom attribute, it usually comes with", + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "customObjectAttribute" + ] + }, + "customAttribute": { + "customAttribute": "A custom attribute like we defined earlier", + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "i", + "requester", + "customAttribute" + ] + } + ] + }, + "e": { + "oneOf": [ + { + "description": "Edges block SAID", + "type": "string" + }, + { + "$id": "", + "description": "Edges block", + "type": "object", + "properties": { + "d": { + "description": "Edges block SAID", + "type": "string" + }, + "exampleEdge": { + "description": "The custom parent schema which the authorizer is responding to.", + "type": "object", + "properties": { + "n": { + "description": "SAID of the CustomParentCredential ACDC", + "type": "string" + }, + "s": { + "description": "SAID of CustomParentCredential ACDC schema", + "type": "string", + "const": "" + } + }, + "additionalProperties": false, + "required": [ + "n", + "s" + ] + } + }, + "additionalProperties": false, + "required": [ + "d", + "exampleEdge" + ] + } + ] + }, + "r": { + "oneOf": [ + { + "description": "Rules block SAID", + "type": "string" + }, + { + "$id": "", + "description": "Rules block", + "type": "object", + "properties": { + "d": { + "description": "Rules block SAID", + "type": "string" + }, + "privacyDisclaimer": { + "description": "Privacy Disclaimer", + "type": "object", + "properties": { + "l": { + "description": "Associated legal language", + "type": "string", + "const": "It is the sole responsibility of Holders of a CustomChildCredential to present that credential in a privacy-preserving manner using the mechanisms provided in the Issuance and Presentation Exchange (IPEX) protocol specification and the Authentic Chained Data Container (ACDC) specification. https://github.com/WebOfTrust/IETF-IPEX and https://github.com/trustoverip/tswg-acdc-specification." + } + } + } + }, + "additionalProperties": false, + "required": [ + "d", + "privacyDisclaimer" + ] + } + ] + } + }, + "additionalProperties": false, + "required": [ + "v", + "i", + "ri", + "s", + "d", + "a", + "e" + ] +}