Skip to content

Commit

Permalink
docs: Add document to constant AuthProxyUserKey and `BasicAuthForPr…
Browse files Browse the repository at this point in the history
…oxy`. (#3887)
  • Loading branch information
EndlessParadox1 authored Mar 13, 2024
1 parent 990c44a commit ee70b30
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import (

// AuthUserKey is the cookie name for user credential in basic auth.
const AuthUserKey = "user"

// AuthProxyUserKey is the cookie name for proxy_user credential in basic auth for proxy.
const AuthProxyUserKey = "proxy_user"

// Accounts defines a key/value for user/pass list of authorized logins.
Expand Down Expand Up @@ -92,6 +94,7 @@ func authorizationHeader(user, password string) string {
}

// BasicAuthForProxy returns a Basic HTTP Proxy-Authorization middleware.
// If the realm is empty, "Proxy Authorization Required" will be used by default.
func BasicAuthForProxy(accounts Accounts, realm string) HandlerFunc {
if realm == "" {
realm = "Proxy Authorization Required"
Expand Down

0 comments on commit ee70b30

Please sign in to comment.