Skip to content
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

Feature/auther via cmd option #162

Conversation

sakurai-youhei
Copy link
Contributor

Because I'd like to use pypiserver with own auth provider via python -m pypiserver, I had motivation to introduce new command line option named --auther. FYI: I also fixed small problems eventually brought to me when preparing this pull-request.

@@ -235,7 +243,7 @@ def main(argv=None):
c.password_file = v
elif k in ("-o", "--overwrite"):
c.overwrite = True
elif k in ("--hash-algo"):
elif k == "--hash-algo":
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason of this change is that -h was not working due to the fact that ("--hash-algo") is equivalent to "--hash-algo" which contains `"-h"``.

@ankostis
Copy link
Member

Thank you for the fix, and apologies for the long response time.

try:
mod, _, func = v.rpartition(".")
if mod:
c.auther = getattr(importlib.import_module(mod), func)
Copy link
Member

@ankostis ankostis Sep 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using importlib is an indicator that you need an extension mechanism; *setuptools8 provide an excellent such mechanism through the entry_points.
I prefer to leave this commit to wait until we introduce "plugins."

@ankostis ankostis closed this in c6c634b Sep 24, 2016
@ankostis ankostis added this to the Next Release milestone Sep 24, 2016
@ankostis ankostis self-assigned this Sep 24, 2016
luismsgomes pushed a commit to luismsgomes/pypiserver that referenced this pull request Feb 15, 2017
@petri
Copy link

petri commented Dec 2, 2017

I need ability for more granular authentication: basically ability to have read-only users and also read+write (upload) users. That afaik is not possible currently.

Can we start an issue to design the first version of an authentication interface & plugin mechanism that would allow to satisfy what @sakurai-youhei needs and also support more granular user-permission handling? I think using ABCs and matching entrypoints (by name) would work well. Or is the basic plugin implementation mechanism something that still needs more thought?

@mplanchard
Copy link
Contributor

mplanchard commented Dec 2, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants