-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an implementation of a VC issuer (#2057)
* Add an implementation of a VC issuer. * Remove commmented out deps, fix an URL * Fix an issuer bug, extend a test * Document issuer's candid interface * Address review comments * Update demos/vc_issuer/build.sh Co-authored-by: Nicolas Mattia <[email protected]> * +=prettier * fix vc_issuer/build.sh --------- Co-authored-by: Nicolas Mattia <[email protected]>
- Loading branch information
Showing
11 changed files
with
4,681 additions
and
2 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
[workspace] | ||
|
||
[package] | ||
name = "vc_issuer" | ||
description = "Verifiable Credentials Issuer" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
# local dependencies | ||
canister_sig_util = { path = "../../src/canister_sig_util" } | ||
internet_identity_interface = { path = "../../src/internet_identity_interface" } | ||
vc_util = { path = "../../src/vc_util" } | ||
# ic dependencies | ||
candid = "0.9" | ||
ic-cdk = "0.10" | ||
ic-cdk-macros = "0.7" | ||
ic-certified-map = "0.4" | ||
ic-stable-structures = "0.6.0" | ||
# vc dependencies | ||
identity_core = { git = "https://github.com/frederikrothenberger/identity.rs.git", branch = "frederik/wasm-test", default-features = false} | ||
identity_credential = {git = "https://github.com/frederikrothenberger/identity.rs.git", branch = "frederik/wasm-test", default-features = false, features = ["credential"]} | ||
identity_jose = { git = "https://github.com/frederikrothenberger/identity.rs.git", branch = "frederik/wasm-test", default-features = false, features = ["iccs"]} | ||
|
||
# other dependencies | ||
hex = "0.4" | ||
serde = { version = "1", features = ["derive"] } | ||
serde_bytes = "0.11" | ||
serde_cbor = "0.11" | ||
serde_json = "1" | ||
sha2 = "^0.10" # set bound to match ic-certified-map bound | ||
|
||
[dev-dependencies] | ||
assert_matches = "1.5.0" | ||
ic-test-state-machine-client = "3" | ||
canister_tests = { path = "../../src/canister_tests" } | ||
lazy_static = "1.4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# An example issuer of verifiable credentials | ||
|
||
This is an example implementation of an issuer of verifiable credentials for | ||
the [attribute sharing flow on the IC](https://github.com/dfinity/wg-identity-authentication/blob/main/topics/attribute-sharing.md). | ||
|
||
## Supported Behavior | ||
|
||
The app implements the interface of the issuer from [the spec](../../docs/vc-spec.md), plus some additional | ||
APIs for configuring and testing, cf. [vc_issuer.did](./vc_issuer.did). | ||
Please note that this issuer is for demonstrating the use of issuer APIS, and is **not meant | ||
for real-world deployment**, as it does not have proper management of user data. | ||
|
||
## Development | ||
|
||
Run `./build.sh` script to build the issuer canister. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
|
||
# Make sure we always run from the issuer root | ||
VC_ISSUER_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
cd "$VC_ISSUER_DIR" | ||
|
||
cargo build --release --target wasm32-unknown-unknown --manifest-path ./Cargo.toml -j1 | ||
ic-wasm "target/wasm32-unknown-unknown/release/vc_issuer.wasm" -o "./vc_issuer.wasm" shrink | ||
ic-wasm vc_issuer.wasm -o vc_issuer.wasm metadata candid:service -f vc_issuer.did -v public | ||
gzip --no-name --force "vc_issuer.wasm" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"canisters": { | ||
"internet_identity": { | ||
"type": "custom", | ||
"candid": "../../src/internet_identity/internet_identity.did", | ||
"wasm": "../../internet_identity.wasm.gz", | ||
|
||
"remote": { | ||
"id": { | ||
"ic": "rdmx6-jaaaa-aaaaa-aaadq-cai" | ||
} | ||
} | ||
}, | ||
|
||
"issuer": { | ||
"type": "custom", | ||
"candid": "vc_issuer.did", | ||
"wasm": "vc_issuer.wasm.gz", | ||
"build": "./build.sh" | ||
} | ||
}, | ||
"defaults": { | ||
"build": { | ||
"packtool": "" | ||
} | ||
}, | ||
"version": 1 | ||
} |
Oops, something went wrong.