Skip to content

Commit

Permalink
feat: create SDJWSCreateSchema
Browse files Browse the repository at this point in the history
Signed-off-by: Char Howland <char@indicio.tech>
  • Loading branch information
cjhowland committed Aug 16, 2023
1 parent 0420c4f commit 7a7f2ae
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions aries_cloudagent/wallet/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@ class JWSCreateSchema(OpenAPISchema):
)


class SDJWSCreateSchema(JWSCreateSchema):
"""Request schema to create an sd-jws with a particular DID."""

sd_list = fields.List()


class JWSVerifySchema(OpenAPISchema):
"""Request schema to verify a jws created from a DID."""

Expand Down Expand Up @@ -951,7 +957,7 @@ async def wallet_jwt_sign(request: web.BaseRequest):
@docs(
tags=["wallet"], summary="Create a EdDSA sd-jws using did keys with a given payload"
)
@request_schema(JWSCreateSchema) # check
@request_schema(SDJWSCreateSchema)
@response_schema(WalletModuleResponseSchema(), description="")
async def wallet_sd_jwt_sign(request: web.BaseRequest):
"""
Expand All @@ -970,10 +976,11 @@ async def wallet_sd_jwt_sign(request: web.BaseRequest):
verification_method = body.get("verificationMethod")
headers = body.get("headers", {})
payload = body.get("payload", {})
sd_list = body.get("sd)list", [])

try:
sd_jws = await sd_jwt_sign(
context.profile, headers, payload, did, verification_method
context.profile, headers, payload, sd_list, did, verification_method
)
except ValueError as err:
raise web.HTTPBadRequest(reason="Bad did or verification method") from err
Expand Down

0 comments on commit 7a7f2ae

Please sign in to comment.