Skip to content

Commit

Permalink
feat: persist DID Web Document
Browse files Browse the repository at this point in the history
  • Loading branch information
nanderstabel committed Dec 2, 2024
1 parent 0757882 commit ef2b91e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions agent_identity/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,20 @@ pub async fn initialize(state: &IdentityState) {
// If the did:web method is enabled, create a document
if enable_did_web {
let did_method = DidMethod::Web;

match query_handler(&did_method.to_string(), &state.query.document).await {
Ok(Some(Document {
document: Some(document),
..
})) => {
info!("DID Web Document already exists: {:?}", document);
return;
}
_ => {
warn!("Failed to retrieve DID Web Document");
}
}

let command = DocumentCommand::CreateDocument {
did_method: did_method.clone(),
};
Expand Down

0 comments on commit ef2b91e

Please sign in to comment.