Skip to content

Commit 723f68c

Browse files
committed
✨ 0.9.0: new post methods at /wallet/jwt/sign and /wallet/jwt/verify, with descriptions, respectively:
- Create a EdDSA jws using did keys with a given payload - Verify a EdDSA jws using did keys with a given JWS
1 parent c6adb30 commit 723f68c

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

aries_cloudcontroller/api/wallet.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
from aries_cloudcontroller.model.did_endpoint_with_type import DIDEndpointWithType
2323
from aries_cloudcontroller.model.did_list import DIDList
2424
from aries_cloudcontroller.model.did_result import DIDResult
25+
from aries_cloudcontroller.model.jws_create import JWSCreate
26+
from aries_cloudcontroller.model.jws_verify import JWSVerify
27+
from aries_cloudcontroller.model.jws_verify_response import JWSVerifyResponse
2528

2629

2730
class WalletApi(Consumer):
@@ -99,6 +102,26 @@ async def set_public_did(
99102
mediation_id=mediation_id,
100103
)
101104

105+
async def wallet_jwt_sign_post(
106+
self, *, body: Optional[JWSCreate] = None
107+
) -> Dict[str, Any]:
108+
"""Create a EdDSA jws using did keys with a given payload"""
109+
if not body:
110+
body = JWSCreate()
111+
return await self.__wallet_jwt_sign_post(
112+
body=body,
113+
)
114+
115+
async def wallet_jwt_verify_post(
116+
self, *, body: Optional[JWSVerify] = None
117+
) -> JWSVerifyResponse:
118+
"""Verify a EdDSA jws using did keys with a given JWS"""
119+
if not body:
120+
body = JWSVerify()
121+
return await self.__wallet_jwt_verify_post(
122+
body=body,
123+
)
124+
102125
@returns.json
103126
@json
104127
@post("/wallet/did/create")
@@ -156,3 +179,19 @@ def __set_public_did(
156179
mediation_id: Query = None
157180
) -> DIDResult:
158181
"""Internal uplink method for set_public_did"""
182+
183+
@returns.json
184+
@json
185+
@post("/wallet/jwt/sign")
186+
def __wallet_jwt_sign_post(
187+
self, *, body: Body(type=JWSCreate) = {}
188+
) -> Dict[str, Any]:
189+
"""Internal uplink method for wallet_jwt_sign_post"""
190+
191+
@returns.json
192+
@json
193+
@post("/wallet/jwt/verify")
194+
def __wallet_jwt_verify_post(
195+
self, *, body: Body(type=JWSVerify) = {}
196+
) -> JWSVerifyResponse:
197+
"""Internal uplink method for wallet_jwt_verify_post"""

0 commit comments

Comments
 (0)