Documentation
¶
Index ¶
- func RevokeAllUserSessionsExceptInDB(ctx context.Context, db *gorm.DB, userID, exceptSessionID string) error
- func ValidateActive(userSession *models.UserSession) error
- type SessionService
- func (s *SessionService) CreateFederatedSession(ctx context.Context, userID string, expiresAt time.Time, credentialID string) (*models.UserSession, error)
- func (s *SessionService) CreateSession(ctx context.Context, userID string, expiresAt time.Time, meta auth.SessionMeta) (*models.UserSession, string, error)
- func (s *SessionService) DeleteExpiredSessions(ctx context.Context, revokedRetention time.Duration) (int64, error)
- func (s *SessionService) GetSessionByID(ctx context.Context, sessionID string) (*models.UserSession, error)
- func (s *SessionService) RevokeAllUserSessionsExcept(ctx context.Context, userID, exceptSessionID string) error
- func (s *SessionService) RevokeSession(ctx context.Context, sessionID string) error
- func (s *SessionService) RotateRefreshToken(ctx context.Context, sessionID string, refreshJTI string, ...) (*models.UserSession, string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RevokeAllUserSessionsExceptInDB ¶
func RevokeAllUserSessionsExceptInDB(ctx context.Context, db *gorm.DB, userID, exceptSessionID string) error
RevokeAllUserSessionsExceptInDB revokes sessions using the supplied transaction or database handle.
func ValidateActive ¶
func ValidateActive(userSession *models.UserSession) error
ValidateActive verifies that a persisted user session can still authorize requests.
Types ¶
type SessionService ¶
type SessionService struct {
// contains filtered or unexported fields
}
func NewSessionService ¶
func NewSessionService(db *database.DB) *SessionService
func (*SessionService) CreateFederatedSession ¶
func (s *SessionService) CreateFederatedSession(ctx context.Context, userID string, expiresAt time.Time, credentialID string) (*models.UserSession, error)
func (*SessionService) CreateSession ¶
func (s *SessionService) CreateSession(ctx context.Context, userID string, expiresAt time.Time, meta auth.SessionMeta) (*models.UserSession, string, error)
func (*SessionService) DeleteExpiredSessions ¶
func (*SessionService) GetSessionByID ¶
func (s *SessionService) GetSessionByID(ctx context.Context, sessionID string) (*models.UserSession, error)
func (*SessionService) RevokeAllUserSessionsExcept ¶
func (s *SessionService) RevokeAllUserSessionsExcept(ctx context.Context, userID, exceptSessionID string) error
RevokeAllUserSessionsExcept revokes every active session for userID, leaving exceptSessionID active. Pass "" to revoke all sessions.
func (*SessionService) RevokeSession ¶
func (s *SessionService) RevokeSession(ctx context.Context, sessionID string) error
func (*SessionService) RotateRefreshToken ¶
func (s *SessionService) RotateRefreshToken(ctx context.Context, sessionID string, refreshJTI string, meta auth.SessionMeta) (*models.UserSession, string, error)
Click to show internal directories.
Click to hide internal directories.