Skip to content

Commit

Permalink
Add did:ion DID method
Browse files Browse the repository at this point in the history
  • Loading branch information
clehner committed Mar 2, 2022
1 parent f456a38 commit 5d32f87
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ did-pkh = { version = "0.1", path = "../../ssi/did-pkh" }
did-web = { version = "^0.1.1", path = "../../ssi/did-web" }
did-webkey = { version = "0.1", path = "../../ssi/did-webkey", default-features = false }
did-onion = { version = "^0.1.1", path = "../../ssi/did-onion" }
did-ion = { version = "^0.1.0", path = "../../ssi/did-ion" }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
# TODO feature-gate JNI, or extract it in another crate like we do for Python (and probably WASM as well)
Expand Down
15 changes: 14 additions & 1 deletion lib/src/did_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,26 @@ use did_method_key::DIDKey;
use did_onion::DIDOnion;
use did_pkh::DIDPKH;
// use did_sol::DIDSol;
use did_ion::DIDION;
use did_tz::DIDTz;
use did_web::DIDWeb;
use did_webkey::DIDWebKey;
use ssi::did::DIDMethods;
use ssi::did::{DIDMethod, DIDMethods};
use std::env::VarError;

lazy_static! {
static ref DIDTZ: DIDTz = DIDTz::default();
static ref DIDONION: DIDOnion = DIDOnion::default();
static ref ION: DIDION = DIDION::new(
match std::env::var("DID_ION_API_URL") {
Ok(string) => Some(string),
Err(VarError::NotPresent) => None,
Err(VarError::NotUnicode(err)) => {
eprintln!("Unable to parse DID_ION_API_URL: {:?}", err);
None
}
}
);
pub static ref DID_METHODS: DIDMethods<'static> = {
let mut methods = DIDMethods::default();
methods.insert(&DIDKey);
Expand All @@ -21,6 +33,7 @@ lazy_static! {
methods.insert(&DIDWebKey);
methods.insert(&DIDPKH);
methods.insert(&*DIDONION);
methods.insert(&*ION);
methods
};
}

0 comments on commit 5d32f87

Please sign in to comment.