Skip to content

Commit 19cb9bf

Browse files
authored
Merge pull request #95 from didx-xyz/feat/0.9.0
Upgrade client with 0.9.0 spec
2 parents a931228 + 006aadc commit 19cb9bf

25 files changed

+427
-24
lines changed

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.8.10
1+
3.9.17

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,15 @@ Each Cloud Controller version maps to a specific ACA-Py version, which is outlin
4848
| 0.7.0 | 0.7.5 |
4949
| 0.8.0 | 0.8.0 |
5050
| 0.8.1 | 0.8.1 |
51+
| 0.8.2 | 0.8.2 |
52+
| 0.9.0 | 0.9.0 |
5153

5254
## Features
5355

5456
Aries Cloud Controller Python is a fully featured client for interacting with ACA-Py.
5557

5658
- Fully Typed wrapper around Aries Cloud Agent Python
57-
- Supports latest ACA-Py version (0.8.1)
59+
- Supports latest ACA-Py version (0.9.0)
5860
- Client is auto generated based on OpenAPI definitions, allowing us to keep up to date with new releases.
5961
- Supports multi-tenant APIs and authentication
6062
- Async API

aries_cloudcontroller/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@
152152
InvitationResult,
153153
IssuerCredRevRecord,
154154
IssuerRevRegRecord,
155+
JWSCreate,
156+
JWSVerify,
157+
JWSVerifyResponse,
155158
Keylist,
156159
KeylistQuery,
157160
KeylistQueryFilterRequest,
@@ -428,6 +431,9 @@
428431
"InvitationResult",
429432
"IssuerCredRevRecord",
430433
"IssuerRevRegRecord",
434+
"JWSCreate",
435+
"JWSVerify",
436+
"JWSVerifyResponse",
431437
"Keylist",
432438
"KeylistQuery",
433439
"KeylistQueryFilterRequest",

aries_cloudcontroller/api/did_exchange.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ async def create_request(
5555
*,
5656
their_public_did: str,
5757
alias: Optional[str] = None,
58+
goal: Optional[str] = None,
59+
goal_code: Optional[str] = None,
5860
mediation_id: Optional[str] = None,
5961
my_endpoint: Optional[str] = None,
6062
my_label: Optional[str] = None,
@@ -64,6 +66,8 @@ async def create_request(
6466
return await self.__create_request(
6567
their_public_did=their_public_did,
6668
alias=alias,
69+
goal=goal,
70+
goal_code=goal_code,
6771
mediation_id=mediation_id,
6872
my_endpoint=my_endpoint,
6973
my_label=my_label,
@@ -111,6 +115,8 @@ def __create_request(
111115
*,
112116
their_public_did: Query,
113117
alias: Query = None,
118+
goal: Query = None,
119+
goal_code: Query = None,
114120
mediation_id: Query = None,
115121
my_endpoint: Query = None,
116122
my_label: Query = None,

aries_cloudcontroller/api/revocation.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,14 @@ async def publish_revocations(
156156
body=body,
157157
)
158158

159+
async def revocation_active_registry_cred_def_id_rotate_post(
160+
self, *, cred_def_id: str
161+
) -> RevRegsCreated:
162+
"""Rotate revocation registry"""
163+
return await self.__revocation_active_registry_cred_def_id_rotate_post(
164+
cred_def_id=cred_def_id,
165+
)
166+
159167
async def revocation_registry_delete_tails_file_delete(
160168
self, *, cred_def_id: Optional[str] = None, rev_reg_id: Optional[str] = None
161169
) -> TailsDeleteResponse:
@@ -311,6 +319,13 @@ def __publish_revocations(
311319
) -> TxnOrPublishRevocationsResult:
312320
"""Internal uplink method for publish_revocations"""
313321

322+
@returns.json
323+
@post("/revocation/active-registry/{cred_def_id}/rotate")
324+
def __revocation_active_registry_cred_def_id_rotate_post(
325+
self, *, cred_def_id: str
326+
) -> RevRegsCreated:
327+
"""Internal uplink method for revocation_active_registry_cred_def_id_rotate_post"""
328+
314329
@returns.json
315330
@delete("/revocation/registry/delete-tails-file")
316331
def __revocation_registry_delete_tails_file_delete(

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"""

aries_cloudcontroller/model/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@
185185
from aries_cloudcontroller.model.invitation_result import InvitationResult
186186
from aries_cloudcontroller.model.issuer_cred_rev_record import IssuerCredRevRecord
187187
from aries_cloudcontroller.model.issuer_rev_reg_record import IssuerRevRegRecord
188+
from aries_cloudcontroller.model.jws_create import JWSCreate
189+
from aries_cloudcontroller.model.jws_verify import JWSVerify
190+
from aries_cloudcontroller.model.jws_verify_response import JWSVerifyResponse
188191
from aries_cloudcontroller.model.keylist import Keylist
189192
from aries_cloudcontroller.model.keylist_query import KeylistQuery
190193
from aries_cloudcontroller.model.keylist_query_filter_request import (
@@ -547,6 +550,9 @@
547550
"InvitationResult",
548551
"IssuerCredRevRecord",
549552
"IssuerRevRegRecord",
553+
"JWSCreate",
554+
"JWSVerify",
555+
"JWSVerifyResponse",
550556
"Keylist",
551557
"KeylistQuery",
552558
"KeylistQueryFilterRequest",

aries_cloudcontroller/model/connection_invitation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def did_pattern(cls, value):
4141
if value is None:
4242
return
4343

44-
pattern = r"^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$"
44+
pattern = r"^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$|^did:([a-zA-Z0-9_]+):([a-zA-Z0-9_.%-]+(:[a-zA-Z0-9_.%-]+)*)((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(\\/[^#?]*)?([?][^#]*)?(\#.*)?$$"
4545
if not re.match(pattern, value):
4646
raise ValueError(f"Value of did does not match regex pattern ('{pattern}')")
4747
return value

aries_cloudcontroller/model/did_create.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class DIDCreate(BaseModel):
2222
seed: Optional seed to use for DID, Must beenabled in configuration before use. [Optional].
2323
"""
2424

25-
method: Optional[Literal["key", "sov"]] = None
25+
method: Optional[str] = None
2626
options: Optional[DIDCreateOptions] = None
2727
seed: Optional[str] = None
2828

aries_cloudcontroller/model/didx_request.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,17 @@ class DIDXRequest(BaseModel):
2222
type: Message type [Optional].
2323
did: DID of exchange [Optional].
2424
did_docattach: As signed attachment, DID Doc associated with DID [Optional].
25+
goal: A self-attested string that the receiver may want to display to the user about the context-specific goal of the out-of-band message [Optional].
26+
goal_code: A self-attested code the receiver may want to display to the user or use in automatically deciding what to do with the out-of-band message [Optional].
2527
"""
2628

2729
label: str
2830
id: Optional[str] = Field(None, alias="@id")
2931
type: Optional[str] = Field(None, alias="@type")
3032
did: Optional[str] = None
3133
did_docattach: Optional[AttachDecorator] = Field(None, alias="did_doc~attach")
34+
goal: Optional[str] = None
35+
goal_code: Optional[str] = None
3236

3337
@validator("did")
3438
def did_pattern(cls, value):

0 commit comments

Comments
 (0)