Skip to content

Commit

Permalink
⬆️ Upgrade to latest ACA-Py nightly build (#178)
Browse files Browse the repository at this point in the history
* ⬆️ Upgrade anyio

* 0.12.2b0

* ✨ new field: additional_properties

* ✨ new cred filter: vc_di

* ✨ new api: AnoncredsWalletUpgradeApi

* ⚠️ "indy" wallet type no longer supported

* 🎨 modifies handling when `non_revoked is Null` in to_dict output

* 🎨 `domain` field isd no longer regex validated

* ✨ adds limit and offset for listing wallets

* ✨ adds limit and offset for listing wallets with group_id

* 🎨 remove duplicate get_wallets method, keeping only the one supporting group_id
  • Loading branch information
ff137 authored Jun 20, 2024
1 parent c816310 commit 5b8a53d
Show file tree
Hide file tree
Showing 28 changed files with 632 additions and 14,477 deletions.
4 changes: 3 additions & 1 deletion aries_cloudcontroller/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
""" # noqa: E501


__version__ = "0.12.1"
__version__ = "0.12.2b0"

from aries_cloudcontroller.acapy_client import AcaPyClient

Expand All @@ -24,6 +24,7 @@
AnoncredsCredentialDefinitionsApi,
AnoncredsRevocationApi,
AnoncredsSchemasApi,
AnoncredsWalletUpgradeApi,
BasicmessageApi,
ConnectionApi,
CredentialDefinitionApi,
Expand Down Expand Up @@ -366,6 +367,7 @@
V20CredFilter,
V20CredFilterIndy,
V20CredFilterLDProof,
V20CredFilterVCDI,
V20CredFormat,
V20CredIssue,
V20CredIssueProblemReportRequest,
Expand Down
3 changes: 3 additions & 0 deletions aries_cloudcontroller/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
)
from aries_cloudcontroller.api.anoncreds_revocation_api import AnoncredsRevocationApi
from aries_cloudcontroller.api.anoncreds_schemas_api import AnoncredsSchemasApi
from aries_cloudcontroller.api.anoncreds_wallet_upgrade_api import (
AnoncredsWalletUpgradeApi,
)
from aries_cloudcontroller.api.basicmessage_api import BasicmessageApi
from aries_cloudcontroller.api.connection_api import ConnectionApi
from aries_cloudcontroller.api.credential_definition_api import CredentialDefinitionApi
Expand Down
131 changes: 131 additions & 0 deletions aries_cloudcontroller/api/anoncreds_wallet_upgrade_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# coding: utf-8

"""
Aries Cloud Agent
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
The version of the OpenAPI document: v0.12.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501

from typing import Any, Dict, List, Optional, Tuple, Union

from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call
from typing_extensions import Annotated

from aries_cloudcontroller.api_client import ApiClient, RequestSerialized


class AnoncredsWalletUpgradeApi:
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""

def __init__(self, api_client=None) -> None:
if api_client is None:
api_client = ApiClient.get_default()
self.api_client = api_client

@validate_call
async def anoncreds_wallet_upgrade_post(
self,
wallet_name: Annotated[
StrictStr, Field(description="Name of wallet to upgrade to anoncreds")
],
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> object:
"""Upgrade the wallet from askar to anoncreds - Be very careful with this! You cannot go back! See migration guide for more information.
:param wallet_name: Name of wallet to upgrade to anoncreds (required)
:type wallet_name: str
...
""" # noqa: E501

_param = self._anoncreds_wallet_upgrade_post_serialize(
wallet_name=wallet_name,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index,
)

_response_types_map: Dict[str, Optional[str]] = {
"200": "object",
}
response_data = await self.api_client.call_api(
*_param, _request_timeout=_request_timeout
)
await response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
).data

def _anoncreds_wallet_upgrade_post_serialize(
self,
wallet_name,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:

_host = None

_collection_formats: Dict[str, str] = {}

_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_header_params: Dict[str, Optional[str]] = _headers or {}
_form_params: List[Tuple[str, str]] = []
_files: Dict[str, Union[str, bytes]] = {}
_body_params: Optional[bytes] = None

# process the path parameters
# process the query parameters
if wallet_name is not None:

_query_params.append(("wallet_name", wallet_name))

# process the header parameters
# process the form parameters
# process the body parameter

# set the HTTP header `Accept`
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)

# authentication setting
_auth_settings: List[str] = ["AuthorizationHeader"]

return self.api_client.param_serialize(
method="POST",
resource_path="/anoncreds/wallet/upgrade",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
_request_auth=_request_auth,
)
117 changes: 20 additions & 97 deletions aries_cloudcontroller/api/multitenancy_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,105 +471,12 @@ def _get_wallet_serialize(
@validate_call
async def get_wallets(
self,
wallet_name: Annotated[
Optional[StrictStr], Field(description="Wallet name")
limit: Annotated[
Optional[StrictInt], Field(description="Number of results to return")
] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
],
offset: Annotated[
Optional[StrictInt], Field(description="Offset for pagination")
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> WalletList:
"""Query subwallets
:param wallet_name: Wallet name
:type wallet_name: str
...
""" # noqa: E501

_param = self._get_wallets_serialize(
wallet_name=wallet_name,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index,
)

_response_types_map: Dict[str, Optional[str]] = {
"200": "WalletList",
}
response_data = await self.api_client.call_api(
*_param, _request_timeout=_request_timeout
)
await response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
).data

def _get_wallets_serialize(
self,
wallet_name,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:

_host = None

_collection_formats: Dict[str, str] = {}

_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_header_params: Dict[str, Optional[str]] = _headers or {}
_form_params: List[Tuple[str, str]] = []
_files: Dict[str, Union[str, bytes]] = {}
_body_params: Optional[bytes] = None

# process the path parameters
# process the query parameters
if wallet_name is not None:

_query_params.append(("wallet_name", wallet_name))

# process the header parameters
# process the form parameters
# process the body parameter

# set the HTTP header `Accept`
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)

# authentication setting
_auth_settings: List[str] = ["AuthorizationHeader"]

return self.api_client.param_serialize(
method="GET",
resource_path="/multitenancy/wallets",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
_request_auth=_request_auth,
)

@validate_call
async def get_wallets(
self,
wallet_name: Annotated[
Optional[StrictStr], Field(description="Wallet name")
] = None,
Expand All @@ -592,6 +499,10 @@ async def get_wallets(
"""Query subwallets
:param limit: Number of results to return
:type limit: int
:param offset: Offset for pagination
:type offset: int
:param wallet_name: Wallet name
:type wallet_name: str
:param group_id: Group id (additional field from ACA-Py plugin)
Expand All @@ -600,6 +511,8 @@ async def get_wallets(
""" # noqa: E501

_param = self._get_wallets_serialize(
limit=limit,
offset=offset,
wallet_name=wallet_name,
group_id=group_id,
_request_auth=_request_auth,
Expand All @@ -622,6 +535,8 @@ async def get_wallets(

def _get_wallets_serialize(
self,
limit,
offset,
wallet_name,
group_id,
_request_auth,
Expand All @@ -643,6 +558,14 @@ def _get_wallets_serialize(

# process the path parameters
# process the query parameters
if limit is not None:

_query_params.append(("limit", limit))

if offset is not None:

_query_params.append(("offset", offset))

if wallet_name is not None:

_query_params.append(("wallet_name", wallet_name))
Expand Down
2 changes: 1 addition & 1 deletion aries_cloudcontroller/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __init__(
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = "OpenAPI-Generator/0.12.1/python"
self.user_agent = "OpenAPI-Generator/0.12.2b0/python"
self.client_side_validation = configuration.client_side_validation

async def __aenter__(self):
Expand Down
2 changes: 1 addition & 1 deletion aries_cloudcontroller/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ def to_debug_report(self):
"OS: {env}\n"
"Python Version: {pyversion}\n"
"Version of the API: v0.12.1\n"
"SDK Package Version: 0.12.1".format(
"SDK Package Version: 0.12.2b0".format(
env=sys.platform, pyversion=sys.version
)
)
Expand Down
1 change: 1 addition & 0 deletions aries_cloudcontroller/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@
from aries_cloudcontroller.models.v20_cred_filter import V20CredFilter
from aries_cloudcontroller.models.v20_cred_filter_indy import V20CredFilterIndy
from aries_cloudcontroller.models.v20_cred_filter_ld_proof import V20CredFilterLDProof
from aries_cloudcontroller.models.v20_cred_filter_vcdi import V20CredFilterVCDI
from aries_cloudcontroller.models.v20_cred_format import V20CredFormat
from aries_cloudcontroller.models.v20_cred_issue import V20CredIssue
from aries_cloudcontroller.models.v20_cred_issue_problem_report_request import (
Expand Down
4 changes: 2 additions & 2 deletions aries_cloudcontroller/models/create_wallet_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ def wallet_type_validate_enum(cls, value):
if value is None:
return value

if value not in set(["askar", "askar-anoncreds", "in_memory", "indy"]):
if value not in set(["askar", "askar-anoncreds", "in_memory"]):
raise ValueError(
"must be one of enum values ('askar', 'askar-anoncreds', 'in_memory', 'indy')"
"must be one of enum values ('askar', 'askar-anoncreds', 'in_memory')"
)
return value

Expand Down
Loading

0 comments on commit 5b8a53d

Please sign in to comment.