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

Add basic auth for ecs #2026

Merged
merged 2 commits into from
Sep 7, 2017
Merged

Conversation

mmatur
Copy link
Member

@mmatur mmatur commented Aug 30, 2017

Description

Implements frontend basic auth for ecs provider.

This addresses the ecs part of #1465

}

for _, c := range cases {
c := c
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could rename c to test?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can rename all c 😃

| `traefik.frontend.passHostHeader=true` | forward client `Host` header to the backend. |
| `traefik.frontend.priority=10` | override default frontend priority |
| `traefik.frontend.entryPoints=http,https` | assign this frontend to entry points `http` and `https`. Overrides `defaultEntryPoints`. |
| `traefik.frontend.auth.basic=test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/,test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0` | Sets basic authentication for that frontend with the usernames and passwords test:test and test2:test2, respectively |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you replace by

| `traefik.frontend.auth.basic=EXPR`                | Sets basic authentication for that frontend in CSV format: `User:Hash,User:Hash` |

Copy link
Contributor

@ldez ldez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@juliens juliens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mmatur mmatur requested review from a team as code owners September 7, 2017 10:11
@ldez ldez changed the base branch from master to v1.4 September 7, 2017 10:11
Copy link
Collaborator

@SantoDE SantoDE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

YEAH. Basic Auth for ECS. Thanks a lot for PR @mmatur :)

LGTM 👼

Copy link
Contributor

@timoreimann timoreimann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question and one suggestion.

Not sure why reviews for Marathon, Kubernetes, and Docker owners were requested. The PR only seems to touch the ECS provider.

}

for _, test := range cases {
c := test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test := test would work as well. No need to change the variable name.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You right. A refactoring of ECS provider has been done in #2050. I will do the change to be consistent with this refactoring

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

func (p *Provider) getBasicAuth(i ecsInstance) []string {
label := i.label(types.LabelFrontendAuthBasic)
if label != "" {
return strings.Split(label, ",")
Copy link
Contributor

@timoreimann timoreimann Sep 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need/also want to check that each basic auth value adheres to the user:hash? I think we should answer the question with yes if it would simplify reporting an error to the user somehow.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ldez This should have been answered prior to merging.

Copy link
Contributor

@ldez ldez Sep 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🐮

@traefiker traefiker merged commit c19cce6 into traefik:v1.4 Sep 7, 2017
@ldez ldez modified the milestones: 1.5, 1.4 Oct 1, 2017
@mmatur mmatur deleted the feature/basic-auth-ecs branch March 21, 2018 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants