Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #34 from walt-id/feat/keri
Browse files Browse the repository at this point in the history
Add KERI and ACDC support
  • Loading branch information
aminbenmansour authored Nov 1, 2023
2 parents 8394960 + e27e6ea commit 96f303e
Show file tree
Hide file tree
Showing 52 changed files with 2,202 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build on every push
name: Build and Test on every push

on:
push:
Expand All @@ -8,10 +8,9 @@ on:
- '**'
- '!main'


jobs:
build:
name: "Build"
name: "Build and Test"
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -44,3 +43,9 @@ jobs:
uses: eskatos/[email protected]
with:
arguments: build --no-daemon

# Add the test step below
- name: Running gradle test
uses: eskatos/[email protected]
with:
arguments: test --no-daemon
31 changes: 31 additions & 0 deletions backend.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,37 @@ RUN gradle clean installDist

FROM docker.io/eclipse-temurin:17

SHELL ["/bin/bash", "-c"]

RUN apt update && \
apt upgrade -y

# installing crypto lib dependencies for KERI
RUN apt install -y libsodium23 && \
apt install -y libsodium-dev && \
apt install -y libffi-dev

# setup Rust for blake3 dependency build
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && \
source "$HOME/.cargo/env"

# installing keripy directly from source (published 1.0.0 is bugged)
WORKDIR /keripy
RUN apt install git -y && \
git clone -b development https://github.com/WebOfTrust/keripy.git . && \
git checkout 4185296affb2348d19af6009be04f682a3e19360

RUN apt install pip -y && \
source "$HOME/.cargo/env" &&pip install -r requirements.txt && \
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

Expand Down
7 changes: 7 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ dependencies {
exclude("com.sksamuel.hoplite", "hoplite-yaml")
exclude("com.sksamuel.hoplite", "hoplite-hikaricp")
}
testImplementation("org.junit.jupiter:junit-jupiter:5.8.1")

/* -- KTOR -- */

Expand Down Expand Up @@ -76,6 +77,7 @@ dependencies {

// Kotlinx.serialization
implementation("io.ktor:ktor-serialization-kotlinx-json:$ktorVersion")
implementation("com.google.code.gson:gson:2.10.1")

// Date
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.4.1")
Expand Down Expand Up @@ -135,4 +137,9 @@ dependencies {
testImplementation("io.kotest:kotest-assertions-core:5.5.5")
testImplementation("io.kotest.extensions:kotest-assertions-ktor:2.0.0")*/
testImplementation("io.ktor:ktor-server-tests-jvm:$ktorVersion")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.2")
testImplementation("org.junit.jupiter:junit-jupiter:5.9.2")

// Logging
implementation("io.github.oshai:kotlin-logging:5.1.0")
}
Empty file.
Empty file.
Empty file added config/keri/acdc/data/.gitkeep
Empty file.
Empty file.
6 changes: 6 additions & 0 deletions config/keri/acdc/data/attributes/child-test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"requester": {
"customObjectAttribute": "Test"
},
"customAttribute": 2
}
3 changes: 3 additions & 0 deletions config/keri/acdc/data/attributes/parent-test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"customAttribute": "test"
}
Empty file.
1 change: 1 addition & 0 deletions config/keri/acdc/data/edges/child-edge.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"d": "", "requester": {"n": "", "s": ""}}
Empty file.
1 change: 1 addition & 0 deletions config/keri/acdc/data/rules/child-rule.json
Original file line number Diff line number Diff line change
@@ -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."}}
Empty file.
Original file line number Diff line number Diff line change
@@ -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"
]
}
81 changes: 81 additions & 0 deletions config/keri/acdc/schemas/raw/custom-parent-schema.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
Empty file.
8 changes: 8 additions & 0 deletions config/keri/cf/controller-oobi-bootstrap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"dt": "2022-01-20T12:57:59.823350+00:00",
"iurls": [
"http://127.0.0.1:5642/oobi/BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha",
"http://127.0.0.1:5643/oobi/BLskRTInXnMxWaGqcpSyMgo0nYbalW99cGZESrz3zapM",
"http://127.0.0.1:5644/oobi/BIKKuvBwpmDVA4Ds-EpL5bt9OqPzWPja2LigFYZN2YfX"
]
}
8 changes: 8 additions & 0 deletions config/keri/cf/main/wan-witness.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"wan": {
"dt": "2022-01-20T12:57:59.823350+00:00",
"curls": ["tcp://127.0.0.1:5632/", "http://127.0.0.1:5642/"]
},
"dt": "2022-01-20T12:57:59.823350+00:00",
"iurls": []
}
8 changes: 8 additions & 0 deletions config/keri/cf/main/wes-witness.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"wes": {
"dt": "2022-01-20T12:57:59.823350+00:00",
"curls": ["tcp://127.0.0.1:5634/", "http://127.0.0.1:5644/"]
},
"dt": "2022-01-20T12:57:59.823350+00:00",
"iurls": []
}
Loading

0 comments on commit 96f303e

Please sign in to comment.