auth

package
v0.0.0-...-a36e19c Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockTokenStore

type MockTokenStore struct {
	// contains filtered or unexported fields
}

MockTokenStore is a mock implementation of TokenStore for testing

func NewMockTokenStore

func NewMockTokenStore() *MockTokenStore

func (*MockTokenStore) CacheToken

func (m *MockTokenStore) CacheToken(token string) error

func (*MockTokenStore) ValidateToken

func (m *MockTokenStore) ValidateToken(token string) (bool, error)

type PostgresTokenStore

type PostgresTokenStore struct {
	// contains filtered or unexported fields
}

PostgresTokenStore implements TokenStore for PostgreSQL

func NewPostgresTokenStore

func NewPostgresTokenStore(cfg *config.Config) (*PostgresTokenStore, error)

func (*PostgresTokenStore) CacheToken

func (s *PostgresTokenStore) CacheToken(token string) error

CacheToken is a no-op for PostgreSQL as it doesn't need caching

func (*PostgresTokenStore) Close

func (s *PostgresTokenStore) Close() error

func (*PostgresTokenStore) ValidateToken

func (s *PostgresTokenStore) ValidateToken(token string) (bool, error)

type RedisTokenStore

type RedisTokenStore struct {
	// contains filtered or unexported fields
}

RedisTokenStore implements TokenStore for Redis

func NewRedisTokenStore

func NewRedisTokenStore(cfg *config.Config) (*RedisTokenStore, error)

func (*RedisTokenStore) CacheToken

func (s *RedisTokenStore) CacheToken(token string) error

func (*RedisTokenStore) ValidateToken

func (s *RedisTokenStore) ValidateToken(token string) (bool, error)

type TokenInfo

type TokenInfo struct {
	Token      string
	ValidUntil int64
	UserID     string
	Scopes     []string
}

type TokenStore

type TokenStore interface {
	ValidateToken(token string) (bool, error)
	CacheToken(token string) error
}

TokenStore defines the basic token operations

Jump to

Keyboard shortcuts

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