Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move to uplink acapy client #98

Merged
merged 48 commits into from
Sep 16, 2021
Merged

move to uplink acapy client #98

merged 48 commits into from
Sep 16, 2021

Conversation

TimoGlastra
Copy link
Collaborator

@TimoGlastra TimoGlastra commented Aug 24, 2021

Signed-off-by: Timo Glastra timo@animo.id

  • Fix tests for those which aren't working
  • Fix multi-tennant endpoints
  • Fix pubDID
  • release cloudcontroller "final" version (working for what we have) and pull that in requirements via pypi instead of from a git branch/commit

Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Copy link
Collaborator Author

@TimoGlastra TimoGlastra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the connections endpoints to use the generated cloud controller and added some comments for context.

@@ -2,14 +2,14 @@

import acapy_wallet_facade as wallet_facade
import ledger_facade
from aries_cloudcontroller import AriesAgentControllerBase
from aries_cloudcontroller import AcaPyClient
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AriesAgentControllerBase is now AcaPyClient

Comment on lines 25 to 26
agent = AcaPyClient(
YOMA_AGENT_URL, api_key=x_api_key, admin_insecure=x_api_key == None
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Client intialization is a bit different, but mostly the same

@@ -10,37 +10,38 @@
router = APIRouter(prefix="/generic/connections", tags=["connections"])


@router.get("/create-invite")
@router.get("/create-invite", response_model=InvitationResult)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can now specify the response models for API endpoints. These are generated, and exported in the cloud controller project.

The OpenAPI will automatically include the models in the generated open api spec.

):
"""
Create connection invite.
"""
invite = await aries_controller.connections.create_invitation()
invite = await aries_controller.connection.create_invitation()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calls are almost the same, connection is also generated, which is based on the tag name as used by ACA-Py

async def accept_invite(
invite: dict,
aries_controller: AriesAgentControllerBase = Depends(agent_selector),
invite: ReceiveInvitationRequest,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Input models can also be specified based on the cloud controller models

Signed-off-by: Timo Glastra <timo@animo.id>
@TimoGlastra
Copy link
Collaborator Author

I've updated the cloud controller to 0.3.0a7, which contains some fixes:

  • Updated the OpenAPI with some manual fixes. I'll see later to get those into ACA-Py itself (mainly ledger operations)
  • Added support for anyOf / oneOf models

@TimoGlastra
Copy link
Collaborator Author

@morrieinmaas @vineeth14 Have you run into any issues with using the cloud controller?

* test_send_credential_proposal in issuer_v2
  * see also didx-xyz/aries-cloudcontroller-python#62
* NOTE tests require tweaked version of controller that address return
type validation errors for pydantic types
fixed/tweaked version of cloudcontroller. That version has Any type
replacements for return types that are currently under investigation and
presumably wrong.
@morrieinmaas
Copy link
Collaborator

@TimoGlastra I made the tests pass now and removed some code smells. There is one test that needs fixing which is test_send_credential_proposal (for that please see this issue in the controller).

Please also have a look at issues 55-61 in the cloudcontroller. I've tweaked the controller for those issue on am now installing the controller from a branch via git+https://github.com/didx-xyz/aries-cloudcontroller-python@1162bb8b51ef5ddcaec916708c66966e3f18c358 as dependency. Before we we fully move to uplink version of the controller I'd say we should fix the issues and return types. That said, as you'll see in the code replacing a PyDantic model with an ANy type returns a couroutine object instead of a model object so I had to await it's JSOn response seprately. That is not ideal either, but works for now and will disappear when types are fixed.

Do NOT merge yet.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 8, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

89.7% 89.7% Coverage
0.0% 0.0% Duplication

the wallet_id variable si not required for the controller, hence I
removed it.
@morrieinmaas
Copy link
Collaborator

closes #13 and closes #59

morrieinmaas and others added 3 commits September 16, 2021 13:04
* [WIP] Enable out-of-band connection establishment

* [WIP] [skip ci]

add endpoint to create static connections.

TODOs:

* retrieve missing params within endpoint
* create pub did in corresponding tests to test the endpoint

* [WIP] Working endpoints, needs better testing.

Also the trusted partner endpoint seems off. That needs fixing to make
connections auto work properly.

* Ability to connect to OPs etc via public DID.

TODO:
* Design and decide on trusted registry so that users can pic a public
did.
@morrieinmaas morrieinmaas marked this pull request as ready for review September 16, 2021 13:22
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

93.5% 93.5% Coverage
0.0% 0.0% Duplication

@morrieinmaas morrieinmaas merged commit a63e249 into development Sep 16, 2021
@TimoGlastra TimoGlastra deleted the feature/uplink branch December 6, 2021 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants