-
Notifications
You must be signed in to change notification settings - Fork 142
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
Add and remove OpenID credentials from anchor #2810
Add and remove OpenID credentials from anchor #2810
Conversation
…ent methods to add/remove OpenID credential.
- Lookup anchor number by OpenID credential in stable structures. - Anchor management methods to add/remove OpenID credentials
…ve-from-anchor' into sea-snake/openid-google-add-remove-from-anchor
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.
A few comments. Looking good. I'd like to leave until tomorrow to think about the implications of adding the StableAnchor to the memory.
My first impression, is that it makes sense. Let's discuss again tomorrow.
@sea-snake after sleeping over this new memory, I can't find a reason not to move forward. Looks good to me! Let me know when the PR is ready for the final review. |
…ve-from-anchor' into sea-snake/openid-google-add-remove-from-anchor
pub fn update_openid_credential( | ||
anchor: &mut Anchor, | ||
openid_credential: OpenIdCredential, | ||
) -> Result<(), AnchorError> { |
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.
There is probably a good reason and might be related to how it's going to be used later, but I just wanted to point out that the update
here is seemingly inconsistent with add/remove in terms of return type, and also different from add/remove/update for devices.
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.
Yeah that's intentional, compared to updating a device, updating a credential doesn't result in any operation that needs to be stored in the archive canister. This is because a device its metadata can change after user action e.g. alias change while an OpenID credential will be updated on every JWT verification (to keep latest claims from OpenID provider stored).
Additionally, I intentionally only keep track of the issuer in operations for the archive canister, anything beyond that would likely impact a user's privacy. This data is enough to keep track of adoption of a given OpenId without knowing details beyond that.
…ve-from-anchor' into sea-snake/openid-google-add-remove-from-anchor
…ve-from-anchor' into sea-snake/openid-google-add-remove-from-anchor
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.
Thanks!
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.
Thanks! I left a few comments.
This PR is too big for my taste, it's hard to keep track of all the implications. Please test it carefully before merging.
I'm requesting changes to prevent merging before the comments are addressed.
@@ -5,7 +5,7 @@ | |||
"candid": "src/internet_identity/internet_identity.did", | |||
"wasm": "internet_identity.wasm.gz", | |||
"build": "bash -c 'II_DEV_CSP=1 II_FETCH_ROOT_KEY=1 II_DUMMY_CAPTCHA=${II_DUMMY_CAPTCHA:-1} scripts/build'", | |||
"init_arg": "(opt record { captcha_config = opt record { max_unsolved_captchas= 50:nat64; captcha_trigger = variant {Static = variant {CaptchaDisabled}}}})", | |||
"init_arg": "(opt record { captcha_config = opt record { max_unsolved_captchas= 50:nat64; captcha_trigger = variant {Static = variant {CaptchaDisabled}}}; openid_google = opt opt record { client_id = \"45431994619-cbbfgtn7o0pp0dpfcg2l66bc4rcg7qbu.apps.googleusercontent.com\" }})", |
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.
Is this our dev environment? Did you check with IT about the prod one?
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.
It's a dev environment I created, only works internally within DFINITY. This should be removed at a later point and replaced with instructions on creating a client id and configuring it with II.
Haven't gotten around to ask IT about the prod one yet, we'll need to also ask them to create others for our other environments.
…ve-from-anchor' into sea-snake/openid-google-add-remove-from-anchor
Changes
Tests
Added additional anchor tests:
Added additional storage test:
🟡 Some screens were changed