From 3faa9b1b9fb8db06c412428b7567173a53ccacb4 Mon Sep 17 00:00:00 2001 From: Nander Stabel Date: Wed, 8 May 2024 14:38:35 +0200 Subject: [PATCH] feat: add `from_str_with_namespace` to `SubjectSyntaxType::from_str` --- oid4vc-core/src/subject_syntax_type.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/oid4vc-core/src/subject_syntax_type.rs b/oid4vc-core/src/subject_syntax_type.rs index ee032000..eba6f3a7 100644 --- a/oid4vc-core/src/subject_syntax_type.rs +++ b/oid4vc-core/src/subject_syntax_type.rs @@ -16,7 +16,9 @@ impl FromStr for SubjectSyntaxType { fn from_str(s: &str) -> Result { match s { "urn:ietf:params:oauth:jwk-thumbprint" => Ok(SubjectSyntaxType::JwkThumbprint), - _ => Ok(SubjectSyntaxType::Did(DidMethod::from_str(s)?)), + _ => Ok(SubjectSyntaxType::Did( + DidMethod::from_str_with_namespace(s).or_else(|_| DidMethod::from_str(s))?, + )), } } }