-
Notifications
You must be signed in to change notification settings - Fork 3
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
639: Invalidate card frontend #946
Conversation
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.
Shouldn't we check with the backend if the card is still valid as it could not only have been exbired but there is also the possibility it's been revoked?
good point. I just read the criteria in the issue which said. Take the expirationDate from the Anmeldecode. |
frontend/lib/identification/card_detail_view/card_detail_view.dart
Outdated
Show resolved
Hide resolved
...nd/lib/identification/verification_workflow/dialogs/positive_verification_result_dialog.dart
Show resolved
Hide resolved
frontend/lib/identification/card_detail_view/card_detail_view.dart
Outdated
Show resolved
Hide resolved
I think we should do both:
Of course, we could also make the app API-validate the card on every start, and if it this failed (because of connection errors) for two weeks (which again can be tricked by changing system time) we don't show the QR code. In that case, we can probably omit the local expiration date check. We should probably API-validate the card on app-start anyways, as the card might even get invalidated by scanning the anmeldecode on another device. Then, it would be great if the user could see this right away, after relaunching the app on the old device. |
…tive_verification_result_dialog.dart Co-authored-by: Michael Markl <[email protected]>
…dart Co-authored-by: Michael Markl <[email protected]>
Not sure if you read my comment above. I'm aware these checks are needed at some point and therefore is another ticket but for now we don't have any functionality for "scanning anmeldecode on other device", that it gets invalid yet (currently you can use it on x devices at least as i tested). I also mentioned this in the other issue #677. |
In this whole conversation we use "Anmeldecode" synonomously to "Aktivierungscode"?
Afaik, this is (or at least should be) wrong. Once you scan an "Aktivierungscode", the app makes an API-request ("activate card"), the backend generates a new TOTP secret and overwrites the old TOTP secret (thus invalidating the old activation). |
Yes we do. Well i tested the same activation code on two devices locally. Even the secret changes it seem not to be revalidated on the first activated device. At least i couldn't reproduce that Update: Okay you are right. If i scan the first card its invalid. But its not deactivated in the frontend (looks still valid that was my issue). So we need a visible feedback on the first device to also look invalid :) |
Right, that's why we need to API-validate on a regular basis, to actually detect this.
Just to clarify: We never planned to allow the user to revoke his card; only administrators should be able to |
Alright just as a summary:
What do you think? Did I forget sth? |
sounds good to me. |
…if an Anmeldecode was used on different device, add card validation against the backend, invalidate cards after 1 week without backend connection
Ok i updated the pr. Now additionally to the frontend check i validate:
Testing: You can set an invalid lastCheckDate in the dev settings Updated my pr @michael-markl & @sarahsporck |
...rc/main/kotlin/app/ehrenamtskarte/backend/verification/webservice/schema/CardQueryService.kt
Outdated
Show resolved
Hide resolved
frontend/lib/identification/card_detail_view/verification_code_view.dart
Outdated
Show resolved
Hide resolved
frontend/lib/identification/card_detail_view/verification_code_view.dart
Show resolved
Hide resolved
...p/ehrenamtskarte/backend/verification/webservice/schema/types/CardVerificationResultModel.kt
Outdated
Show resolved
Hide resolved
frontend/lib/identification/card_detail_view/verification_code_view.dart
Outdated
Show resolved
Hide resolved
frontend/lib/identification/card_detail_view/verification_code_view.dart
Outdated
Show resolved
Hide resolved
As I explained in one of my comments above: YES
We cannot detect whether the otp code sent along with the request belongs to an old totp secret or is simply invalid (as we don't keep old totp secrets). I think it's enough to just show some text like "this card is invalid and these are the possible reasons: [possible reasons]". |
… to secure storage on card activation
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.
Tested and works fine.
However I find the revalidation doesn't look very pleasing. Especially the icon followed by "Weitere Aktionen". Maybe putting the icon above the text or also adding a text to the icon can help. Maybe @michael-markl has an idea.
frontend/lib/identification/card_detail_view/card_detail_view.dart
Outdated
Show resolved
Hide resolved
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.
Except one comment, I'm fine with these changes.
Good stuff 🚀
...rc/main/kotlin/app/ehrenamtskarte/backend/verification/webservice/schema/CardQueryService.kt
Outdated
Show resolved
Hide resolved
frontend/lib/identification/card_detail_view/verification_code_view.dart
Outdated
Show resolved
Hide resolved
frontend/lib/identification/activation_workflow/activation_code_scanner_page.dart
Outdated
Show resolved
Hide resolved
…dart Co-authored-by: Sarah <[email protected]>
…_view.dart Co-authored-by: Michael Markl <[email protected]>
…amp in seconds with uint64, add version2 of verificationByHash and add deprecation notice for old version
…to 639-invalidate-card-frontend
i think this case is happening very rarely. I added a label to the button. But to change order means to change at lot in the widgets which is not really necessary imo Added deprecation message, v2 and the adjustment of the data type to uint64 |
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.
After addressing the remaining unresolved comments, you can merge imo 🚀
...rc/main/kotlin/app/ehrenamtskarte/backend/verification/webservice/schema/CardQueryService.kt
Outdated
Show resolved
Hide resolved
…n/webservice/schema/CardQueryService.kt Co-authored-by: Michael Markl <[email protected]>
Co-authored-by: Michael Markl <[email protected]>
Testing:
expirationDay: 19446,
in dev_settings_viewresolve #639
resolves #677