-
Notifications
You must be signed in to change notification settings - Fork 986
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
Managing API tokens with pypitoken
#9184
Comments
So first problem identified: The idea of pypitoken is to make an abstraction layer between the macaroon & caveat format and PyPI. While it works great for generating & checking macaroon, I've noticed that we keep a copy of one caveat in the DB, so that we can display information on the restriction in the UI, with the following problems:
Things to keep in mind:
|
I took a pass through #9264 and while I think the PR is solid, and that I'm curious if there might be a compromise where the Overall, I'd be interested in seeing the short term fixes for #9018 split out, if possible, so that they aren't blocked on us figuring this out. |
Thanks for your input :) I think this is not exactly the first time that a part of the logic is taken out of the repository, there's:
The idea behind splitting this project out is that this lets us have a more scoped approach, and lessen the pressure on the warehouse maintainers, but I've always considered that if we do it, the warehouse maintainers will also be maintainers for Regarding the testing coverage, you'll note that Also, keeping strong boundaries within the code itself is, I think, a good way to enforce those boundaries in the future, and avoid having them breached in the future just because people are not enough aware that those boundaries are not to be breached. For example in this specific case, this makes it very clear where the code for generating tokens and implementing their logic is, versus the code for integrating this into warehouse. With all that being said, I'm not opposed at all to your solution of "vendoring" the project, this could work, it's just that it would only partially solve the existing problem that I guess kept us from going further in the development of caveats so far, the very limited bandwidth for developments in the warehouse codebase from the core maintainers. But if you think there's still value in having a solution where we integrate Note that it will probably lead to a few PRs and... Well I'm a bit uncomfortable making the point out loud, but... I don't want to seem demanding but I see that this issue/PR has sit almost 1 year without your point being raised/discussed. I fully understand that there is limited bandwidth and other priorities. What is unclear to me at this point is "what would change if I do it" ? If maintainers didn't have the bandwidth for working on merging a PR that offloads some work to another lib, will you have time to work on merging PR(s) that does the same work AND adds a "vendored" lib AND adds a mechanism for publishing that lib, etc ? To be a bit more blunt, and I hope this will not come out in a bad way, I've spent a non-trivial amount of my 2021 open-source time for this with, so far, very limited (if even existant) impact. I'm slightly hesitant spending quite some more in 2022 with no idea if it will actually help driving the impact level up :) |
This would be the first time we've extracted something directly responsible for authentication/authorization. The trove classifiers aren't exactly in the critical path 🙂 (The rest of these were never actually part of this codebase). Also note that as the current maintainer of
I appreciate that and also assumed that would be the case. However: while I can't speak for other maintainers, personally having another separate project to keep track of is generally not going to make things easier for me, or give me more bandwidth, which is the main reason why I'm curious to explore if
Yep, and I'm sorry for that. As a frequent & valued contributor we should have started this discussion with you earlier (in reality, probably when this issue was created and before you drafted a PR). Please note that it's not because the PR is bad in any way, it's just a) not particularly high priority and b) somewhat security-sensitive, so it requires a bit more thought.
I think you definitely shouldn't do any more work here until we have some consensus, so I'll ask @ewdurbin to chime in as well. |
I don't have an opinion against migrating to an |
This ticket is the counterpart for that discussion for discussing the integration of pypitoken into warehouse. I might start working on the PR at some point, but if there are huge structural problems to doing so, or things that should be figured out beforehand, I'll gladly welcome remarks before working on the integration :)
I plan to remove
caveats.py
, and have the Macaroons service use pypitoken directly. This should simplify code. Also, the Form for creating tokens will likely be simplified too, as it currently holds some information on the caveats JSON structure, which is not needed ifpypitoken
takes responsibility for crafting tokens. All in all, I hope, we'll remove much more code than we'll add, while making future evolutions easier.The text was updated successfully, but these errors were encountered: