auth

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: AGPL-3.0, Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MinKeyLen = 32
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CachedSession added in v0.8.0

type CachedSession struct {
	ClientID       string
	ExpirationDate time.Time
}

type Service

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

func NewService

func NewService(store store.Store, sessionCache *SessionCache) (*Service, error)

func (*Service) Authenticate

func (s *Service) Authenticate(id, authToken string) error

func (*Service) Login added in v0.8.0

func (s *Service) Login(id, key string) (string, error)

func (*Service) Register

func (s *Service) Register(id, key string) error

func (*Service) Unregister

func (s *Service) Unregister(id string) error

type SessionCache added in v0.8.0

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

func NewSessionCache added in v0.8.0

func NewSessionCache(cfg SessionCacheConfig) (*SessionCache, error)

func (*SessionCache) Delete added in v0.8.0

func (t *SessionCache) Delete(clientID string)

func (*SessionCache) Get added in v0.8.0

func (t *SessionCache) Get(token string) (CachedSession, error)

func (*SessionCache) Put added in v0.8.0

func (t *SessionCache) Put(clientID, token string) error

type SessionCacheConfig added in v0.8.0

type SessionCacheConfig struct {
	ExpirationMinutes int `toml:"expiration_minutes"`
}

func (SessionCacheConfig) IsValid added in v0.8.0

func (c SessionCacheConfig) IsValid() error

Jump to

Keyboard shortcuts

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