bcgov / traction

Traction is designed with an API-first architecture layered on top of Hyperledger Aries Cloud Agent Python (ACA-Py) and streamlines the process of sending and receiving digital credentials for governments and organizations.
https://digital.gov.bc.ca/digital-trust/tools/traction/
Apache License 2.0
53 stars 51 forks source link

All tenants are being created in the same database/schema #1254

Open esune opened 4 months ago

esune commented 4 months ago

The Traction ACA-Py agent is started with the setting "wallet_scheme":"DatabasePerWallet" in the wallet storage configuration: this is expected to cause each tenant to be created and live in their own database in the wallet. However, it appears that all tenants are actually being created inside the same multitenant_sub_wallet database at this time.

Unsure on whether this issue is in Traction or ACA-Py, we should audit the problem and follow-up in the appropriate repository to find a solution.

loneil commented 4 months ago

FYI this is what the ACA-Py status/config reads (using x-api-key) when fetched (dev env in this case but same for all)

image

jamshale commented 4 months ago

So. I've confirmed that this is an issue with the multitenant_provider plugin. https://github.com/hyperledger/aries-acapy-plugins/tree/main/multitenant_provider. I don't think there's any configuration or anything that will fix it. It's a bug in the plugin that needs to be fixed.

If I use the plugin in base aca-py and create wallets it starts putting them in multitenant_sub_wallet which I believe is a hardcoded default in aca-py.

Without the plugin everything works as expected.

jamshale commented 4 months ago

Changing the plugin config for the multitenant_provider to use the other multitenant manager class will fix the issue for new tenants. https://github.com/bcgov/traction/blob/main/charts/traction/values.yaml#L226.

This should be changed to BasicMultitokenMultitenantManager