Skip to content

Commit

Permalink
* clarity: Added a note regarding serviceEndpoint Id's being a URI vs…
Browse files Browse the repository at this point in the history
… a IRI (SSI Crate limitation)

  * This changes serviceEndpoint.id from `#service` to `did:peer:#service` so that it passes Uri checks
* fix: If more than a single service was specified, then this would crash due to `#service-n` not being a valid URI
  * Changed so that all serviceEndpoint Id's are `did:peer:#service` as the starting string
* update: `tokio-tungstenite` crate updated from 0.23 to 0.24
  • Loading branch information
stormer78 committed Sep 15, 2024
1 parent 9d951fa commit f937901
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 37 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

## Changelog history

### 15th September 2024 (release 0.1.9)

* clarity: Added a note regarding serviceEndpoint Id's being a URI vs a IRI (SSI Crate limitation)
* This changes serviceEndpoint.id from `#service` to `did:peer:#service` so that it passes Uri checks
* fix: If more than a single service was specified, then this would crash due to `#service-n` not being a valid URI
* Changed so that all serviceEndpoint Id's are `did:peer:#service` as the starting string
* update: `tokio-tungstenite` crate updated from 0.23 to 0.24

### 9th September 2024 (release 0.1.5)

* Renaming crate names
Expand Down
68 changes: 34 additions & 34 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ members = [
resolver = "2"

[workspace.package]
version = "0.1.8"
version = "0.1.9"
edition = "2021"
authors = ["Glenn Gore <[email protected]>"]
description = "Affinidi DID Resolver"
Expand Down Expand Up @@ -47,7 +47,7 @@ tower-http = { version = "0.5", features = ["cors", "trace"] }

# Cache Client (SDK)
futures-util = "0.3"
tokio-tungstenite = { version = "0.23", features = ["native-tls"] }
tokio-tungstenite = { version = "0.24", features = ["native-tls"] }
rayon = "1.10"
num-format = "0.4.4"
clap = { version = "4.5", features = ["derive"] }
Expand Down
2 changes: 2 additions & 0 deletions affinidi-did-resolver-methods/did-peer/CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Affinidi DID-Peer ChangeLog

## See affinidi-did_resolver CHANGELOG

## Release 0.4.1 - 5th September 2024

- Added Purpose Codes for did:peer:2
Expand Down
5 changes: 5 additions & 0 deletions affinidi-did-resolver-methods/did-peer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

Only supports did:peer numalgo 0,2 (did:peer:0, did:peer:2)

NOTE:
serviceEndpoint.id should be an IRI (e.g. `#service`).
Due to a limitation of the SSI Crate Document type, we must use a URI.
Instead of `#service` we resolve to `did:peer:#service`

## Build a WebAssembly package

**Prerequisite:** [wasm-pack](https://rustwasm.github.io/wasm-pack/installer/)
Expand Down
8 changes: 7 additions & 1 deletion affinidi-did-resolver-methods/did-peer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ impl From<DIDPeerService> for Service {
let id = if let Some(id) = service.id {
UriBuf::new(id.into()).unwrap()
} else {
// TODO: Should be #service
// SSI Crate expects a URI for the service ID
UriBuf::new("did:peer:#service".into()).unwrap()
};

Expand Down Expand Up @@ -454,8 +456,12 @@ impl DIDMethodResolver for DIDPeer {

let mut service: Service = service.into();
if service_count > 0 {
// TODO: Should be #service-1, #service-2, etc
// SSI Crate expects a URI for the service ID
service.id = UriBuf::new(
["#service-", &service_count.to_string()].concat().into(),
["did:peer:#service-", &service_count.to_string()]
.concat()
.into(),
)
.unwrap();
}
Expand Down

0 comments on commit f937901

Please sign in to comment.