Closed rblaine95 closed 11 months ago
for ((i=0; i<10; i++)); do
curl -s -X 'POST' \
'http://localhost:8100/admin/tenants' \
-H 'Content-Type: application/json' \
-H 'x-api-key: adminApiKey' \
-d @- <<EOF
{
"image_url": "https://api.dicebear.com/7.x/pixel-art/svg?seed=somethingradnom",
"name": "my-issuer",
"roles": [
"issuer"
],
"group_id": "someGroup"
}
EOF
done
The above loop results in a Database Per Wallet being created, even if ACAPY_WALLET_STORAGE_CONFIG={"url":"governance-multitenant-wallets-db:5432","wallet_scheme":"MultiWalletSingleTable","max_connections":50}
AFAICT, wallet_scheme
is the key used in all examples, except for one where scheme
is used. That one's probably wrong.
Here's a test that claims to "test_postgres_wallet_scheme_works": https://github.com/hyperledger/aries-cloudagent-python/blob/ac1dde304e92683ab50bb0f2b8cad298b918aa52/aries_cloudagent/wallet/tests/test_indy_wallet.py#L830
But the IndyWalletConfig
object that it's creating, makes no mention of wallet_scheme
, or scheme
.....
https://github.com/hyperledger/aries-cloudagent-python/blob/ac1dde304e92683ab50bb0f2b8cad298b918aa52/aries_cloudagent/indy/sdk/wallet_setup.py#L24
So it does indeed seem to be specific to the postgres_storage plugin.
Because the following test is for the postgres plugin, and it uses '{"wallet_scheme":"MultiWalletSingleTable"}'
:
https://github.com/hyperledger/aries-cloudagent-python/blob/ac1dde304e92683ab50bb0f2b8cad298b918aa52/aries_cloudagent/indy/sdk/tests/test_wallet_plugin.py#L15
See load_postgres_plugin method: https://github.com/hyperledger/aries-cloudagent-python/blob/ac1dde304e92683ab50bb0f2b8cad298b918aa52/aries_cloudagent/indy/sdk/wallet_plugin.py#L51C1-L51C1
All of this seems to be fairly untouched code in the last 2-3 years ... especially the plugin itself is still under "experimental" and most of it hasn't changed in 4-5 years ... maybe there's newer, better ways to do things? :man_shrugging: Questions for the hyperledger team!
The relevant flag seems to be: --wallet-storage-type postgres_storage
, which we do have set with: ACAPY_WALLET_STORAGE_TYPE=postgres_storage
.
All I can think is that maybe the ACAPY_WALLET_STORAGE_CONFIG
body needs to be escaped?
i.e. "...,\"wallet_scheme\":\"MultiWalletSingleTable\"}"
.
Probably not, that's just a shot in the dark. But must be some way to get this config passed to the plugin: https://github.com/hyperledger/indy-sdk/blob/main/experimental/plugins/postgres_storage/README.md#wallet-management-modes
That's as much as I can see at the moment!
This looks very much related to didx-xyz/acapy-wallet-groups-plugin
Edit: It's not
The following issue links to documentation for migrating indy wallets using MultiWalletSingleTable to askar: https://github.com/hyperledger/aries-acapy-tools/issues/7
This seems to be what we're missing: --multitenancy-config
As mentioned in aries-askar readme, to use wallet_type=askar-profile
According to hyperledger/aries-cloudagent-python, the
ACAPY_WALLET_STORAGE_CONFIG
environment variable maps to the Indy SDK Postgres PluginIt looks like
wallet_scheme
is being ignored when set via theACAPY_WALLET_STORAGE_CONFIG
environment variable (environments/governance-multitenant/aca-py-agent.default.env
)