diff options
| author | James Elliott <james-d-elliott@users.noreply.github.com> | 2021-12-02 13:21:46 +1100 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-02 13:21:46 +1100 | 
| commit | bf9ab360bd8dd46739d4aa0018ceb4c08e05dba8 (patch) | |
| tree | 530f43f59e3a4dc4c0bf0256b443c5777bb7142c /internal/handlers/const.go | |
| parent | f3f3b31b12a87586770c5cfaf646a9e85a724089 (diff) | |
refactor(handlers): utilize referer for auth logging rm/rd (#2655)
This utilizes the referrer query parameters instead of current request query parameters for logging the requested URI and method. Minor performance improvements to header peek/sets.
Diffstat (limited to 'internal/handlers/const.go')
| -rw-r--r-- | internal/handlers/const.go | 25 | 
1 files changed, 12 insertions, 13 deletions
diff --git a/internal/handlers/const.go b/internal/handlers/const.go index fe292e72c..d3bc4e986 100644 --- a/internal/handlers/const.go +++ b/internal/handlers/const.go @@ -1,5 +1,9 @@  package handlers +import ( +	"github.com/valyala/fasthttp" +) +  const (  	// ActionTOTPRegistration is the string representation of the action for which the token has been produced.  	ActionTOTPRegistration = "RegisterTOTPDevice" @@ -11,20 +15,15 @@ const (  	ActionResetPassword = "ResetPassword"  ) -const ( -	// HeaderProxyAuthorization is the basic-auth HTTP header Authelia utilises. -	HeaderProxyAuthorization = "Proxy-Authorization" - -	// HeaderAuthorization is the basic-auth HTTP header Authelia utilises with "auth=basic" query param. -	HeaderAuthorization = "Authorization" - -	// HeaderSessionUsername is used as additional protection to validate a user for things like pam_exec. -	HeaderSessionUsername = "Session-Username" +var ( +	headerAuthorization      = []byte(fasthttp.HeaderAuthorization) +	headerProxyAuthorization = []byte(fasthttp.HeaderProxyAuthorization) -	headerRemoteUser   = "Remote-User" -	headerRemoteName   = "Remote-Name" -	headerRemoteEmail  = "Remote-Email" -	headerRemoteGroups = "Remote-Groups" +	headerSessionUsername = []byte("Session-Username") +	headerRemoteUser      = []byte("Remote-User") +	headerRemoteGroups    = []byte("Remote-Groups") +	headerRemoteName      = []byte("Remote-Name") +	headerRemoteEmail     = []byte("Remote-Email")  )  const (  | 
