Skip to content

Commit

Permalink
Merge pull request #91 from didx-xyz/chore/update-080-acapy
Browse files Browse the repository at this point in the history
Upgrade to v0.8.0 ACA-Py spec
  • Loading branch information
lohanspies authored May 26, 2023
2 parents 7450bce + 79a1608 commit 0e8c2b9
Show file tree
Hide file tree
Showing 319 changed files with 1,077 additions and 4,902 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@ Each Cloud Controller version maps to a specific ACA-Py version, which is outlin
| 0.5.1-0.5.2 | 0.7.3 |
| 0.6.0-0.6.3 | 0.7.4 |
| 0.7.0 | 0.7.5 |
| 0.8.0 | 0.8.0 |

## Features

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

- Fully Typed wrapper around Aries Cloud Agent Python
- Supports latest ACA-Py version (0.7.5)
- Supports latest ACA-Py version (0.8.0)
- Client is auto generated based on OpenAPI definitions, allowing us to keep up to date with new releases.
- Supports multi-tenant APIs and authentication
- Async API
Expand Down
10 changes: 8 additions & 2 deletions aries_cloudcontroller/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
MediationCreateRequest,
MediationDeny,
MediationGrant,
MediationIdMatchInfo,
MediationList,
MediationRecord,
Menu,
Expand All @@ -174,6 +175,7 @@
MenuJson,
MenuOption,
ModelSchema,
OobRecord,
PerformRequest,
PingRequest,
PingRequestResponse,
Expand Down Expand Up @@ -205,6 +207,7 @@
SchemasInputDescriptorFilter,
SendMenu,
SendMessage,
ServiceDecorator,
SignRequest,
SignResponse,
SignatureOptions,
Expand All @@ -215,6 +218,7 @@
TAAInfo,
TAARecord,
TAAResult,
TailsDeleteResponse,
TransactionJobs,
TransactionList,
TransactionRecord,
Expand All @@ -236,7 +240,6 @@
V10CredentialProposalRequestOpt,
V10CredentialStoreRequest,
V10DiscoveryExchangeListResult,
V10DiscoveryExchangeResult,
V10DiscoveryRecord,
V10PresentationCreateRequestRequest,
V10PresentationExchange,
Expand Down Expand Up @@ -437,6 +440,7 @@
"MediationCreateRequest",
"MediationDeny",
"MediationGrant",
"MediationIdMatchInfo",
"MediationList",
"MediationRecord",
"Menu",
Expand All @@ -445,6 +449,7 @@
"MenuJson",
"MenuOption",
"ModelSchema",
"OobRecord",
"PerformRequest",
"PingRequest",
"PingRequestResponse",
Expand Down Expand Up @@ -476,6 +481,7 @@
"SchemasInputDescriptorFilter",
"SendMenu",
"SendMessage",
"ServiceDecorator",
"SignRequest",
"SignResponse",
"SignatureOptions",
Expand All @@ -486,6 +492,7 @@
"TAAInfo",
"TAARecord",
"TAAResult",
"TailsDeleteResponse",
"TransactionJobs",
"TransactionList",
"TransactionRecord",
Expand All @@ -507,7 +514,6 @@
"V10CredentialProposalRequestOpt",
"V10CredentialStoreRequest",
"V10DiscoveryExchangeListResult",
"V10DiscoveryExchangeResult",
"V10DiscoveryRecord",
"V10PresentationCreateRequestRequest",
"V10PresentationExchange",
Expand Down
1 change: 0 additions & 1 deletion aries_cloudcontroller/acapy_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ def __init__(
admin_insecure: Optional[bool] = False,
tenant_jwt: Optional[str] = None,
):

if not api_key and not admin_insecure:
raise Exception(
"api_key property is missing. Use admin_insecure=True if you want"
Expand Down
22 changes: 13 additions & 9 deletions aries_cloudcontroller/api/action_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
json,
)

from typing import Dict, List, Optional, Union # noqa: F401
from typing import Any, Dict, List, Optional, Union # noqa: F401

from aries_cloudcontroller.uplink_util import bool_query

Expand All @@ -23,7 +23,7 @@


class ActionMenuApi(Consumer):
async def close_active_menu(self, *, conn_id: str) -> Dict:
async def close_active_menu(self, *, conn_id: str) -> Dict[str, Any]:
"""Close the active menu associated with a connection"""
return await self.__close_active_menu(
conn_id=conn_id,
Expand All @@ -37,20 +37,22 @@ async def fetch_active_menu(self, *, conn_id: str) -> ActionMenuFetchResult:

async def perform_action(
self, *, conn_id: str, body: Optional[PerformRequest] = None
) -> Dict:
) -> Dict[str, Any]:
"""Perform an action associated with the active menu"""
return await self.__perform_action(
conn_id=conn_id,
body=body,
)

async def request_active_menu(self, *, conn_id: str) -> Dict:
async def request_active_menu(self, *, conn_id: str) -> Dict[str, Any]:
"""Request the active menu"""
return await self.__request_active_menu(
conn_id=conn_id,
)

async def send_menu(self, *, conn_id: str, body: Optional[SendMenu] = None) -> Dict:
async def send_menu(
self, *, conn_id: str, body: Optional[SendMenu] = None
) -> Dict[str, Any]:
"""Send an action menu to a connection"""
return await self.__send_menu(
conn_id=conn_id,
Expand All @@ -59,7 +61,7 @@ async def send_menu(self, *, conn_id: str, body: Optional[SendMenu] = None) -> D

@returns.json
@post("/action-menu/{conn_id}/close")
def __close_active_menu(self, *, conn_id: str) -> Dict:
def __close_active_menu(self, *, conn_id: str) -> Dict[str, Any]:
"""Internal uplink method for close_active_menu"""

@returns.json
Expand All @@ -72,16 +74,18 @@ def __fetch_active_menu(self, *, conn_id: str) -> ActionMenuFetchResult:
@post("/action-menu/{conn_id}/perform")
def __perform_action(
self, *, conn_id: str, body: Body(type=PerformRequest) = {}
) -> Dict:
) -> Dict[str, Any]:
"""Internal uplink method for perform_action"""

@returns.json
@post("/action-menu/{conn_id}/request")
def __request_active_menu(self, *, conn_id: str) -> Dict:
def __request_active_menu(self, *, conn_id: str) -> Dict[str, Any]:
"""Internal uplink method for request_active_menu"""

@returns.json
@json
@post("/action-menu/{conn_id}/send-menu")
def __send_menu(self, *, conn_id: str, body: Body(type=SendMenu) = {}) -> Dict:
def __send_menu(
self, *, conn_id: str, body: Body(type=SendMenu) = {}
) -> Dict[str, Any]:
"""Internal uplink method for send_menu"""
6 changes: 3 additions & 3 deletions aries_cloudcontroller/api/basicmessage.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
json,
)

from typing import Dict, List, Optional, Union # noqa: F401
from typing import Any, Dict, List, Optional, Union # noqa: F401

from aries_cloudcontroller.uplink_util import bool_query

Expand All @@ -23,7 +23,7 @@
class BasicmessageApi(Consumer):
async def send_message(
self, *, conn_id: str, body: Optional[SendMessage] = None
) -> Dict:
) -> Dict[str, Any]:
"""Send a basic message to a connection"""
return await self.__send_message(
conn_id=conn_id,
Expand All @@ -35,5 +35,5 @@ async def send_message(
@post("/connections/{conn_id}/send-message")
def __send_message(
self, *, conn_id: str, body: Body(type=SendMessage) = {}
) -> Dict:
) -> Dict[str, Any]:
"""Internal uplink method for send_message"""
10 changes: 5 additions & 5 deletions aries_cloudcontroller/api/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
json,
)

from typing import Dict, List, Optional, Union # noqa: F401
from typing import Any, Dict, List, Optional, Union # noqa: F401

from aries_cloudcontroller.uplink_util import bool_query

Expand Down Expand Up @@ -89,13 +89,13 @@ async def create_static_connection(
body=body,
)

async def delete_connection(self, *, conn_id: str) -> Dict:
async def delete_connection(self, *, conn_id: str) -> Dict[str, Any]:
"""Remove an existing connection record"""
return await self.__delete_connection(
conn_id=conn_id,
)

async def establish_inbound(self, *, conn_id: str, ref_id: str) -> Dict:
async def establish_inbound(self, *, conn_id: str, ref_id: str) -> Dict[str, Any]:
"""Assign another connection as the inbound connection"""
return await self.__establish_inbound(
conn_id=conn_id,
Expand Down Expand Up @@ -217,12 +217,12 @@ def __create_static_connection(

@returns.json
@delete("/connections/{conn_id}")
def __delete_connection(self, *, conn_id: str) -> Dict:
def __delete_connection(self, *, conn_id: str) -> Dict[str, Any]:
"""Internal uplink method for delete_connection"""

@returns.json
@post("/connections/{conn_id}/establish-inbound/{ref_id}")
def __establish_inbound(self, *, conn_id: str, ref_id: str) -> Dict:
def __establish_inbound(self, *, conn_id: str, ref_id: str) -> Dict[str, Any]:
"""Internal uplink method for establish_inbound"""

@returns.json
Expand Down
9 changes: 3 additions & 6 deletions aries_cloudcontroller/api/credential_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
json,
)

from typing import Dict, List, Optional, Union # noqa: F401
from typing import Any, Dict, List, Optional, Union # noqa: F401

from aries_cloudcontroller.uplink_util import bool_query

Expand All @@ -23,9 +23,6 @@
from aries_cloudcontroller.model.credential_definition_send_request import (
CredentialDefinitionSendRequest,
)
from aries_cloudcontroller.model.credential_definition_send_result import (
CredentialDefinitionSendResult,
)
from aries_cloudcontroller.model.credential_definitions_created_result import (
CredentialDefinitionsCreatedResult,
)
Expand Down Expand Up @@ -75,7 +72,7 @@ async def publish_cred_def(
conn_id: Optional[str] = None,
create_transaction_for_endorser: Optional[bool] = None,
body: Optional[CredentialDefinitionSendRequest] = None
) -> Union[CredentialDefinitionSendResult, TxnOrCredentialDefinitionSendResult]:
) -> TxnOrCredentialDefinitionSendResult:
"""Sends a credential definition to the ledger"""
return await self.__publish_cred_def(
conn_id=conn_id,
Expand Down Expand Up @@ -118,5 +115,5 @@ def __publish_cred_def(
conn_id: Query = None,
create_transaction_for_endorser: Query = None,
body: Body(type=CredentialDefinitionSendRequest) = {}
) -> Union[CredentialDefinitionSendResult, TxnOrCredentialDefinitionSendResult]:
) -> TxnOrCredentialDefinitionSendResult:
"""Internal uplink method for publish_cred_def"""
10 changes: 5 additions & 5 deletions aries_cloudcontroller/api/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
json,
)

from typing import Dict, List, Optional, Union # noqa: F401
from typing import Any, Dict, List, Optional, Union # noqa: F401

from aries_cloudcontroller.uplink_util import bool_query

Expand All @@ -31,13 +31,13 @@


class CredentialsApi(Consumer):
async def delete_record(self, *, credential_id: str) -> Dict:
async def delete_record(self, *, credential_id: str) -> Dict[str, Any]:
"""Remove credential from wallet by id"""
return await self.__delete_record(
credential_id=credential_id,
)

async def delete_w3c_credential(self, *, credential_id: str) -> Dict:
async def delete_w3c_credential(self, *, credential_id: str) -> Dict[str, Any]:
"""Remove W3C credential from wallet by id"""
return await self.__delete_w3c_credential(
credential_id=credential_id,
Expand Down Expand Up @@ -109,12 +109,12 @@ async def get_w3c_credentials(

@returns.json
@delete("/credential/{credential_id}")
def __delete_record(self, *, credential_id: str) -> Dict:
def __delete_record(self, *, credential_id: str) -> Dict[str, Any]:
"""Internal uplink method for delete_record"""

@returns.json
@delete("/credential/w3c/{credential_id}")
def __delete_w3c_credential(self, *, credential_id: str) -> Dict:
def __delete_w3c_credential(self, *, credential_id: str) -> Dict[str, Any]:
"""Internal uplink method for delete_w3c_credential"""

@returns.json
Expand Down
2 changes: 1 addition & 1 deletion aries_cloudcontroller/api/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
json,
)

from typing import Dict, List, Optional, Union # noqa: F401
from typing import Any, Dict, List, Optional, Union # noqa: F401

from aries_cloudcontroller.uplink_util import bool_query

Expand Down
2 changes: 1 addition & 1 deletion aries_cloudcontroller/api/did_exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
json,
)

from typing import Dict, List, Optional, Union # noqa: F401
from typing import Any, Dict, List, Optional, Union # noqa: F401

from aries_cloudcontroller.uplink_util import bool_query

Expand Down
10 changes: 4 additions & 6 deletions aries_cloudcontroller/api/discover_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,14 @@
json,
)

from typing import Dict, List, Optional, Union # noqa: F401
from typing import Any, Dict, List, Optional, Union # noqa: F401

from aries_cloudcontroller.uplink_util import bool_query

from aries_cloudcontroller.model.v10_discovery_exchange_list_result import (
V10DiscoveryExchangeListResult,
)
from aries_cloudcontroller.model.v10_discovery_exchange_result import (
V10DiscoveryExchangeResult,
)
from aries_cloudcontroller.model.v10_discovery_record import V10DiscoveryRecord


class DiscoverFeaturesApi(Consumer):
Expand All @@ -32,7 +30,7 @@ async def discover_features_query_get(
comment: Optional[str] = None,
connection_id: Optional[str] = None,
query: Optional[str] = None
) -> V10DiscoveryExchangeResult:
) -> V10DiscoveryRecord:
"""Query supported features"""
return await self.__discover_features_query_get(
comment=comment,
Expand All @@ -52,7 +50,7 @@ async def discover_features_records_get(
@get("/discover-features/query")
def __discover_features_query_get(
self, *, comment: Query = None, connection_id: Query = None, query: Query = None
) -> V10DiscoveryExchangeResult:
) -> V10DiscoveryRecord:
"""Internal uplink method for discover_features_query_get"""

@returns.json
Expand Down
2 changes: 1 addition & 1 deletion aries_cloudcontroller/api/discover_features_v2_0.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
json,
)

from typing import Dict, List, Optional, Union # noqa: F401
from typing import Any, Dict, List, Optional, Union # noqa: F401

from aries_cloudcontroller.uplink_util import bool_query

Expand Down
2 changes: 1 addition & 1 deletion aries_cloudcontroller/api/endorse_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
json,
)

from typing import Dict, List, Optional, Union # noqa: F401
from typing import Any, Dict, List, Optional, Union # noqa: F401

from aries_cloudcontroller.uplink_util import bool_query

Expand Down
Loading

0 comments on commit 0e8c2b9

Please sign in to comment.