Documentation
¶
Index ¶
- Variables
- func GetUserID(ctx context.Context) *string
- func HasValidSession(ctx context.Context) bool
- func NewInfo(s Session, isAnonymous bool, isVerified bool, userCanReauthenticate bool) *model.SessionInfo
- func WithInvalidSession(ctx context.Context) context.Context
- func WithSession(ctx context.Context, s Session) context.Context
- type AccessTokenSessionManager
- type AccessTokenSessionResolver
- type Attrs
- type CookieDef
- type CookieManager
- type CreateReason
- type EventService
- type IDPSessionManager
- type IDPSessionResolver
- type ManagementService
- type Manager
- func (m *Manager) Get(id string) (Session, error)
- func (m *Manager) List(userID string) ([]Session, error)
- func (m *Manager) Logout(session Session, rw http.ResponseWriter) error
- func (m *Manager) RevokeWithEvent(session Session, isTermination bool, isAdminAPI bool) error
- func (m *Manager) RevokeWithoutEvent(session Session) error
- func (m *Manager) TerminateAllExcept(userID string, currentSession Session, isAdminAPI bool) error
- type MeterService
- type Middleware
- type MiddlewareLogger
- type Resolver
- type Session
- type Type
- type UserQuery
Constants ¶
This section is empty.
Variables ¶
View Source
var AppSessionTokenCookieDef = &httputil.CookieDef{ NameSuffix: "app_session", Path: "/", SameSite: http.SameSiteLaxMode, }
View Source
var DependencySet = wire.NewSet( NewMiddlewareLogger, wire.Struct(new(Middleware), "*"), wire.Struct(new(Manager), "*"), NewSessionCookieDef, )
View Source
var ErrInvalidSession = errors.New("provided session is invalid")
View Source
var ErrSessionNotFound = errors.New("session not found")
Functions ¶
func HasValidSession ¶
Types ¶
type AccessTokenSessionManager ¶
type AccessTokenSessionManager ManagementService
type AccessTokenSessionResolver ¶
type AccessTokenSessionResolver Resolver
type Attrs ¶
type Attrs struct { UserID string `json:"user_id"` Claims map[model.ClaimName]interface{} `json:"claims"` }
func NewAttrsFromAuthenticationInfo ¶
func NewAttrsFromAuthenticationInfo(info authenticationinfo.T) *Attrs
type CookieDef ¶
func NewSessionCookieDef ¶
func NewSessionCookieDef(sessionCfg *config.SessionConfig) CookieDef
type CookieManager ¶
type CreateReason ¶
type CreateReason string
const ( CreateReasonSignup CreateReason = "signup" CreateReasonLogin CreateReason = "login" CreateReasonPromote CreateReason = "promote" CreateReasonReauthenticate CreateReason = "reauthenticate" )
type EventService ¶
type IDPSessionManager ¶
type IDPSessionManager ManagementService
type IDPSessionResolver ¶
type IDPSessionResolver Resolver
type ManagementService ¶
type Manager ¶
type Manager struct { IDPSessions IDPSessionManager AccessTokenSessions AccessTokenSessionManager Events EventService }
func (*Manager) RevokeWithEvent ¶
func (*Manager) RevokeWithoutEvent ¶
type MeterService ¶
type Middleware ¶
type Middleware struct { SessionCookie CookieDef Cookies CookieManager IDPSessionResolver IDPSessionResolver AccessTokenSessionResolver AccessTokenSessionResolver AccessEvents *access.EventProvider Users UserQuery Database *appdb.Handle Logger MiddlewareLogger MeterService MeterService IDPSessionOnly bool }
type MiddlewareLogger ¶
func NewMiddlewareLogger ¶
func NewMiddlewareLogger(lf *log.Factory) MiddlewareLogger
type Session ¶
type Session interface { SessionID() string SessionType() Type GetClientID() string GetCreatedAt() time.Time GetAccessInfo() *access.Info GetDeviceInfo() (map[string]interface{}, bool) GetAuthenticationInfo() authenticationinfo.T ToAPIModel() *model.Session // SSOGroupIDPSessionID returns the IDP session id of the SSO group // if the session is not SSO enabled, SSOGroupIDPSessionID will be empty SSOGroupIDPSessionID() string // IsSameSSOGroup indicates whether the session is in the same SSO group IsSameSSOGroup(s Session) bool Equal(s Session) bool }
func GetSession ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.