Skip to content

Commit 343d67d

Browse files
authored
chore: update client for acapy 0.7.3 (#77)
1 parent 88faf35 commit 343d67d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1923
-231
lines changed

.github/workflows/lint-black.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/python-publish.yml

Lines changed: 41 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,48 @@ on:
88
types: [created]
99

1010
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Install Python 3
16+
uses: actions/setup-python@v1
17+
with:
18+
python-version: 3.8
19+
- name: Install dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install -r requirements.txt -r requirements.dev.txt
23+
- name: Run tests with pytest
24+
run: pytest
25+
26+
lint:
27+
name: Python linting
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v2
31+
- name: Black Python linting
32+
uses: lgeiger/black-action@master
33+
with:
34+
args: . --check
1135
deploy:
1236
# if: ${{ startsWith(github.ref, 'refs/tags/') && github.event.base_ref == 'refs/heads/main' }}
1337
runs-on: ubuntu-latest
38+
needs: [lint, test]
1439
steps:
15-
- uses: actions/checkout@v2
16-
- name: Set up Python
17-
uses: actions/setup-python@v2
18-
with:
19-
python-version: '3.x'
20-
- name: Install dependencies
21-
run: |
22-
python -m pip install --upgrade pip
23-
pip install setuptools wheel twine
24-
- name: Build and publish
25-
env:
26-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
27-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
28-
run: |
29-
python setup.py sdist bdist_wheel
30-
twine upload dist/*
40+
- uses: actions/checkout@v2
41+
- name: Set up Python
42+
uses: actions/setup-python@v2
43+
with:
44+
python-version: "3.x"
45+
- name: Install dependencies
46+
run: |
47+
python -m pip install --upgrade pip
48+
pip install setuptools wheel twine
49+
- name: Build and publish
50+
env:
51+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
52+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
53+
run: |
54+
python setup.py sdist bdist_wheel
55+
twine upload dist/*

.github/workflows/python-test-publish.yml

Lines changed: 50 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,57 @@ on:
1414
- main
1515

1616
jobs:
17-
deploy:
17+
test:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v2
21+
- name: Install Python 3
22+
uses: actions/setup-python@v1
23+
with:
24+
python-version: 3.8
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install -r requirements.txt -r requirements.dev.txt
29+
- name: Run tests with pytest
30+
run: pytest
1831

32+
lint:
33+
name: Python linting
1934
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v2
37+
- name: Black Python linting
38+
uses: lgeiger/black-action@master
39+
with:
40+
args: . --check
2041

42+
deploy:
43+
runs-on: ubuntu-latest
44+
needs: [lint, test]
2145
steps:
22-
- uses: actions/checkout@v2
23-
- name: Set up Python
24-
uses: actions/setup-python@v2
25-
with:
26-
python-version: '3.x'
27-
- name: Install dependencies
28-
run: |
29-
python -m pip install --upgrade pip
30-
pip install setuptools wheel twine pylint
31-
- name: Analysing the code with pylint
32-
run: |
33-
python -m pylint --fail-under=10 `find -regextype egrep -regex '(.*.py)$'` |
34-
tee pylint.txt
35-
- name: Upload pylint.txt as artifact
36-
uses: actions/upload-artifact@v2
37-
with:
38-
name: pylint report
39-
path: pylint.txt
40-
- name: Build and publish
41-
env:
42-
TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }}
43-
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
44-
run: |
45-
python setup.py sdist bdist_wheel
46-
twine upload --repository testpypi dist/*
46+
- uses: actions/checkout@v2
47+
- name: Set up Python
48+
uses: actions/setup-python@v2
49+
with:
50+
python-version: "3.x"
51+
- name: Install dependencies
52+
run: |
53+
python -m pip install --upgrade pip
54+
pip install setuptools wheel twine pylint
55+
- name: Analysing the code with pylint
56+
run: |
57+
python -m pylint --fail-under=10 `find -regextype egrep -regex '(.*.py)$'` |
58+
tee pylint.txt
59+
- name: Upload pylint.txt as artifact
60+
uses: actions/upload-artifact@v2
61+
with:
62+
name: pylint report
63+
path: pylint.txt
64+
- name: Build and publish
65+
env:
66+
TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }}
67+
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
68+
run: |
69+
python setup.py sdist bdist_wheel
70+
twine upload --repository testpypi dist/*

.github/workflows/run-py-tests.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.8.10

README.md

Lines changed: 143 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,151 @@
1-
[![Upload Python Package](https://github.com/didx-xyz/aries-cloudcontroller-python/actions/workflows/python-publish.yml/badge.svg)](https://github.com/didx-xyz/aries-cloudcontroller-python/actions/workflows/python-publish.yml)
1+
<p align="center">
2+
<br />
3+
<img
4+
alt="Hyperledger Aries logo"
5+
src="https://raw.githubusercontent.com/didx-xyz/aries-cloudcontroller-python/main/images/aries-logo.png"
6+
height="250px"
7+
/>
8+
</p>
9+
<h1 align="center"><b>Aries Cloud Controller Python</b></h1>
10+
<p align="center">
11+
<img
12+
alt="Pipeline Status"
13+
src="https://github.com/didx-xyz/aries-cloudcontroller-python/actions/workflows/python-publish.yml/badge.svg?branch=main"
14+
/>
15+
<a href="https://pypi.org/project/aries-cloudcontroller/">
16+
<img alt="aries-cloudcontroller version" src="https://badge.fury.io/py/aries-cloudcontroller.svg"/>
17+
</a>
18+
<a
19+
href="https://raw.githubusercontent.com/didx-xyz/aries-cloudcontroller-python/main/LICENSE"
20+
><img
21+
alt="License"
22+
src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"
23+
/></a>
24+
<a href="https://www.python.org/"
25+
><img
26+
alt="Python"
27+
src="https://img.shields.io/badge/%3C%2F%3E-Python-%230074c1.svg"
28+
/></a>
29+
</p>
30+
<br />
231

3-
# Aries Cloud Controller - Python
32+
<p align="center">
33+
<a href="#features">Features</a> &nbsp;|&nbsp;
34+
<a href="#usage">Usage</a> &nbsp;|&nbsp;
35+
<a href="#available-apis">Available APIs</a> &nbsp;|&nbsp;
36+
<a href="#contributing">Contributing</a> &nbsp;|&nbsp;
37+
<a href="#license">License</a>
38+
</p>
439

5-
A simple pip installable package for controlling aries agents through admin API calls.
40+
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.
641

7-
# Install
42+
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.
843

9-
https://pypi.org/project/aries-cloudcontroller/
44+
| Aries Cloud Controller Version | Aries Cloud Agent Python Version |
45+
| ------------------------------ | -------------------------------- |
46+
| 0.5.1 | 0.7.3 |
1047

11-
## Tutorial
48+
## Features
1249

13-
Find out how to use this package by taking our [jupyter notebook tutorial series](https://github.com/OpenMined/PyDentity/tree/master/tutorials).
50+
Aries Cloud Controller Python is a fully featured client for interacting with ACA-Py.
1451

52+
- Fully Typed wrapper around Aries Cloud Agent Python
53+
- Supports latest ACA-Py version (0.7.3)
54+
- Client is auto generated based on OpenAPI definitions, allowing us to keep up to date with new releases.
55+
- Supports multi-tenant APIs and authentication
56+
- Async API
1557

58+
## Usage
59+
60+
Aries Cloud Controller Python is published to PyPi and can be installed using pip:
61+
62+
```sh
63+
pip install aries-cloudcontroller
64+
```
65+
66+
### Creating a client
67+
68+
```python
69+
from aries_cloudcontroller import AcaPyClient
70+
71+
client = AcaPyClient(
72+
base_url="http://localhost:8000",
73+
api_key="myApiKey"
74+
)
75+
```
76+
77+
**Admin insecure mode**
78+
79+
If you are running ACA-Py with the admin insecure flag and don't have the API key, you must set the `admin_insecure` property:
80+
81+
```python
82+
client = AcaPyClient(
83+
base_url="http://localhost:8000",
84+
# Explicitly mark that no api key is used
85+
admin_insecure=True
86+
)
87+
```
88+
89+
**Multitenancy**
90+
91+
To provision the agent in the context of specific tenant of the agent, the `tenant_jwt` property must be set:
92+
93+
```python
94+
client = AcaPyClient(
95+
base_url="http://localhost:8000",
96+
tenant_jwt="eyXXX"
97+
)
98+
```
99+
100+
### Interacting with the client
101+
102+
Once you have the client set up, you're ready to interact with it. Because the API is fully typed, the best way to know what is available is by looking at the ACA-Py swagger UI, and the available properties on the client.
103+
104+
For example to create and receive an invitation the following methods can be called:
105+
106+
```python
107+
invitation = await client.connection.create_invitation(
108+
body=CreateInvitationRequest(my_label="Cloud Controller")
109+
)
110+
111+
connection = await client.connection.receive_invitation(body=result.invitation)
112+
```
113+
114+
## Available APIs
115+
116+
Currently the following top-level APIs are available in the client. Each api maps to the topics as used by the ACA-Py swagger UI.
117+
118+
- `action_menu`
119+
- `basicmessage`
120+
- `connection`
121+
- `credential_definition`
122+
- `credentials`
123+
- `default`
124+
- `did_exchange`
125+
- `discover_features`
126+
- `discover_features_v2_0`
127+
- `endorse_transaction`
128+
- `introduction`
129+
- `issue_credential_v1_0`
130+
- `issue_credential_v2_0`
131+
- `jsonld`
132+
- `ledger`
133+
- `mediation`
134+
- `multitenancy`
135+
- `out_of_band`
136+
- `present_proof_v1_0`
137+
- `present_proof_v2_0`
138+
- `resolver`
139+
- `revocation`
140+
- `schema`
141+
- `server`
142+
- `trustping`
143+
- `wallet`
144+
145+
## Contributing
146+
147+
If you would like to contribute to the framework, please read [CONTRIBUTING](/CONTRIBUTING.md) guidelines. These documents will provide more information to get you started!
148+
149+
## License
150+
151+
Aries Cloud Controller Python is licensed under the [Apache License Version 2.0 (Apache-2.0)](/LICENSE).

0 commit comments

Comments
 (0)