Open rob-murray opened 10 years ago
Hi Rob, I've had a first go at this. I've put the credentials in as arguments. Password could probably be pulled in from the environment rather than being put on the command line. Also, I'm happy to take a go at adding a config file. Maybe something using yaml or yaml/store ?
Hi Rob - I scrapped the first go at this. Here's my second take:
https://github.com/dkam/ferver/tree/basic_auth_take_2
I can send it as a pull request if that easier.
I've restructured things a bit so that we can first process the options and determine if we have a username passed in, then start Sinatra. I couldn't see how to require 'ferver' ( starting the app ) and then process options and add in the Sinatra::Auth::Basic middleware.
Any thoughts?
How about adding capability of Basic Auth? By default is off, if a config file is present then take credentials and authenticate URIs with Basic Auth?