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

Closed
gmulhearn opened this issue Dec 18, 2023 · 0 comments · Fixed by #1105
Closed

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

gmulhearn opened this issue Dec 18, 2023 · 0 comments · 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": []

alberto-instnt pushed a commit to instnt-inc/instnt-aries-vcx that referenced this issue Sep 10, 2024
…t a service/endpoint and expands shorthand verkey notation for publicKeyBase58 (hyperledger#1105)

* lli - Added Solution/Tests

Signed-off-by: lli <lli@anonyome.com>

* lli - merge issue 1090

Signed-off-by: lli <lli@anonyome.com>

* lli - Add Resolution Test back

Signed-off-by: lli <lli@anonyome.com>

* lli - Clippy fixes

Signed-off-by: lli <lli@anonyome.com>

* lli - Clippy fixes

Signed-off-by: lli <lli@anonyome.com>

* lli - Clippy fixes

Signed-off-by: lli <lli@anonyome.com>

* lli - Clippy fixes

Signed-off-by: lli <lli@anonyome.com>

* lli - Clippy fixes

Signed-off-by: lli <lli@anonyome.com>

* lli - Fix Expanding Verkey Fn

Signed-off-by: lli <lli@anonyome.com>

* lli - Fix unwrapping err

Signed-off-by: lli <lli@anonyome.com>

* lli - Remove unwraps

Signed-off-by: lli <lli@anonyome.com>

* lli - use ddo_id to retrieve nym

Signed-off-by: lli <lli@anonyome.com>

* Merge Conflicts

Signed-off-by: lli <lli@anonyome.com>

* Merge Conflicts

Signed-off-by: lli <lli@anonyome.com>

* Fixing Test

Signed-off-by: lli <lli@anonyome.com>

* formatting

Signed-off-by: lli <lli@anonyome.com>

* Fix tests

Signed-off-by: lli <lli@anonyome.com>

* Clippy

Signed-off-by: lli <lli@anonyome.com>

* Fix Endpoint Test

Signed-off-by: lli <lli@anonyome.com>

* Remove print

Signed-off-by: lli <lli@anonyome.com>

* Log response error

Signed-off-by: lli <lli@anonyome.com>

---------

Signed-off-by: lli <lli@anonyome.com>
alberto-instnt pushed a commit to instnt-inc/instnt-aries-vcx that referenced this issue Sep 10, 2024
…t a service/endpoint and expands shorthand verkey notation for publicKeyBase58 (hyperledger#1105)

* lli - Added Solution/Tests

Signed-off-by: lli <lli@anonyome.com>

* lli - merge issue 1090

Signed-off-by: lli <lli@anonyome.com>

* lli - Add Resolution Test back

Signed-off-by: lli <lli@anonyome.com>

* lli - Clippy fixes

Signed-off-by: lli <lli@anonyome.com>

* lli - Clippy fixes

Signed-off-by: lli <lli@anonyome.com>

* lli - Clippy fixes

Signed-off-by: lli <lli@anonyome.com>

* lli - Clippy fixes

Signed-off-by: lli <lli@anonyome.com>

* lli - Clippy fixes

Signed-off-by: lli <lli@anonyome.com>

* lli - Fix Expanding Verkey Fn

Signed-off-by: lli <lli@anonyome.com>

* lli - Fix unwrapping err

Signed-off-by: lli <lli@anonyome.com>

* lli - Remove unwraps

Signed-off-by: lli <lli@anonyome.com>

* lli - use ddo_id to retrieve nym

Signed-off-by: lli <lli@anonyome.com>

* Merge Conflicts

Signed-off-by: lli <lli@anonyome.com>

* Merge Conflicts

Signed-off-by: lli <lli@anonyome.com>

* Fixing Test

Signed-off-by: lli <lli@anonyome.com>

* formatting

Signed-off-by: lli <lli@anonyome.com>

* Fix tests

Signed-off-by: lli <lli@anonyome.com>

* Clippy

Signed-off-by: lli <lli@anonyome.com>

* Fix Endpoint Test

Signed-off-by: lli <lli@anonyome.com>

* Remove print

Signed-off-by: lli <lli@anonyome.com>

* Log response error

Signed-off-by: lli <lli@anonyome.com>

---------

Signed-off-by: lli <lli@anonyome.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment