gianarb / orbiter

Orbiter is an opensource docker swarm autoscaler
Apache License 2.0
505 stars 54 forks source link

Add http basic auth based on env vars #33

Open gianarb opened 7 years ago

gianarb commented 7 years ago

@mbovo this is good. I am thinking about how to make it optional. I mean if we don't inject the env vars we are still requiring an empty auth

mbovo commented 7 years ago

@gianarb I've added a flag to enable (default disabled) authentication, with default user/pass (orbiter/orbiter) just in case. I'm using kelseyhightower/envconfig here to read custom configuration from env, seems a good lib. As improvement in https://github.com/mbovo/orbiter/commit/59758b2c062b1b47ccd8ca4770b2f83798aa1754 i've added a map for multiple user/pass.

I think configuration like this should be placed in global conf and propagated, instead of using repeated code. I will open another proposal/pr for this last point.

gianarb commented 7 years ago

I like the mapping idea. I dont think we need library to read some envvar. I think the os package is enough