From 93a3eb4a5ddfedc46b2816e38a18f56fa5b551a7 Mon Sep 17 00:00:00 2001 From: goncalo-frade-iohk Date: Fri, 1 Sep 2023 16:13:55 +0100 Subject: [PATCH] fix: did url string parsing correctly --- .../Domain/Sources/Models/DIDUrl.swift | 2 +- .../DIDCommDIDResolverWrapper.swift | 18 +++++++++--------- .../DIDCommSecretsResolverWrapper.swift | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/AtalaPrismSDK/Domain/Sources/Models/DIDUrl.swift b/AtalaPrismSDK/Domain/Sources/Models/DIDUrl.swift index 3843b476..89818c10 100644 --- a/AtalaPrismSDK/Domain/Sources/Models/DIDUrl.swift +++ b/AtalaPrismSDK/Domain/Sources/Models/DIDUrl.swift @@ -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`. diff --git a/AtalaPrismSDK/Mercury/Sources/DIDCommWrappers/DIDCommDIDResolverWrapper.swift b/AtalaPrismSDK/Mercury/Sources/DIDCommWrappers/DIDCommDIDResolverWrapper.swift index 3a35445f..2bbd4b96 100644 --- a/AtalaPrismSDK/Mercury/Sources/DIDCommWrappers/DIDCommDIDResolverWrapper.swift +++ b/AtalaPrismSDK/Mercury/Sources/DIDCommWrappers/DIDCommDIDResolverWrapper.swift @@ -84,7 +84,7 @@ extension DidDoc { id: $0.id.string, type: .jsonWebKey2020, controller: $0.controller.string, - verificationMaterial: .jwk(publicKeyJwk: jsonKeys) + verificationMaterial: .jwk(value: jsonKeys) ) } @@ -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 ) @@ -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 ) } } diff --git a/AtalaPrismSDK/Mercury/Sources/DIDCommWrappers/DIDCommSecretsResolverWrapper.swift b/AtalaPrismSDK/Mercury/Sources/DIDCommWrappers/DIDCommSecretsResolverWrapper.swift index 6efa7e66..41e50b85 100644 --- a/AtalaPrismSDK/Mercury/Sources/DIDCommWrappers/DIDCommSecretsResolverWrapper.swift +++ b/AtalaPrismSDK/Mercury/Sources/DIDCommWrappers/DIDCommSecretsResolverWrapper.swift @@ -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,