Add request scope middleware

This commit is contained in:
Joel Speed
2020-07-19 17:21:42 +01:00
parent 1aac37d2b1
commit 2768321929
3 changed files with 157 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
package middleware
import (
"github.com/oauth2-proxy/oauth2-proxy/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 {
// 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
}