-
Notifications
You must be signed in to change notification settings - Fork 1
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
Authorization Interactor #356
base: main
Are you sure you want to change the base?
Conversation
match authorization { | ||
AuthorizationResponse::Rejected => { | ||
debug!("User rejected authorization, aborting."); | ||
return Err(CommonError::HostInteractionAborted); |
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.
Good! We auth before consuming instances in Cache, perfect
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.
Do we have any unit test that fails if you would move up consume to be called before auth?
Otherwise I prefer it if you can add such a unit test :)
Typically create an account, Alice
Try creating account and abort/reject.
Try crating account, Bob, again this time Auth.
Assert that Bobs VECI derivation entity Index is that of Alice+1 and not +2.
Should do it right?
And then analogously for Persona
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.
Interesting, will try that, indeed adds value.
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.
Take a look at the last commits. I had to change a bit the API of the TestAuthorizationInteractor
.
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.
Not pushed yet?
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.
No, sorry waiting for pre-commit
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.
You can check now
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.
Looks great
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, just missing test which fails If we were to refactor order of things
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #356 +/- ##
=======================================
Coverage 92.59% 92.59%
=======================================
Files 1169 1170 +1
Lines 26153 26248 +95
Branches 81 81
=======================================
+ Hits 24217 24305 +88
- Misses 1925 1932 +7
Partials 11 11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
[email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] Generated by cargo-workspaces
A new interactor responsible for asking the user through the host to authorise an operation. Such operation is called
AuthorizationPurpose
and it currently supports variants for creating one or batch accounts, or one or batch personas.If the user rejects authorization, then such operation does not mutate the profile, nor does consume the cache.The user can either
AuthorizationResponse::Authorized
orAuthorizationResponse::Rejected
.Note that, I also changed the name of the error used to be called
SigningRejected
toHostInteractionAborted
. It can be thrown by hosts when answering to the interactor callbacks, and returned back to the method that initiated the interaction. It is a "common result" that hosts receive and can just reset the UI for the user to try again.