Documentation
¶
Index ¶
- func LoggerMiddleware(next http.Handler) http.Handler
- func NewCookieMonster(encryptionService ubsecurity.EncryptionService, cookieName string, secure bool, ...) contracts.AuthTokenCookieManager
- type CookieMonster
- func (c *CookieMonster) ClearAuthTokenCookie(w http.ResponseWriter)
- func (c *CookieMonster) IdentityFromContext(ctx context.Context) (contracts.UserIdentity, bool)
- func (c *CookieMonster) Middleware(handler http.Handler) http.Handler
- func (c *CookieMonster) MiddlewareFunc(handler http.HandlerFunc) http.HandlerFunc
- func (c *CookieMonster) ReadAuthTokenCookie(r *http.Request) (bool, contracts.AuthToken, error)
- func (c *CookieMonster) TokenFromContext(ctx context.Context) (contracts.AuthToken, bool)
- func (c *CookieMonster) WriteAuthTokenCookie(w http.ResponseWriter, token contracts.AuthToken) error
- type PermissionMiddleware
- type WebService
- type WebServiceImpl
- func (ws *WebServiceImpl) AddRoute(route contracts.Route) WebService
- func (ws *WebServiceImpl) AddRouteHandler(path string, handler http.Handler) WebService
- func (ws *WebServiceImpl) AddStatic(filepath string, route string) WebService
- func (ws *WebServiceImpl) Start() error
- func (ws *WebServiceImpl) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCookieMonster ¶
func NewCookieMonster( encryptionService ubsecurity.EncryptionService, cookieName string, secure bool, tokenSoftExpiry int64, cookieKey contracts.CookieContextKey, identityKey contracts.IdentityContextKey) contracts.AuthTokenCookieManager
Types ¶
type CookieMonster ¶
type CookieMonster struct {
// contains filtered or unexported fields
}
func (*CookieMonster) ClearAuthTokenCookie ¶
func (c *CookieMonster) ClearAuthTokenCookie(w http.ResponseWriter)
func (*CookieMonster) IdentityFromContext ¶ added in v0.0.20
func (c *CookieMonster) IdentityFromContext(ctx context.Context) (contracts.UserIdentity, bool)
func (*CookieMonster) Middleware ¶
func (c *CookieMonster) Middleware(handler http.Handler) http.Handler
func (*CookieMonster) MiddlewareFunc ¶
func (c *CookieMonster) MiddlewareFunc(handler http.HandlerFunc) http.HandlerFunc
func (*CookieMonster) ReadAuthTokenCookie ¶
func (*CookieMonster) TokenFromContext ¶ added in v0.0.20
func (*CookieMonster) WriteAuthTokenCookie ¶
func (c *CookieMonster) WriteAuthTokenCookie(w http.ResponseWriter, token contracts.AuthToken) error
type PermissionMiddleware ¶ added in v0.0.29
type PermissionMiddleware struct {
// contains filtered or unexported fields
}
func NewPermissionMiddleware ¶ added in v0.0.29
func NewPermissionMiddleware( prefectService ubmanage.PrefectService, cookieManager contracts.AuthTokenCookieManager, ) *PermissionMiddleware
func (*PermissionMiddleware) RequirePermission ¶ added in v0.0.29
func (pm *PermissionMiddleware) RequirePermission(permission string, next http.HandlerFunc) http.HandlerFunc
type WebService ¶ added in v0.0.29
type WebService interface {
AddRoute(route contracts.Route) WebService
AddRouteHandler(path string, handler http.Handler) WebService
Start() error
Stop() error
}
func NewWebService ¶ added in v0.0.29
func NewWebService( port uint, primaryOrganization int64, cookieManager contracts.AuthTokenCookieManager, permMiddleware *PermissionMiddleware) WebService
type WebServiceImpl ¶ added in v0.0.29
type WebServiceImpl struct {
// contains filtered or unexported fields
}
func (*WebServiceImpl) AddRoute ¶ added in v0.0.29
func (ws *WebServiceImpl) AddRoute(route contracts.Route) WebService
func (*WebServiceImpl) AddRouteHandler ¶ added in v0.0.29
func (ws *WebServiceImpl) AddRouteHandler(path string, handler http.Handler) WebService
func (*WebServiceImpl) AddStatic ¶ added in v0.0.29
func (ws *WebServiceImpl) AddStatic(filepath string, route string) WebService
func (*WebServiceImpl) Start ¶ added in v0.0.29
func (ws *WebServiceImpl) Start() error
func (*WebServiceImpl) Stop ¶ added in v0.0.29
func (ws *WebServiceImpl) Stop() error
Click to show internal directories.
Click to hide internal directories.