Documentation
¶
Index ¶
- type AuthTokenCookie
- type AuthTokenCookieManager
- type CookieContextKey
- type CookieMonster
- func (c *CookieMonster[T]) ClearAuthTokenCookie(w http.ResponseWriter)
- func (c *CookieMonster[T]) IdentityFromContext(ctx context.Context) (UserIdentity, bool)
- func (c *CookieMonster[T]) Middleware(handler http.Handler) http.Handler
- func (c *CookieMonster[T]) MiddlewareFunc(handler http.HandlerFunc) http.HandlerFunc
- func (c *CookieMonster[T]) ReadAuthTokenCookie(r *http.Request) (bool, T, error)
- func (c *CookieMonster[T]) TokenFromContext(ctx context.Context) (T, bool)
- func (c *CookieMonster[T]) WriteAuthTokenCookie(w http.ResponseWriter, token T) error
- type IdentityContextKey
- type UserIdentity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthTokenCookie ¶
type AuthTokenCookie interface { ToUserIdentity() UserIdentity IsExpired() bool Touch(unixSec int64) }
type AuthTokenCookieManager ¶
type AuthTokenCookieManager[T AuthTokenCookie] interface { ClearAuthTokenCookie(w http.ResponseWriter) ReadAuthTokenCookie(r *http.Request) (bool, T, error) WriteAuthTokenCookie(w http.ResponseWriter, token T) error Middleware(handler http.Handler) http.Handler MiddlewareFunc(handler http.HandlerFunc) http.HandlerFunc TokenFromContext(ctx context.Context) (T, bool) IdentityFromContext(ctx context.Context) (UserIdentity, bool) }
func NewCookieMonster ¶
func NewCookieMonster[T AuthTokenCookie]( encryptionService ubsecurity.EncryptionService, cookieName string, secure bool, tokenSoftExpiry int64, cookieKey CookieContextKey, identityKey IdentityContextKey) AuthTokenCookieManager[T]
type CookieContextKey ¶
type CookieContextKey string
type CookieMonster ¶
type CookieMonster[T AuthTokenCookie] struct { // contains filtered or unexported fields }
func (*CookieMonster[T]) ClearAuthTokenCookie ¶
func (c *CookieMonster[T]) ClearAuthTokenCookie(w http.ResponseWriter)
func (*CookieMonster[T]) IdentityFromContext ¶ added in v0.0.21
func (c *CookieMonster[T]) IdentityFromContext(ctx context.Context) (UserIdentity, bool)
func (*CookieMonster[T]) Middleware ¶
func (c *CookieMonster[T]) Middleware(handler http.Handler) http.Handler
func (*CookieMonster[T]) MiddlewareFunc ¶
func (c *CookieMonster[T]) MiddlewareFunc(handler http.HandlerFunc) http.HandlerFunc
func (*CookieMonster[T]) ReadAuthTokenCookie ¶
func (c *CookieMonster[T]) ReadAuthTokenCookie(r *http.Request) (bool, T, error)
func (*CookieMonster[T]) TokenFromContext ¶ added in v0.0.21
func (c *CookieMonster[T]) TokenFromContext(ctx context.Context) (T, bool)
func (*CookieMonster[T]) WriteAuthTokenCookie ¶
func (c *CookieMonster[T]) WriteAuthTokenCookie(w http.ResponseWriter, token T) error
type IdentityContextKey ¶ added in v0.0.21
type IdentityContextKey string
type UserIdentity ¶ added in v0.0.21
func (*UserIdentity) ToAgent ¶ added in v0.0.21
func (u *UserIdentity) ToAgent() string
Click to show internal directories.
Click to hide internal directories.