-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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(settings): Expose all identities in user settings #29230
Conversation
Show a user's entry from the Identity and AuthIdentity tables in the user "Identities" settings view, in addition to UserSocialAuth identities. Add UI elements to explain the difference between the identity types. Allow the new identities to be manually disconnected at the user's choice, but not if doing so would lock them out of their account or an organization. TODO: - Tests - Design review on UI changes
""" | ||
|
||
identities = list(get_identities(user)) | ||
return Response(serialize(identities)) |
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 need to consider paginating this endpoint? haha 💀
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.
or i guess, handle if they have too many identities.
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.
😅 I'm hoping we can just punt pagination. It would be awkward because the results span multiple models, are interdependent, and don't have a natural order. It's totally doable, but my impression is that it would be a lot of code without a lot of need.
It helps that, since the platform supports a finite number of providers, there is a natural ceiling to the number of identities you can have on one account (at least without belonging to an unbounded number of organizations and having one AuthIdentity
for each).
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.
backend stuff looking good to me 👍🏼
(Oops, had accidentally reverted this. The import in endpoints/user_identity_config.py was just broken.)
size-limit report
|
|
||
|
||
@dataclass(eq=True, frozen=True) | ||
class UserIdentityConfig: |
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.
very nice
Co-authored-by: Evan Purkhiser <evanpurkhiser@gmail.com>
Co-authored-by: Evan Purkhiser <evanpurkhiser@gmail.com>
A note about deployment: this needs to go out near-concurrently with https://github.com/getsentry/getsentry/pull/6536. If there is any lag time between the two (because of having to wait on CI) that's not bridged with a deployment freeze, the consequence is that deletion protection for global login identities would be disabled during that window. (That is, users with only one global login identity and no password would not be stopped from disconnecting that identity.) Considering this is an obscure corner of the settings page and it's unlikely a user would both stumble across it and do something stupid during this window, I think this is okay? They'd still be able to do a password reset even in the worst case. Anyway, if the risk is unacceptable, there are a few alternatives: the simplest would be to temporarily hard-code the affected providers and then do another PR to remove the hard-coding afterward. I'm happy to do it the safer way if someone can volunteer to stand by and click "approve" on the extra PR. But I believe the risk is acceptably minimal with the simpler way. |
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
Show a user's entry from the Identity and AuthIdentity tables in the
user "Identities" settings view, in addition to UserSocialAuth
identities. Add UI elements to explain the difference between the
identity types. Allow the new identities to be manually disconnected at
the user's choice, but not if doing so would lock them out of their
account or an organization.