session

package
v2.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2026 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

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 (s *SessionService) DeleteExpiredSessions(ctx context.Context, revokedRetention time.Duration) (int64, error)

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL