mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-08-13 16:39:21 +02:00

This adds a couple of key improvements to the Forward Auth SSO implementation. Primarily it adds an included cookies setting which allows filtering cookies to the authorization server. Secondly it fixes a bug where the headerCopyIncluded function was case-sensitive. Documentation in the code and on the web UI is clearer to resolve some common questions and issues. Lastly it moves a lot of funcs to the util.go file and adds fairly comprehensive tests.
48 lines
1.2 KiB
Go
48 lines
1.2 KiB
Go
package forward
|
|
|
|
import "errors"
|
|
|
|
const (
|
|
LogTitle = "Forward Auth"
|
|
|
|
DatabaseTable = "auth_sso_forward"
|
|
|
|
DatabaseKeyAddress = "address"
|
|
DatabaseKeyResponseHeaders = "responseHeaders"
|
|
DatabaseKeyResponseClientHeaders = "responseClientHeaders"
|
|
DatabaseKeyRequestHeaders = "requestHeaders"
|
|
DatabaseKeyRequestIncludedCookies = "requestIncludedCookies"
|
|
DatabaseKeyRequestExcludedCookies = "requestExcludedCookies"
|
|
|
|
HeaderXForwardedProto = "X-Forwarded-Proto"
|
|
HeaderXForwardedHost = "X-Forwarded-Host"
|
|
HeaderXForwardedFor = "X-Forwarded-For"
|
|
HeaderXForwardedURI = "X-Forwarded-URI"
|
|
HeaderXForwardedMethod = "X-Forwarded-Method"
|
|
|
|
HeaderCookie = "Cookie"
|
|
|
|
HeaderUpgrade = "Upgrade"
|
|
HeaderConnection = "Connection"
|
|
HeaderTransferEncoding = "Transfer-Encoding"
|
|
HeaderTE = "TE"
|
|
HeaderTrailers = "Trailers"
|
|
HeaderKeepAlive = "Keep-Alive"
|
|
)
|
|
|
|
var (
|
|
ErrInternalServerError = errors.New("internal server error")
|
|
ErrUnauthorized = errors.New("unauthorized")
|
|
)
|
|
|
|
var (
|
|
doNotCopyHeaders = []string{
|
|
HeaderUpgrade,
|
|
HeaderConnection,
|
|
HeaderTransferEncoding,
|
|
HeaderTE,
|
|
HeaderTrailers,
|
|
HeaderKeepAlive,
|
|
}
|
|
)
|