Skip to content
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(auth): Add copy for account-linking verification #28931

Merged
merged 8 commits into from
Sep 30, 2021

Conversation

RyanSkonnord
Copy link
Contributor

Pass additional arguments from AuthIdentityHandler to make the message more informative.

@RyanSkonnord RyanSkonnord requested a review from a team September 29, 2021 01:39
organization: Organization
provider_name: str
email: str
identity_id: str
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope this refactoring doesn't seem gratuitous. Otherwise, it would have been necessary to duplicate both the org and provider name between the parameter lists for the two functions, which tripped my personal "time to gather everything into a class" threshold.

The "hide whitespace changes" setting should cut down on the diff noise.

@RyanSkonnord
Copy link
Contributor Author

The new confirmation prompt page:

Screen Shot 2021-09-28 at 6 03 07 PM

A mockup of the email body (HTML):

Screen Shot 2021-09-28 at 6 02 49 PM

Copy link
Member

@JoshFerge JoshFerge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me. nit about comment and ideas for further refactorings added.

organization=self.organization, user=self.user
).id

verification_code = get_random_string(32, string.ascii_letters + string.digits)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it be worth moving verification_code to init (or post_init i think since its a dataclass), and also perhaps moving the redis functionality into its own class / function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both sound good. @maxiuyuan, we could work on those changes together?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup for sure!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moving the redis functionaility to its own function is already done in another pr

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I'll be waiting to merge this until one or two of those dev branches are finished. I'll have to shake out a few merge conflicts but it won't be a problem.

Copy link
Contributor

@maxiuyuan maxiuyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

everything lgtm, do we want to move verification_code to init like josh suggested? if not i can approve once sasha and dave gives the final 👍 on the mock-ups

@RyanSkonnord
Copy link
Contributor Author

Screen Shot 2021-09-29 at 3 13 46 PM
Screen Shot 2021-09-29 at 3 13 59 PM

@RyanSkonnord
Copy link
Contributor Author

RyanSkonnord commented Sep 30, 2021

do we want to move verification_code to init like josh suggested?

Yes, the only detail I wanted to run by you is how it changes the unit tests.

@RyanSkonnord
Copy link
Contributor Author

Ready for review. I believe we're done revising the mock-ups.

@maxiuyuan The unit test changes on 81b73ab turned out not to be too complicated -- mainly it was about trading the mock injection in test_send_one_time_account_confirm_link for an assertion, and rearranging the send_one_time_account_confirm_link function a bit so that it returns something to assert on.

Copy link
Contributor

@maxiuyuan maxiuyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@RyanSkonnord RyanSkonnord merged commit 5d7f984 into master Sep 30, 2021
@RyanSkonnord RyanSkonnord deleted the idp-automatic-migration-user-copy branch September 30, 2021 20:37
@github-actions github-actions bot locked and limited conversation to collaborators Oct 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants