Skip to content

Commit

Permalink
feat(prism-agent): upgrade castor version with DID serviceEndpoint (#229
Browse files Browse the repository at this point in the history
)

* feat(prism-agent): update castor enabling service in DID operation

* feat(prism-agent): upgrade castor to 0.5.0

* docs: update more accurate OAS example
  • Loading branch information
patlo-iog authored Dec 12, 2022
1 parent 8cadd0a commit 0ba3b89
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
12 changes: 7 additions & 5 deletions prism-agent/service/api/http/castor/schemas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ components:
id:
type: string
description: Identifier of a verification material in the DID Document
example: key-01
example: key1
purpose:
type: string
enum:
Expand All @@ -118,7 +118,7 @@ components:
"capabilityInvocation",
"capabilityDelegation",
]
example: [ "authentication", "assertionMethod" ]
example: "authentication"
services:
type: array
items:
Expand Down Expand Up @@ -245,15 +245,17 @@ components:
properties:
id:
type: string
example: "did:prism:123#edv"
example: "service1"
type:
type: string
enum:
- MediatorService
example: MediatorService
serviceEndpoint:
type: string
example: "https://bar.example.com"
type: array
items:
type: string
example: "https://bar.example.com"

UpdatePatch:
type: object
Expand Down
2 changes: 1 addition & 1 deletion prism-agent/service/project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ object Dependencies {
val zioInteropCats = "3.3.0" // scala-steward:off
val akka = "2.6.20"
val akkaHttp = "10.2.9"
val castor = "0.4.1"
val castor = "0.5.0"
val pollux = "0.7.0"
val connect = "0.3.1"
val bouncyCastle = "1.70"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ trait OASDomainModelHelper {
extension (service: Service) {
def toDomain: Either[String, castorDomain.Service] = {
for {
serviceEndpoint <- Try(URI.create(service.serviceEndpoint)).toEither.left.map(_ =>
s"unable to parse serviceEndpoint ${service.serviceEndpoint} as URI"
serviceEndpoint <- service.serviceEndpoint.traverse(s =>
Try(URI.create(s)).toEither.left.map(_ => s"unable to parse serviceEndpoint $s as URI")
)
serviceType <- castorDomain.ServiceType
.parseString(service.`type`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ object ManagedDIDTemplateValidatorSpec extends ZIOSpecDefault {
Service(
id = "service0",
`type` = ServiceType.MediatorService,
serviceEndpoint = URI.create("http://example.com")
serviceEndpoint = Seq(URI.create("http://example.com"))
)
)
)
Expand Down

0 comments on commit 0ba3b89

Please sign in to comment.