Skip to content

Commit

Permalink
💥✨ Regenerate cloudcontroller with up-to-date python (asyncio) openap…
Browse files Browse the repository at this point in the history
…i generator (#114)

* ✨ use default python generator from openapi-generator

* 🎨 add isort step to generated output, and comment out patching

* revise version tag

* regenerate api and models with default python openapi-generator

* ✨ new files generated with default python openapi-generator

* 🎨 isort

* 🎨 resolve todo's

* ➕ add `python-dateutil` dependency

* ➖✨ remove deprecated `uplink` dependency

* ⬆️ bump pydantic to 2.4

* 🎨 rename imports in tests

* 🔥✨ remove custom converters for deprecated library, and associated test

* fix reference to pydantic ValidationError

* 🎨 replace .dict with .modul_dump

* 🎨 replace uplink.AiohttpClient with httpx.AsyncClient

* 🎨

* ➕ add `httpx` dependency

* ➕ add `urllib3` dependency

* ➕ add `isort` dependency

* 🎨 isort

* 🎨 black formatting

* 🎨 correct pydantic v2 dump_json todo fix

* ➕ add autoflake dependency

* 🎨 remove unused imports with autoflake, and add steps to script to postprocess generated client with autoflake, black, and isort

* 🎨 remove extra_service_params

* set library to `asyncio` in additionalProperties

* ✨ regenerate client with `--library asyncio`

* 🎨 add missing imports

* ✨ extend ApiClient, configure base_url + api_key, and initialize API modules

* 🎨 add AcaPyClient to imports

* 🎨 add admin_insecure flag again, and raise exception if api_key is missing

* 🔥

* ✅ update tests for models that now expect StrictBool for input

* ⬆️ update `black` to 3.9

* ⬆️ bump `anyio`

* ⬆️ update `typing-extensions` to 4.8

* ➖ remove httpx dependency

* Update lint job

* update python image to 3.9

* 🎨 add isort to linting job

* version bump

* add custom models for WalletRecordWithGroups and WalletListWithGroups

* 🎨 add implementation for get wallets with a group_id, to remove the overriding of this Api module in CloudApi

* version bump

* fix incorrect max value (was -1, should be 18446744073709551615)

* fix deprecation warning

* version bump

* 🎨 add method to convert boolean query parameters to their string equivalents before http request is sent

* version bump

* 🎨 move custom boolean conversion to `sanitize_for_serialization` method

* version bump

* 🎨 remove inheritance of ApiClient and configure instance separately

* version bump

* 0.9.0-beta1

* 🎨 update url

* 🎨 re-add async context management

* 0.9.0-beta2

* 🎨 configure base_url in configuration before instantiating ApiClient - avoids shared state with multiple AcaPyClients!

* 🎨 modify DID to have enums for select fields

* ✅ write tests to assert changes to DID model

* 🎨 deduplicate regex patterns

* 0.9.0-beta3

* 🎨

* 🎨 publish_rev_reg_def can return a `Union[RevRegResult, TxnOrRevRegResult]`

* 0.9.0-beta4

* fix: var_json field in AttachDecoratorData can either be a dict, or a list of dict

* ✅ create test for the custom type in ACA-Py requiring a manual change to AttachDecoratorData

* only type "CL" is accepted for CredentialDefinition

* ✅ write tests to assert that only type "CL" is accepted for CredentialDefinition

* fix: context and issuer fields in Credential can either be a str or a dict

* fix: some fields in Filter schema are a "StrOrNumberField" - custom type defined in ACA-py

* ✅ write tests to assert manual changes to Filter model to accommodate custom type in ACA-Py

* 🎨 services can be a str or a Dict

* 🎨 fix: recipient_keys and service_endpoint are optional in ACA-Py 0.9.0. This is fixed and can be removed from 0.10.0 onwards

* 🎨 modify `sanitize_for_serialization` to only cast query_param bools to string

* 0.9.0-beta5

* 🎨 Special handling for Union[RevRegResult, TxnOrRevRegResult] response from publish_rev_reg_def.
Fixed and no longer necessary in ACA-Py 0.10.1

* 0.9.0-beta6

* 🎨 add imports for custom models: WalletListWithGroups and WalletRecordWithGroups

* 0.9.0-beta7

* 🎨 remove strict model requirement for `doc`

* 🎨 remove override that was used if doc is a BaseModel

* 0.9.0-beta8

* 🎨

* 🎨 WalletListWithGroups should inherit from WalletList

* 0.9.0-beta9

* 🎨 override `from_dict` method for our custom models: WalletRecordWithGroups and WalletListWithGroups

* 0.9.0-beta10

* set version

* update python version to 3.9.18

* 📄 Update contact info

* 0.9.0-beta11

* 🎨 define DEFAULT_PYDANTIC_MODEL_CONFIG to deduplicate model config. Adds `defer_build: True`

* 🎨

* 🎨 deduplicate

* 🎨 set `validate_assignment` to False

* 0.9.0-beta12

* 📌 pin anyio to >= 3.7.1, as fastapi doesn't support v4 yet

* 🎨

* include fetching spec in generate-client.sh

* 🎨

* rename config to template (env var to be filled by generate-client script)

* 🎨 read ACA_PY_VERSION as input and set as env var to generate config from template

* 🎨 unused import

* config filled from template

* updated spec

* 🎨 move custom _WithGroups models to own files

* 🎨 regenerate with postprocessing and ACA-Py versioning

* 🎨 regenerate with postprocessing and ACA-Py versioning

* 🎨 print version being generated

* 🎨 define script for postprocessing the generated client

* 🎨 moved custom models

* 🎨 import

* 🎨✨ additional postprocessing to modify faults in autogeneration

* 🎨 re-add import of regex patterns

* 0.9.0-beta13

* 🎨 define and re-use default_ssl_context

* 🎨 Update description

* ✨ revised 0.9.0 release

* 🎨 Update README with simplified steps

* 🎨 Update README
  • Loading branch information
ff137 authored Oct 20, 2023
1 parent e761894 commit bfc0f04
Show file tree
Hide file tree
Showing 655 changed files with 63,306 additions and 17,635 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Install Python 3
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -28,10 +28,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Black Python linting
uses: lgeiger/[email protected]
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
args: . --check
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install \
isort~=5.12.0 \
black~=23.9.1
- name: Check import style with isort
run: |
isort . --check --profile black --diff
- name: Check code style with Black
run: |
black . --check --diff
deploy:
# if: ${{ startsWith(github.ref, 'refs/tags/') && github.event.base_ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
Expand Down
20 changes: 16 additions & 4 deletions .github/workflows/python-test-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Install Python 3
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -34,10 +34,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Black Python linting
uses: lgeiger/[email protected]
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
args: . --check
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install \
isort~=5.12.0 \
black~=23.9.1
- name: Check import style with isort
run: |
isort . --check --profile black --diff
- name: Check code style with Black
run: |
black . --check --diff
deploy:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.9.17
3.9.18
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<a href="#license">License</a>
</p>

Aries Cloud Controller Python is a client library written in Python for interacting with an [Aries Cloud Agent Python](https://github.com/hyperledger/aries-cloudagent-python) instance. It is generated based on the OpenAPI definition provided by ACA-Py, giving a fully-typed rich API for interacting the cloud agent.
The Aries CloudController is a client library, written in Python, for interacting with an [Aries Cloud Agent](https://github.com/hyperledger/aries-cloudagent-python) instance. It is generated based on the OpenAPI definition provided by ACA-Py, giving a fully-typed, rich API for interacting with the cloud agent.

Each Cloud Controller version maps to a specific ACA-Py version, which is outlined in the table below. Although not strictly adhered to in the past, a new ACA-Py version will result in a new Minor version bump for the Cloud Controller, as there are often times breaking changes.

Expand Down
6 changes: 3 additions & 3 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Yoma Security Policy
# Security Policy

## Reporting a Security Bug

If you think you have discovered a security issue in any of the Yoma projects, we'd love to
If you think you have discovered a security issue in any of our projects, we'd love to
hear from you. We will take all security bugs seriously and if confirmed upon investigation we will
patch it within a reasonable amount of time and release a public security announcement discussing the
bug and credit the discoverer.
Expand All @@ -13,7 +13,7 @@ Security bugs can be reported via email. The process is as follows:

(email) Content: Description of the bug + how to reproduce the bug

Email Yoma at: [tech at yoma dot world](mailto:[email protected]).
Email us at: [info at didx.co.za](mailto:[email protected])

*Note. It is not necessary to include the type of bug if you are not sure how to classify it.*
*A detailed description will be adequate.*
Loading

0 comments on commit bfc0f04

Please sign in to comment.