Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DID:SOV DIDDoc does resolve without a service/endpoint #1090

Open
gmulhearn opened this issue Dec 18, 2023 · 0 comments · May be fixed by #1105
Open

DID:SOV DIDDoc does resolve without a service/endpoint #1090

gmulhearn opened this issue Dec 18, 2023 · 0 comments · May be fixed by #1105

Comments

@gmulhearn
Copy link
Contributor

part of this series of issues; #1089

in the did_resolver_sov crate, if the did:sov DID does not have an endpoint attribute, then the entire DIDDoc fails to resolve.

E.g. the following fails with NotFound("DID not found"):


#[tokio::test]
async fn write_new_nym_and_get_did_doc() {
    let profile = build_setup_profile().await;
    let (new_nym, verkey) = profile
        .wallet
        .create_and_store_my_did(None, None)
        .await
        .unwrap();

    profile
        .ledger_write
        .publish_nym(
            &profile.wallet,
            &profile.institution_did,
            &new_nym,
            Some(&verkey),
            None,
            None,
        )
        .await
        .unwrap();

    // NEED TO WRITE ENDPOINT FOR IT TO RESOLVE
    // write_test_endpoint(&profile.wallet, &profile.ledger_write, &new_nym).await;

    let resolver = DidSovResolver::new(profile.ledger_read);
    let did = format!("did:sov:{}", new_nym);

    let did_doc = resolver
        .resolve(
            &Did::parse(did.clone()).unwrap(),
            &DidResolutionOptions::default(),
        )
        .await
        .unwrap();

    println!(
        "{}",
        serde_json::to_string_pretty(&did_doc.did_document()).unwrap()
    );
}

Expected behaviour according to spec https://sovrin-foundation.github.io/sovrin/spec/did-method-spec-template.html#crud-operation-definitions :

If an endpoint ATTRIB does not exist for the NYM, the service block is an empty array (e.g. "service": []

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment