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 http basic authentication support #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aitjcize
Copy link

Add HTTP basic auth support. Account/password is read from a htpassword file.
To enhance security, only the bcrypt encryption scheme is supported.

The htpasswd file can be generated with the following command:

htpasswd -B -c htpasswd username

The auth.go file is taken from the chromiumos project and I'm the original author of the file.

@aitjcize aitjcize force-pushed the master branch 4 times, most recently from 60f596b to 0ba5f81 Compare April 21, 2018 13:29
web/web.go Outdated
mux.HandleFunc("/api/urls/", func(w http.ResponseWriter, r *http.Request) {
apiURLs(ctx, w, r)
})
auth := NewBasicAuth("cobinhood", htpasswd)

Choose a reason for hiding this comment

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

  1. cobinhood?
  2. what if I want to disable the auth?

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

Successfully merging this pull request may close these issues.

2 participants