tokenstore

package
v0.0.0-...-0db91f5 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TokenRefresherOption

type TokenRefresherOption func(*TokenStore) error

func WithConfig

func WithConfig(loginConfig config.LoginConfig) TokenRefresherOption

func WithExpiryMargin

func WithExpiryMargin(expiresSoon time.Duration) TokenRefresherOption

func WithTokenRepository

func WithTokenRepository(tokenRepo models.TokenRepository) TokenRefresherOption

type TokenStore

type TokenStore struct {
	ExpiryMargin time.Duration
	// contains filtered or unexported fields
}

func NewTokenStore

func NewTokenStore(options ...TokenRefresherOption) (*TokenStore, error)

NewTokenStore creates a new TokenRefresher that handles refreshing access tokens which are expiring soon.

func (*TokenStore) GetFreshAccessToken

func (ts *TokenStore) GetFreshAccessToken(ctx context.Context, tokenID string) (models.AuthToken, error)

func (*TokenStore) GetFreshIDToken

func (ts *TokenStore) GetFreshIDToken(ctx context.Context, tokenID string) (models.AuthToken, error)

func (*TokenStore) GetRefreshToken

func (ts *TokenStore) GetRefreshToken(ctx context.Context, tokenID string) (models.AuthToken, error)

func (*TokenStore) SetAccessToken

func (ts *TokenStore) SetAccessToken(ctx context.Context, token models.AuthToken) error

func (*TokenStore) SetAccessTokenExpiry

func (ts *TokenStore) SetAccessTokenExpiry(ctx context.Context, token models.AuthToken, expiresAt time.Time) error

func (*TokenStore) SetIDToken

func (ts *TokenStore) SetIDToken(ctx context.Context, token models.AuthToken) error

func (*TokenStore) SetIDTokenExpiry

func (ts *TokenStore) SetIDTokenExpiry(ctx context.Context, token models.AuthToken, expiresAt time.Time) error

func (*TokenStore) SetRefreshToken

func (ts *TokenStore) SetRefreshToken(ctx context.Context, token models.AuthToken) error

func (*TokenStore) SetRefreshTokenExpiry

func (ts *TokenStore) SetRefreshTokenExpiry(ctx context.Context, token models.AuthToken, expiresAt time.Time) error

Jump to

Keyboard shortcuts

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