plack / Plack

PSGI toolkit and server adapters
http://plackperl.org/
Other
486 stars 214 forks source link

Add `auth-basic.psgi` example #709

Closed rwp0 closed 4 months ago

rwp0 commented 4 months ago

This illustrates the point referenced in Plack's Auth::Basic middleware:

Using Authen::Simple::Passwd (file) to authenticate against

rwp0 commented 4 months ago

Authenticator can also be an object that responds to authenticate method that takes username and password and returns boolean, so backends for Authen::Simple is perfect to use

After successfully achieving this reading the hint/reference in the documentation I wanted to save the working code somewhere (eg. in the examples) so it is kept and others could benefit from it as well.

It's OK to reject the PR (at least I tried) 🙂.

miyagawa commented 4 months ago

I don't think anybody reads the code in eg directory. If you think the Auth::Basic documentation is lacking, I think it's much more effective to update its documentation rather than putting some random code in this directory.

miyagawa commented 4 months ago

added the example with Authen::Simple::Passwd in 24b3867

rwp0 commented 4 months ago

documentation

At least, I do, and those example files were very useful for me to understand how to set up a particular thing 🙂

added the example with Authen::Simple::Passwd in https://github.com/plack/Plack/commit/24b3867f135b78e816d403dbb2768efd3ab7e471

Okay, that works too, thanks!