Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UserHandler ¶
func UserHandler(w http.ResponseWriter, r *http.Request)
UserHandler returns the information of the authenticated user.
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
Auth is the struct for handling authorization for resources.
func New ¶
func New(enabled bool, headerUser, headerTeams, sessionToken string, sessionInterval time.Duration, clustersClient clusters.Client) *Auth
New returns a new authentication and authorization object.
func (*Auth) Handler ¶
Handler is the handler for the auth middleware. In the middleware we check if authentication is enabled. If this is the case we check if the request contains a valid jwt cookie in the "kobs-auth" token. If we do not found a valid token we try to create a new one and set it as cookie, before we return an unauthorized error. If the authorization succeeds we also inject the user in the request context.
Click to show internal directories.
Click to hide internal directories.