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

Turn on basic auth? #32

Closed
liamawhite opened this issue May 2, 2017 · 6 comments
Closed

Turn on basic auth? #32

liamawhite opened this issue May 2, 2017 · 6 comments

Comments

@liamawhite
Copy link

liamawhite commented May 2, 2017

I've had a look through this repo and the actual broker repo and can't seem to find instructions to turn on basic auth and set the credentials for the broker (as opposed to the database user/pass). I am guessing its going to be something to do with pact_broker/config.ru?

@bethesque
Copy link
Contributor

@mefellows we'll need to do a code change for this as per https://github.com/bethesque/pact_broker/blob/master/example/basic_auth/config.ru#L7

We can make it configurable based on the presence of the environment vars, eg

if ENV['PACT_BROKER_USERNAME']
  use Rack::Auth::Basic, "Restricted Area" do |username, password|
    username == ENV['PACT_BROKER_USERNAME'] and password == 
  ENV['PACT_BROKER_PASSWORD']
  end
end

@mefellows
Copy link
Contributor

Yeah I think something like that would be ideal. Potentially down the track there could be a way to pass in a configuration file (similar to an Apache .htaccess file) so that it's not a single all-knowing user.

Long term, we would look at OAuth/SAML etc. But this will probably more appropriately live in pact.dius.com.au.

@bethesque
Copy link
Contributor

Agreed, it's a short term quick fix solution. We need to put proper auth into the hosted ones.

@bethesque
Copy link
Contributor

Question - should the basic auth apply to the healthcheck URL?

@mefellows
Copy link
Contributor

mefellows commented May 3, 2017 via email

@bethesque
Copy link
Contributor

It was too fiddly! Everything is basic authed, or not for now.

eb89b61

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

No branches or pull requests

3 participants