dcos-net
dcos-net copied to clipboard
add mesos basic auth
This PR will add the basic auth method to authenticate against the mesos master. Then the nice DC/OS net is also useful for "normal" mesos installations without authentication token. The authentication string have to be in a env variable and should looks like MESOS_BASIC_AUTH="Basic <BASE64STRING>".
Can one of the admins verify this patch?
Codecov Report
Merging #169 into master will decrease coverage by
0.01%. The diff coverage is80%.
@@ Coverage Diff @@
## master #169 +/- ##
==========================================
- Coverage 67.94% 67.92% -0.02%
==========================================
Files 55 55
Lines 3584 3588 +4
==========================================
+ Hits 2435 2437 +2
- Misses 1149 1151 +2
| Flag | Coverage Δ | |
|---|---|---|
| #ct | 48.24% <80%> (ø) |
:arrow_up: |
| #ct2 | 48.24% <80%> (ø) |
:arrow_up: |
| #eunit | 24.52% <80%> (+0.05%) |
:arrow_up: |
| Impacted Files | Coverage Δ | |
|---|---|---|
| apps/dcos_net/src/dcos_net_mesos.erl | 74.07% <80%> (+0.04%) |
:arrow_up: |
| apps/dcos_l4lb/src/dcos_l4lb_mgr.erl | 82.56% <0%> (-0.33%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update fe204b5...4f59756. Read the comment docs.
Codecov Report
Merging #169 (0db6fde) into master (7bd01ac) will increase coverage by
0.00%. The diff coverage is80.00%.
@@ Coverage Diff @@
## master #169 +/- ##
=======================================
Coverage 66.00% 66.01%
=======================================
Files 55 55
Lines 3759 3763 +4
=======================================
+ Hits 2481 2484 +3
- Misses 1278 1279 +1
| Flag | Coverage Δ | |
|---|---|---|
| ct | 46.00% <80.00%> (+0.03%) |
:arrow_up: |
| ct2 | 46.00% <80.00%> (+0.03%) |
:arrow_up: |
| eunit | 24.84% <80.00%> (+0.05%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| apps/dcos_net/src/dcos_net_mesos.erl | 74.07% <80.00%> (+0.04%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 7bd01ac...0db6fde. Read the comment docs.
@andreaspeters, thanks a lot for your contribution!
It is preferred not to supply individual configuration values through environment variables. Please refer to https://github.com/dcos/dcos-net/blob/master/apps/dcos_net/src/dcos_net_app.erl#L45 to learn more about the way dcos-net gets configured.
By default, dcos-net looks for configuration files under /opt/mesosphere/etc/dcos-net.config.d, which can be overwritten, for instance, through its application environment variable: config_dir. Please note that configuration files should be written in the Erlang term format.
Hi @ichernetsky , thanks for your response.
Actually, I'm not a Erlang dev, I just copy 'n paste what I already found in your code. And you already use a lot of os:getenv(""). :-) Well, for me it would not be easy to change it like u prefer. But now, you know and I think you understand why I wish me to have basic auth in dcos-net. If someone can add this feature (with a better peace of code), I would be very happy about it. :-)