-
Notifications
You must be signed in to change notification settings - Fork 20
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
feat(backend): Gate api methods #1807
Conversation
If I understand correctly, this architecture allows for the Oisy BE migration to occur while Oisy is still live - but read-only - is this the idea behind it ? |
This does support readonly during migration but the API toggles are needed with or without. For example, if reads are still enabled on the signer or signing on the backend after migration and we call the wrong canister because a user hasn't refreshed so is using an old client, we are in a worse state than before. |
@@ -10,6 +10,7 @@ type AddUserCredentialRequest = record { | |||
current_user_version : opt nat64; | |||
credential_spec : CredentialSpec; | |||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We wish to be able to make features either fully enabled, fully disabled, or enabled for read methods only. This type is used to represent which of these states a feature is in.
@@ -108,6 +108,7 @@ pub(crate) fn init_arg() -> Arg { | |||
issuer_origin: ISSUER_ORIGIN.to_string(), | |||
credential_type: CredentialType::ProofOfUniqueness, | |||
}]), | |||
api: None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bitdivine: Will you add some integration tests that exercise the API disabling?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disabling APIs matters in the migration, so I was going to test that in the migration e2e tests. After the migration is complete I expect all of this will be deleted again. 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, a little bit sad that the CDK annotations do not allow multiple guards...
Agreed! At least, I didn't test but it looks that way based on this option: https://github.com/dfinity/cdk-rs/blob/59795716487fbb8a9910ac503bcea1e0cb08c932/src/ic-cdk-macros/src/export.rs#L12 No idea whether changing the option to a vec would "just work" or whether more is needded. I see no hints either way in the macro attribute code. |
Motivation
When we split the backend into two canisters, we will need to disable APIs gradually and selectively:
Note:
Changes
Tests
TODO