mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2025-02-03 13:21:51 +02:00
b625de9490
This allows for proper handling of reverse proxy based headers throughout the lifecycle of a request.
29 lines
910 B
Go
29 lines
910 B
Go
package middleware
|
|
|
|
import (
|
|
"github.com/oauth2-proxy/oauth2-proxy/v7/pkg/apis/sessions"
|
|
)
|
|
|
|
// RequestScope contains information regarding the request that is being made.
|
|
// The RequestScope is used to pass information between different middlewares
|
|
// within the chain.
|
|
type RequestScope struct {
|
|
// ReverseProxy tracks whether OAuth2-Proxy is operating in reverse proxy
|
|
// mode and if request `X-Forwarded-*` headers should be trusted
|
|
ReverseProxy bool
|
|
|
|
// Session details the authenticated users information (if it exists).
|
|
Session *sessions.SessionState
|
|
|
|
// SaveSession indicates whether the session storage should attempt to save
|
|
// the session or not.
|
|
SaveSession bool
|
|
|
|
// ClearSession indicates whether the user should be logged out or not.
|
|
ClearSession bool
|
|
|
|
// SessionRevalidated indicates whether the session has been revalidated since
|
|
// it was loaded or not.
|
|
SessionRevalidated bool
|
|
}
|