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

Author subwallet setup automation #2791

Merged
merged 1 commit into from
Feb 20, 2024
Merged

Conversation

jamshale
Copy link
Contributor

@jamshale jamshale commented Feb 16, 2024

This allows tenant author setup with an endorser to be automated through the api with the same configs as starting an author agent from the command line. It creates a util with the existing startup code and calls it from the create_wallet endpoint. I think this really helps simplify creating author tenants.

example:

{
  "extra_settings": {
    "endorser-alias": "endorser",
    "endorser-protocol-role": "author",
    "auto-request-endorsement": true,
    "auto-write-transactions": true,
    "endorser-public-did": "Aedt1jccq9Do7G9fKp7yHT",
    "auto-promote-author-did": true,
    "auto-create-revocation-transactions": true,
    "endorser-invitation": "http://localhost:9030?oob=eyJAdHlwZSI6ICJodHRwczovL2RpZGNvbW0ub3JnL291dC1vZi1iYW5kLzEuMS9pbnZpdGF0aW9uIiwgIkBpZCI6ICIxZTEyZjY0ZC05MWYwLTRlM2YtYmZmMi1jYzk5NjkxMDNhOWMiLCAibGFiZWwiOiAiZW5kb3JzZXIiLCAiaGFuZHNoYWtlX3Byb3RvY29scyI6IFsiaHR0cHM6Ly9kaWRjb21tLm9yZy9kaWRleGNoYW5nZS8xLjAiXSwgInNlcnZpY2VzIjogW3siaWQiOiAiI2lubGluZSIsICJ0eXBlIjogImRpZC1jb21tdW5pY2F0aW9uIiwgInJlY2lwaWVudEtleXMiOiBbImRpZDprZXk6ejZNa3RFajlkdFJ3UXFzRllWUGpTeEZKYlJHZkN2emExUWoxcU5USjE3TWFza1RqI3o2TWt0RWo5ZHRSd1Fxc0ZZVlBqU3hGSmJSR2ZDdnphMVFqMXFOVEoxN01hc2tUaiJdLCAic2VydmljZUVuZHBvaW50IjogImh0dHA6Ly9sb2NhbGhvc3Q6OTAzMCJ9XX0="
  },
  "key_management_mode": "managed",
  "label": "tenant-0",
  "wallet_dispatch_type": "default",
  "wallet_key": "tenant-key-0",
  "wallet_name": "tenant-0",
  "wallet_type": "askar-anoncreds"
}

I had to fix what I believe was a bug with creating the connection for the tenant from the admin context in aries_cloudagent/protocols/didexchange/v1_0/manager.py where connection info would be saved for the wrong profile for the responder.

@jamshale jamshale force-pushed the feat/2786 branch 4 times, most recently from f888084 to 49fbdd4 Compare February 20, 2024 16:13
Signed-off-by: jamshale <jamiehalebc@gmail.com>
Copy link

sonarcloud bot commented Feb 20, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@@ -18,53 +18,62 @@
from ...messaging.valid import UUID4_EXAMPLE, JSONWebToken
from ...multitenant.base import BaseMultitenantManager
from ...storage.error import StorageError, StorageNotFoundError
from ...utils.endorsement_setup import attempt_auto_author_with_endorser_setup
from ...wallet.error import WalletSettingsError
from ...wallet.models.wallet_record import WalletRecord, WalletRecordSchema
from ..error import WalletKeyMissingError

ACAPY_LIFECYCLE_CONFIG_FLAG_MAP = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just alphabetically sorted these.

wallet_profile = await multitenant_mgr.get_wallet_profile(
context, wallet_record, extra_settings=settings
)
await attempt_auto_author_with_endorser_setup(wallet_profile)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Trying to do this inside the manager created a circular dependency.

@jamshale jamshale marked this pull request as ready for review February 20, 2024 18:57
@jamshale jamshale linked an issue Feb 20, 2024 that may be closed by this pull request
@jamshale jamshale merged commit 2087915 into hyperledger:main Feb 20, 2024
8 checks passed
gvelez17 pushed a commit to Whats-Cookin/aries-cloudagent-python that referenced this pull request Mar 8, 2024
Signed-off-by: jamshale <jamiehalebc@gmail.com>
gvelez17 pushed a commit to Whats-Cookin/aries-cloudagent-python that referenced this pull request Mar 25, 2024
Signed-off-by: jamshale <jamiehalebc@gmail.com>
Signed-off-by: Golda Velez <gvelez17@gmail.com>
gvelez17 pushed a commit to Whats-Cookin/aries-cloudagent-python that referenced this pull request Mar 25, 2024
Signed-off-by: jamshale <jamiehalebc@gmail.com>
Signed-off-by: Golda Velez <gvelez17@gmail.com>
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.

Multitenancy - Subwallet - Author endorsement settings and automation
2 participants