-
Notifications
You must be signed in to change notification settings - Fork 14
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
added basic authentication #76
Conversation
@@ -12,6 +12,12 @@ class AptlySnapshot | |||
config = AptlyCli::AptlyLoad.new.configure_with("/etc/aptly-cli.conf") | |||
base_uri "http://#{config[:server]}:#{config[:port]}/api" | |||
|
|||
if config[:username] | |||
if config[:password] | |||
basic_auth "#{config[:username]}", "#{config[:password]}" |
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.
Prefer to_s
over string interpolation.
Thanks @morph027 for the PR! Ill check it out. What is the best way to test this? Perhaps setup a private Travis CI account to upload into? |
I'll just put a nginx instance as reverse proxy in front of the API like this simple snippet:
Then create a .htpasswd:
Let nginx access it:
Then you should be able to access it on port 80 using basic auth. |
Ok great! I'll use this to generate the VCR mock data to test with. After I On Mon, Mar 14, 2016, 12:21 PM morph027 notifications@github.com wrote:
|
Thank you for your contribution! Merged and updated gem version to 0.2.2 |
I'm proof-concepting to upload packages from a CI of your favourite choise to a aptly repo. As these are not compulsory on the same host (e.g. Travis CI/Gitlab CI/Drone/... to a private repo), the API is protected using basic authentication at the moment. Therefore i've added 2 new config values and the HTTParty option including README update.
By the way: Thanks for your gem ;)