-
Notifications
You must be signed in to change notification settings - Fork 516
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
Anoncreds - support for anoncreds and askar wallets concurrently #2807
Comments
My vote is for a versioned API approach. IMO this will enable the API to remain consistent from a endpoint path perspective between versions where appropriate (such as with the schema, cred-def, and revocation endpoints) which will in-turn make migration from one API version to another easier for developers; consistent APIs with different parameters/functionality between versions. I think this will also enable:
My thought is a given API version contains a full set of APIs including those that have not changed from the previous version, along with new APIs and those containing breaking changes. That way we don't run into the issue where unchanged APIs remain at the version they were introduced and we have to support old API versions. New APIs can be introduced into the current API version since they don't impact existing API endpoints. |
Agreed. This is a logical default for creating tenant wallets. |
@WadeBarnes what are the rules you are suggesting for the versions changing?
|
Details:
|
Thanks, Wade. That makes sense. The downside of that approach is that when removing an API, everyone has to deploy a new controller, even if the endpoints they use have not changed. That will be worse when the motivation to bump the API version is required, but isolated to a small number of endpoints. For example, in the current case, no verifiers are affected by the schema/creddef/revreg, but in order to get rid of the “old code” related to those endpoints, every controller (including verifiers) will have to update their code to change to the “/v1” endpoints. Or we start being lienent on the rules (which is what I worry about) and we keep some “unversioned” endpoints (unchanged ones) and delete others. That makes fuzzy the definition of what is the “vX API”. Obviously there is no right/wrong answer. So I’m not hard fast against, but my experience points to the “rename endpoints” and avoiding the “API vX” definition as an easier approach in the long run. A couple of other reasons that I think make the ACA-Py scenario a little different:
|
I don't think removing an API necessarily requires people to deploy a new controller. That's where the default version comes in. If the controller does not specify a version or the version the controller using does not exist any more, I see the call using the default API version. Properly versioned APIs don't impose the use of the Further, there would be a sufficient amount of time from the point an API was deprecated to when it was removed from the code to allow clients to upgrade. The host of the service also has control over when and to what version of ACA-Py they upgrade, and are responsible for communicating this to they clients. |
Ah…I was not aware of the API version in the header. Could you point me to how that works? |
Some examples in the code documentation: |
The difference between orgbook api versioning and aca-py is that for orgbook the entire api is versioned, and for aca-py each protocol is versioned independently. So there's no "overall api version" - if we use the version parameters in the header then it needs to be targeted at each protocol individually. And since protocols can be loaded as plug-ins we have no overall control over what api's and versions that aca-py will be running. The existing schema, cred def and revocation api's have no version info, so if we add the new version of the api's under a |
Worse — some Admin API calls are not part of DIDComm protocols and so today they don’t have a version (e.g. the schema/creddef/revreg, the set tenant settings, etc.). So it will create confusion adding an “Admin API version” in conjunction with some endpoints already having a “DIDComm Protocol Versions”. The plugins add to the fun, as the full set of endpoints is not actually determined until the ACA-Py instance is deployed — a runtime determination. My preference (not hard and fast :-) ) is back to not having an “API Version”. |
I've updated the main description per the comments, @swcurran @WadeBarnes @jamshale |
For: I'm trying to determine a way to tell if the existing wallet/DB is askar or askar-anonreds, because they both use Askar storage. Anyone know of a record type I can look for? Or another approach? I was looking at #2384 but working with an encrypted DB, i'm not sure how I can use it. And that would only work for a DB/wallet that has a rev reg record. |
I think we store a version number in the database, so we could store the storage type in the same way. If there is no storage type, then assume it's "askar". And then we could store a value for "anoncreds" (which we would store on creation of the wallet, or on upgrade from askar to anoncreds). |
We do something similar in the upgrade.py that was updated here: https://github.com/hyperledger/aries-cloudagent-python/pull/2185/files We are doing something similar, but instead of using the version number, we’re using the wallet type string.
Presumably we want to call it “askar-anoncreds” to match the
Is there anything more we should do to prevent this from being run when the wallet-type is “indy”? Or is that already considered? |
This ☝️ makes sense. But, I am a bit unsure about what to do with and If it gets |
I think if you try to open an Indy wallet using Askar it will throw an exception. I suggest we just document that people will need to upgrade Indy to Askar (if they are still running an Indy wallet) and then we don't need to do anything else. |
Support starting aca-py with both the credx and anoncreds libraries loaded, and support (in multitenancy) tenants with both askar and askar-anoncreds wallet types concurrently. (This is necessary to allow tenants in a multi- environment to upgrade their sub-wallets from askar to askar-anoncreds at their convenience. (Note that the upgrade function will be documented in a separate issue.)
When starting up aca-py, load both the credx and anoncreds libraries, and enable the API endpoints for both libraries (schema, credential definition and revocation). Ensure that the endpoints are under different url's. (Schema and cred def are currently under different url's - the "new" API's are under
/anoncreds
. For revocation, the new endpoints will need to be moved to the/anoncreds
url, alongside the schema and cred def.In each API endpoint that is duplicated, add a check to each endpoint to make sure it is being called with the correct wallet type (for example for the new anoncreds-related API's, if the wallet type is
askar
then return an error code.)When in multi-tenancy mode, create new tenant wallets using the overall aca-py's configured wallet type. (For example if aca-py is started with
--wallet-type askar
then created tenant wallets withaskar
type, likewist withaskar-anoncreds
.)When running in multi-tenant mode, ensure that the tenant wallet's wallet type is in scope for all processing related to that tenant (i.e. Admin API calls and processing for received agent-to-agent messages).
On aca-py startup, verify that the configured
--wallet-type
matches the actual database. If the wallet isaskar
and aca-py is started with--wallet-type askar-anoncreds
, aca-py should shut down with an error message. Likewise if the wallet isaskar-anoncreds
and aca-py is started with--wallet-type askar
. If there is a database upgrade in progress (askar to askar-anoncreds, see issue #2808) then aca-py should allow startup but the only endpoint available will be the upgrade endpoint. (Note that for a multi-tenant scenario, this just applies to the base wallet.)The text was updated successfully, but these errors were encountered: