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

Add Service Endpoints to Cli Did Web and Dht #400

Merged
merged 2 commits into from
Oct 22, 2024
Merged

Conversation

nitro-neal
Copy link
Contributor

❯ web5 did create web https://www.banana.com --service-endpoint https://example.com --service-endpoint-type PFIService

This Hermit environment has already been activated. Skipping

Warning: This command may require root privileges to function properly.

{
  "uri": "did:web:www.banana.com",
  "document": {
    "id": "did:web:www.banana.com",
    "@context": [
      "https://www.w3.org/ns/did/v1"
    ],
    "verificationMethod": [
      {
        "id": "did:web:www.banana.com#key-0",
        "type": "JsonWebKey",
        "controller": "did:web:www.banana.com",
        "publicKeyJwk": {
          "alg": "Ed25519",
          "kty": "OKP",
          "crv": "Ed25519",
          "x": "ahoH14Z-g30d5qPTPK1-ZXAtuvRpBrhQxrTwWPuI6AM"
        }
      }
    ],
    "service": [
      {
        "id": "did:web:www.banana.com#service-1",
        "type": "PFIService",
        "serviceEndpoint": [
          "https://example.com"
        ]
      }
    ]
  },
  "privateKeys": [
    {
      "alg": "Ed25519",
      "kty": "OKP",
      "crv": "Ed25519",
      "d": "wANSgQCHr7mZmNBdfPE2TOFc-_F4Gqkx6inGfDHqhgU",
      "x": "ahoH14Z-g30d5qPTPK1-ZXAtuvRpBrhQxrTwWPuI6AM"
    }
  ]
}

Copy link

TBD Spec Test Vectors Report (web5-rs)

Total Test VectorsTotal Test Cases✅ Passed❌ Failed⚠️ Skipped
185500
ℹ️ 5 out of 18 test vectors passed successfully.

❌ Missing Vectors (13)

These are test vectors without any test cases.
FeatureName
Credentialscreate
CryptoEs256ksign
CryptoEs256kverify
DidDhtcreate
DidWebresolve
PortableDidparse
PresentationExchangecreate_presentation_from_credentials
PresentationExchangeevaluate_presentation
PresentationExchangeselect_credentials
PresentationExchangevalidate_definition
PresentationExchangevalidate_submission
VcJwtdecode
VcJwtverify

Automatically generated at: 2024-10-22T16:08:07.108Z

Copy link

TBD Spec Test Vectors Report (web5-core-kt)

Total Test VectorsTotal Test Cases✅ Passed❌ Failed⚠️ Skipped
183300
ℹ️ 3 out of 18 test vectors passed successfully.

❌ Missing Vectors (15)

These are test vectors without any test cases.
FeatureName
Credentialscreate
Credentialsverify
CryptoEs256ksign
CryptoEs256kverify
DidDhtcreate
DidDhtresolve
DidWebresolve
PortableDidparse
PresentationExchangecreate_presentation_from_credentials
PresentationExchangeevaluate_presentation
PresentationExchangeselect_credentials
PresentationExchangevalidate_definition
PresentationExchangevalidate_submission
VcJwtdecode
VcJwtverify

Automatically generated at: 2024-10-22T16:12:27.396Z

};

// Parse the domain to extract the host without the protocol
let domain_host = match Url::parse(domain) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe all of this domain validation already occurs internal to the DidWeb::create() function

let domain = &domain.to_string();

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup it does, but for the service endpoint id it needs to be a valid did web uri

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{
"id": "did:web:www.banana.com#service-1",
"type": "PFIService",
"serviceEndpoint": [
"https://example.com"
]
}

@nitro-neal nitro-neal merged commit fc8564f into main Oct 22, 2024
26 checks passed
@nitro-neal nitro-neal deleted the cli-service-endpoints branch October 22, 2024 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants