Skip to content

Commit

Permalink
fix: did url string parsing correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
goncalo-frade-iohk committed Sep 1, 2023
1 parent 4fe5917 commit 93a3eb4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion AtalaPrismSDK/Domain/Sources/Models/DIDUrl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public struct DIDUrl {

/// A string representation of the path component of this `DIDUrl`.
private var pathString: String {
"/" + path.joined(separator: "/")
path.isEmpty ? "" : "/" + path.joined(separator: "/")
}

/// A string representation of the parameters component of this `DIDUrl`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ extension DidDoc {
id: $0.id.string,
type: .jsonWebKey2020,
controller: $0.controller.string,
verificationMaterial: .jwk(publicKeyJwk: jsonKeys)
verificationMaterial: .jwk(value: jsonKeys)
)
}

Expand All @@ -93,9 +93,9 @@ extension DidDoc {
return service.serviceEndpoint.first.map {
Service(
id: service.id,
serviceEndpoint: .didCommMessaging(
kind: .didCommMessaging(
value: .init(
uri: $0.uri,
serviceEndpoint: $0.uri,
accept: $0.accept,
routingKeys: $0.routingKeys
)
Expand All @@ -106,17 +106,17 @@ extension DidDoc {
return service.serviceEndpoint.first.map {
Service(
id: service.id,
serviceEndpoint: .other(value: $0.uri)
kind: .other(value: $0.uri)
)
}
}
}
self.init(
id: did,
keyAgreement: keyAgreements,
authentication: authentications,
verificationMethod: verificationMethods,
service: services
did: did,
keyAgreements: keyAgreements,
authentications: authentications,
verificationMethods: verificationMethods,
services: services
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ extension DIDCommxSwift.Secret {

switch from.secretMaterial {
case let .jwk(value):
material = .jwk(privateKeyJwk: value)
material = .jwk(value: value)
}
self.init(
id: from.id,
Expand Down

0 comments on commit 93a3eb4

Please sign in to comment.