-
Notifications
You must be signed in to change notification settings - Fork 996
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
warehouse: OIDC beta flag/controls #13073
Conversation
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
We need to do this explicitly, since traversing `Project` means that `RootFactory` is not traversed. Signed-off-by: William Woodruff <[email protected]>
These need to be handled separately in `Project.__acl__`. Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
This comment was marked as outdated.
This comment was marked as outdated.
Signed-off-by: William Woodruff <[email protected]>
Just remembered another thing I need to do here: the admin panel should allow Warehouse's admins to enable/disable OIDC beta status for a user. |
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Use the feature flag directly. Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
This should be good to go -- I've added the |
@@ -96,6 +96,9 @@ class User(SitemapMixin, HasEvents, db.Model): | |||
totp_secret = Column(LargeBinary(length=20), nullable=True) | |||
last_totp_value = Column(String, nullable=True) | |||
|
|||
# XXX: Can be removed once OIDC is removed from beta. | |||
has_oidc_beta_access = Column(Boolean, nullable=False, server_default=sql.false()) |
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.
Bleh, I'm -1 on a column directly on the User model, but won't block the PR on this.
The aspiration was a more extensible AdminFlags or similar to manage this kind of thing, but obviously that hasn't come to fruition 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.
AdminFlags are just global flags that can be set by admins -- they don't allow us to set per-user flags (unless we want to overhaul them, which is probably out of scope here).
We tried to do this with ACLs but given how this currently works with the User model, it was a bit more janky than this, which will be temporary.
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, I'm not super happy with this approach either, but I think it's the shortest + lowest friction path here.
Signed-off-by: William Woodruff <[email protected]>
Co-authored-by: Dustin Ingram <[email protected]>
If the user can see OIDC publishers because a beta user has added them but is not themselves in the OIDC beta, we disable the OIDC form's button. The form would 403 anyways; this just prevents obvious misuse. Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
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 aside from two tweaks
Signed-off-by: William Woodruff <[email protected]>
Co-authored-by: Dustin Ingram <[email protected]>
WIP.See #12965.