Documentation
¶
Index ¶
- type TokenRefresherOption
- type TokenStore
- func (ts *TokenStore) GetFreshAccessToken(ctx context.Context, tokenID string) (models.AuthToken, error)
- func (ts *TokenStore) GetFreshIDToken(ctx context.Context, tokenID string) (models.AuthToken, error)
- func (ts *TokenStore) GetRefreshToken(ctx context.Context, tokenID string) (models.AuthToken, error)
- func (ts *TokenStore) SetAccessToken(ctx context.Context, token models.AuthToken) error
- func (ts *TokenStore) SetAccessTokenExpiry(ctx context.Context, token models.AuthToken, expiresAt time.Time) error
- func (ts *TokenStore) SetIDToken(ctx context.Context, token models.AuthToken) error
- func (ts *TokenStore) SetIDTokenExpiry(ctx context.Context, token models.AuthToken, expiresAt time.Time) error
- func (ts *TokenStore) SetRefreshToken(ctx context.Context, token models.AuthToken) error
- func (ts *TokenStore) SetRefreshTokenExpiry(ctx context.Context, token models.AuthToken, expiresAt time.Time) error
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 ¶
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 (*TokenStore) GetFreshIDToken ¶
func (*TokenStore) GetRefreshToken ¶
func (*TokenStore) SetAccessToken ¶
func (*TokenStore) SetAccessTokenExpiry ¶
func (*TokenStore) SetIDToken ¶
func (*TokenStore) SetIDTokenExpiry ¶
func (*TokenStore) SetRefreshToken ¶
func (*TokenStore) SetRefreshTokenExpiry ¶
Click to show internal directories.
Click to hide internal directories.