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

feat(prism-agent): upgrade castor version with DID serviceEndpoint #229

Merged
merged 3 commits into from
Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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