-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Pat Losoponkul <pat.losoponkul@iohk.io>
- Loading branch information
Pat Losoponkul
committed
Nov 9, 2023
1 parent
b92f5ec
commit 78f8f95
Showing
1 changed file
with
12 additions
and
1 deletion.
There are no files selected for viewing
13 changes: 12 additions & 1 deletion
13
...src/main/scala/io/iohk/atala/iam/wallet/http/model/CreateWalletUmaPermissionRequest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,29 @@ | ||
package io.iohk.atala.iam.wallet.http.model | ||
|
||
import io.iohk.atala.api.http.Annotation | ||
import sttp.tapir.* | ||
import sttp.tapir.Schema.annotations.{description, encodedExample, validate} | ||
import zio.json.{DeriveJsonDecoder, DeriveJsonEncoder, JsonDecoder, JsonEncoder} | ||
|
||
import java.util.UUID | ||
|
||
// TODO: annotate | ||
final case class CreateWalletUmaPermissionRequest( | ||
@description(CreateWalletUmaPermissionRequest.annotations.subject.description) | ||
@encodedExample(CreateWalletUmaPermissionRequest.annotations.subject.example) | ||
subject: UUID | ||
) | ||
|
||
object CreateWalletUmaPermissionRequest { | ||
given encoder: JsonEncoder[CreateWalletUmaPermissionRequest] = DeriveJsonEncoder.gen | ||
given decoder: JsonDecoder[CreateWalletUmaPermissionRequest] = DeriveJsonDecoder.gen | ||
given schema: Schema[CreateWalletUmaPermissionRequest] = Schema.derived | ||
|
||
object annotations { | ||
object subject | ||
extends Annotation[UUID]( | ||
description = | ||
"The subject ID that should be granted the permission to the wallet. This can be found in the `sub` claim of a JWT token.", | ||
example = UUID.fromString("00000000-0000-0000-0000-000000000000") | ||
) | ||
} | ||
} |