Skip to content

Commit

Permalink
feat: add validate_linked_verifiable_presentations
Browse files Browse the repository at this point in the history
  • Loading branch information
nanderstabel committed Sep 11, 2024
1 parent bad8844 commit 61fb522
Show file tree
Hide file tree
Showing 15 changed files with 982 additions and 229 deletions.
42 changes: 31 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ tauri-runtime-wry = { version = "=2.0.0-beta.20" }
tauri-utils = { version = "=2.0.0-beta.19", features = [ "resources" ] }
tauri-winres = "=0.1"

did_manager = { git = "https://github.com/impierce/did-manager.git", rev = "2b88f55" }
agent_shared = { git = "https://git@github.com/impierce/ssi-agent.git", rev = "1823810" }
did_manager = { git = "https://git@github.com/impierce/did-manager.git", tag = "v1.0.0-beta.3" }
jsonwebtoken = "9.3"
log = "^0.4"
oid4vc = { git = "https://git@github.com/impierce/openid4vc.git", rev = "d095db0" }
Expand Down
2 changes: 2 additions & 0 deletions identity-wallet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ identity_credential = { version = "1.3", default-features = false, features = [
"presentation",
"validator",
] }
identity_core = { version = "1.3" }
identity_eddsa_verifier = { version = "1.3" }
identity_iota = { version = "1.3" }
identity_jose = { version = "1.3" }
iota_stronghold = { version = "2.1" }
itertools = "0.10.5"
jsonwebtoken.workspace = true
Expand Down
3 changes: 2 additions & 1 deletion identity-wallet/bindings/user_prompt/CurrentUserPrompt.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { LinkedVerifiableCredentialData } from "./LinkedVerifiableCredentialData";
import type { ValidationResult } from "./ValidationResult";

export type CurrentUserPrompt = { "type": "redirect", target: string, } | { "type": "password-required" } | { "type": "accept-connection", client_name: string, logo_uri?: string, redirect_uri: string, previously_connected: boolean, domain_validation: ValidationResult, thuiswinkel_validation: ValidationResult, } | { "type": "credential-offer", issuer_name: string, logo_uri?: string, credential_configurations: Record<string, any>, } | { "type": "share-credentials", client_name: string, logo_uri?: string, options: Array<string>, };
export type CurrentUserPrompt = { "type": "redirect", target: string, } | { "type": "password-required" } | { "type": "accept-connection", client_name: string, logo_uri?: string, redirect_uri: string, previously_connected: boolean, domain_validation: ValidationResult, linked_verifiable_presentations: Array<LinkedVerifiableCredentialData>, } | { "type": "credential-offer", issuer_name: string, logo_uri?: string, credential_configurations: Record<string, any>, } | { "type": "share-credentials", client_name: string, logo_uri?: string, options: Array<string>, };
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

export interface LinkedVerifiableCredentialData { name: string | null, logo_uri: string | null, issuance_date: string, }
4 changes: 1 addition & 3 deletions identity-wallet/src/state/did/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
pub mod actions;
pub mod reducers;
pub mod validate_domain_linkage;
// TODO(proj-e-commerce): This needs to be properly implemented. For now it just demonstrates how the Thuiswinkel
// Waarborg would work in UniMe.
pub mod validate_thuiswinkel_waarborg;
pub mod validate_linked_verifiable_presentations;
4 changes: 3 additions & 1 deletion identity-wallet/src/state/did/validate_domain_linkage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub enum ValidationStatus {
}

/// This `Verifier` uses `jsonwebtoken` under the hood to verify verification input.
struct Verifier;
pub struct Verifier;
impl JwsVerifier for Verifier {
fn verify(&self, input: VerificationInput, public_key: &IotaIdentityJwk) -> Result<(), SignatureVerificationError> {
use SignatureVerificationErrorKind::*;
Expand Down Expand Up @@ -104,6 +104,8 @@ pub async fn validate_domain_linkage(url: url::Url, did: &str) -> ValidationResu
}
};

info!("Resolved document: {:?}", document);

let url = identity_iota::core::Url::from(url);

let res = validator.validate_linkage(
Expand Down
Loading

0 comments on commit 61fb522

Please sign in to comment.