-
Notifications
You must be signed in to change notification settings - Fork 963
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
Refactor: Migrate to 2.0-style security policies #11218
Conversation
This currently partially works (I can log in and navigate around), but permissions are currently broken for reasons I haven't fully debugged (trying to manage projects returns a |
This needs a lot of testing, but the basic structure is here:
...where |
Punt principal handling further down, remove the generic identity implementation, etc. etc.
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.
This is the main blocker for #11272, which will "finish" the core functionality here (allowing a user to go from a JWT to an ephemeral API token). |
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.
This is ready to merge once this last comment is addressed.
…i#11218)" (pypi#11313)" This reverts commit 3b9a831.
* warehouse: begin using security policies WIP. * Remove pyramid-multiauth, begin switching to security policies * migrations: remove incorrectly checked in migrations * warehouse: fix principals a little bit * warehouse: begin using real security policies Also fixes the weirdness with ACLs. * warehouse: port basic auth * warehouse: port macaroon policy, remove transition shim * utils/security_policy: fix principals Again. * warehouse: fix lint * tests/unit: rename-o-rama * Improve the readabililty of the overall diff * warehouse: refactor security policies Punt principal handling further down, remove the generic identity implementation, etc. etc. * macaroons/security_policy: remove redundant route check * accounts/security_policy: lint * Update warehouse/utils/security_policy.py Co-authored-by: Joachim Jablon <ewjoachim@gmail.com> * macaroons/security_policy: avoid a DB roundtrip * utils/security_policy: simplify principals, add comment * utils/security_policy: re-add id principal * warehouse: disambiguate user IDs inside the principal set * packaging/models: blacken * tests, warehouse: the long and winding road * tests/packaging: fix ACL tests * tests, warehouse: rewrite account security policy tests * macaroons: make the tests pass * tests: finish tests * warehouse: move session invalidation to session authn * tests, warehouse: update tests * utils/security_policy: authenticated_userid only works for user identities * tests: update utils/security_policy tests Co-authored-by: Dustin Ingram <di@users.noreply.github.com> Co-authored-by: Joachim Jablon <ewjoachim@gmail.com>
pypi#11313) This reverts commit 975a485.
…i#11218)" (pypi#11313)" (pypi#11315) This reverts commit 3b9a831.
Very WIP; pushing up for visibility.Closes #11211.
Closes #11252.