-
Notifications
You must be signed in to change notification settings - Fork 626
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
Define admin users and extend AuthCheck
to handle them
#6456
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.
just a first glance review... I'll take a closer look tomorrow 😉
Updated per review. Definitely simpler this way, so thanks! I don't love the drilling of |
This comment was marked as outdated.
This comment was marked as outdated.
This adds a concept of admin users, who are defined by their GitHub IDs, and allows them to be defined through an environment variable.
This will make it easier to test the logic in the future.
This function can be used to require that the current cookie or token belong to an admin user.
28d359a
to
877755b
Compare
Closing in favour of #7852. |
This adds a concept of admin users, who are defined by their GitHub IDs, and allows them to be defined through an environment variable, falling back to a static list of the current
crates.io
team.AuthCheck
now has a builder method to require that the current cookie or token belong to an admin user.In the future, this will be extended to use Rust's team API for the fallback.