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 auth middleware/tripperware #32

Merged
merged 11 commits into from
Jun 12, 2020
Merged

Add auth middleware/tripperware #32

merged 11 commits into from
Jun 12, 2020

Conversation

qneyrat
Copy link
Member

@qneyrat qneyrat commented Mar 5, 2020

No description provided.

middleware/auth_test.go Outdated Show resolved Hide resolved
auth/context.go Show resolved Hide resolved
auth/auth.go Outdated Show resolved Hide resolved
auth/credential.go Outdated Show resolved Hide resolved
tripperware/auth.go Outdated Show resolved Hide resolved
}

func DefaultErrorHandler(err error, writer http.ResponseWriter, _ *http.Request) bool {
http.Error(writer, err.Error(), http.StatusUnauthorized)
Copy link
Member

Choose a reason for hiding this comment

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

https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication

An HTTP response having a 401 statusCode should also return a WWW-Authenticate HTTP header containing the available authorization methods for the requested resource 👍

Copy link
Member

Choose a reason for hiding this comment

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

We ignore the type of authentication method was try so we cannot return the appropriate WWW-Authenticate value
It's currently a developer side override

@codeclimate
Copy link

codeclimate bot commented Jun 12, 2020

Code Climate has analyzed commit 8c6a887 and detected 0 issues on this pull request.

View more on Code Climate.

@instabledesign instabledesign merged commit 19dee9e into master Jun 12, 2020
@instabledesign instabledesign deleted the auth branch June 12, 2020 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants