Documentation
¶
Index ¶
- Constants
- func DefaultGenerateCode() (string, error)
- type GenerateCodeFunc
- type Session
- type SessionKey
- type SessionKeyRepo
- type SessionManager
- func (m *SessionManager) AttachRemoteIdentity(sessionID string, ident oidc.Identity) (*Session, error)
- func (m *SessionManager) AttachUser(sessionID string, userID string) (*Session, error)
- func (m *SessionManager) ExchangeKey(key string) (string, error)
- func (m *SessionManager) Get(sessionID string) (*Session, error)
- func (m *SessionManager) Kill(sessionID string) (*Session, error)
- func (m *SessionManager) NewSession(connectorID, clientID, clientState string, redirectURL url.URL, nonce string, ...) (string, error)
- func (m *SessionManager) NewSessionKey(sessionID string) (string, error)
- type SessionRepo
- type SessionState
Constants ¶
View Source
const ( SessionStateNew = SessionState("NEW") SessionStateRemoteAttached = SessionState("REMOTE_ATTACHED") SessionStateIdentified = SessionState("IDENTIFIED") SessionStateDead = SessionState("EXCHANGED") )
View Source
const ( // The default token expiration time. // This is exported, so it can be used to set the expiration // time in refresh token flow. DefaultSessionValidityWindow = 12 * time.Hour )
Variables ¶
This section is empty.
Functions ¶
func DefaultGenerateCode ¶
Types ¶
type GenerateCodeFunc ¶
type Session ¶
type Session struct {
ConnectorID string
ID string
State SessionState
CreatedAt time.Time
ExpiresAt time.Time
ClientID string
ClientState string
RedirectURL url.URL
Identity oidc.Identity
UserID string
// Regsiter indicates that this session is a registration flow.
Register bool
// Nonce is optionally provided in the initial authorization request, and propogated in such cases to the generated claims.
Nonce string
// Scope is the 'scope' field in the authentication request. Example scopes are 'openid', 'email', 'offline', etc.
Scope []string
}
type SessionKey ¶
type SessionKeyRepo ¶
func NewSessionKeyRepo ¶
func NewSessionKeyRepo() SessionKeyRepo
func NewSessionKeyRepoWithClock ¶
func NewSessionKeyRepoWithClock(clock clockwork.Clock) SessionKeyRepo
type SessionManager ¶
type SessionManager struct {
GenerateCode GenerateCodeFunc
Clock clockwork.Clock
ValidityWindow time.Duration
// contains filtered or unexported fields
}
func NewSessionManager ¶
func NewSessionManager(sRepo SessionRepo, skRepo SessionKeyRepo) *SessionManager
func (*SessionManager) AttachRemoteIdentity ¶
func (*SessionManager) AttachUser ¶
func (m *SessionManager) AttachUser(sessionID string, userID string) (*Session, error)
func (*SessionManager) ExchangeKey ¶
func (m *SessionManager) ExchangeKey(key string) (string, error)
func (*SessionManager) NewSession ¶
func (*SessionManager) NewSessionKey ¶
func (m *SessionManager) NewSessionKey(sessionID string) (string, error)
type SessionRepo ¶
type SessionRepo interface {
Get(string) (*Session, error)
Create(Session) error
Update(Session) error
}
func NewSessionRepo ¶
func NewSessionRepo() SessionRepo
func NewSessionRepoWithClock ¶
func NewSessionRepoWithClock(clock clockwork.Clock) SessionRepo
type SessionState ¶
type SessionState string
Click to show internal directories.
Click to hide internal directories.