Documentation ¶
Overview ¶
Package contexthandler contains the ContextHandler service.
Index ¶
Constants ¶
View Source
const ( InvalidUsernamePassword = "invalid username or password" // False positive. //nolint:gosec InvalidAPIKey = "invalid API key" )
View Source
const InvalidJWT = "Invalid JWT"
View Source
const ServiceName = "ContextHandler"
View Source
const UserNotFound = "User not found"
Variables ¶
This section is empty.
Functions ¶
func FromContext ¶
func FromContext(c context.Context) *models.ReqContext
FromContext returns the ReqContext value stored in a context.Context, if any.
Types ¶
type AuthHTTPHeaderList ¶
type AuthHTTPHeaderList struct {
Items []string
}
AuthHTTPHeaderList used to record HTTP headers that being when verifying authentication of an incoming HTTP request.
func AuthHTTPHeaderListFromContext ¶
func AuthHTTPHeaderListFromContext(c context.Context) *AuthHTTPHeaderList
AuthHTTPHeaderListFromContext returns the AuthHTTPHeaderList in a context.Context, if any, and will include any HTTP headers used when verifying authentication of an incoming HTTP request.
type ContextHandler ¶
type ContextHandler struct { Cfg *setting.Cfg AuthTokenService models.UserTokenService JWTAuthService models.JWTService RemoteCache *remotecache.RemoteCache RenderService rendering.Service SQLStore sqlstore.Store // GetTime returns the current time. // Stubbable by tests. GetTime func() time.Time // contains filtered or unexported fields }
ContextHandler is a middleware.
func ProvideService ¶
func ProvideService(cfg *setting.Cfg, tokenService models.UserTokenService, jwtService models.JWTService, remoteCache *remotecache.RemoteCache, renderService rendering.Service, sqlStore sqlstore.Store, tracer tracing.Tracer, authProxy *authproxy.AuthProxy, loginService login.Service, authenticator loginpkg.Authenticator) *ContextHandler
func (*ContextHandler) Middleware ¶
func (h *ContextHandler) Middleware(mContext *web.Context)
Middleware provides a middleware to initialize the Macaron context.
Click to show internal directories.
Click to hide internal directories.