Documentation
¶
Index ¶
- func AuthInfoWriter(s Session, outerValues [][]string, key string) runtime.ClientAuthInfoWriter
- func Basic(username, password string) runtime.ClientAuthInfoWriter
- func Bearer(token string) runtime.ClientAuthInfoWriter
- func ConfigRepo(s Session) runtime.ClientAuthInfoWriter
- func Cookie(s Session, key string) runtime.ClientAuthInfoWriter
- func CookieValue(key, value string) runtime.ClientAuthInfoWriter
- func Error(err error) runtime.ClientAuthInfoWriter
- func TokenRepo(s Session) runtime.ClientAuthInfoWriter
- type ConfigRepositoryImpl
- type ExtendedDefaultConfigRepositoryImpl
- type ObservableTokenRepositoryImpl
- func (o *ObservableTokenRepositoryImpl) GetAccessToken() (string, error)
- func (o *ObservableTokenRepositoryImpl) RegisterObserver(observer repository.TokenRepositoryObserver) bool
- func (o *ObservableTokenRepositoryImpl) SetAccessToken(token interface{}) error
- func (o *ObservableTokenRepositoryImpl) UnregisterObserver(observer repository.TokenRepositoryObserver) bool
- type RefreshTokenImpl
- type RefreshTokenScheduler
- type Session
- type TokenRepositoryImpl
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthInfoWriter ¶
func AuthInfoWriter(s Session, outerValues [][]string, key string) runtime.ClientAuthInfoWriter
AuthInfoWriter called by the existing security from the wrapper
func Basic ¶
func Basic(username, password string) runtime.ClientAuthInfoWriter
func Bearer ¶
func Bearer(token string) runtime.ClientAuthInfoWriter
func ConfigRepo ¶
func ConfigRepo(s Session) runtime.ClientAuthInfoWriter
func CookieValue ¶
func CookieValue(key, value string) runtime.ClientAuthInfoWriter
func Error ¶
func Error(err error) runtime.ClientAuthInfoWriter
func TokenRepo ¶
func TokenRepo(s Session) runtime.ClientAuthInfoWriter
Types ¶
type ConfigRepositoryImpl ¶
func DefaultConfigRepositoryImpl ¶
func DefaultConfigRepositoryImpl() *ConfigRepositoryImpl
func (*ConfigRepositoryImpl) GetClientId ¶
func (c *ConfigRepositoryImpl) GetClientId() string
func (*ConfigRepositoryImpl) GetClientSecret ¶
func (c *ConfigRepositoryImpl) GetClientSecret() string
func (*ConfigRepositoryImpl) GetJusticeBaseUrl ¶
func (c *ConfigRepositoryImpl) GetJusticeBaseUrl() string
type ExtendedDefaultConfigRepositoryImpl ¶
type ExtendedDefaultConfigRepositoryImpl struct { ConfigRepositoryImpl // contains filtered or unexported fields }
func ExtendedDefaultConfigRepository ¶
func ExtendedDefaultConfigRepository() *ExtendedDefaultConfigRepositoryImpl
func (*ExtendedDefaultConfigRepositoryImpl) GetCustomBasePath ¶
func (c *ExtendedDefaultConfigRepositoryImpl) GetCustomBasePath(servicePath string) string
type ObservableTokenRepositoryImpl ¶
type ObservableTokenRepositoryImpl struct { Observers []repository.TokenRepositoryObserver TokenRepo repository.TokenRepository }
func DefaultObservableTokenRepositoryImpl ¶
func DefaultObservableTokenRepositoryImpl(tokenRepo repository.TokenRepository) *ObservableTokenRepositoryImpl
DefaultObservableTokenRepositoryImpl initializes a new ObservableTokenRepositoryImpl instance
func (*ObservableTokenRepositoryImpl) GetAccessToken ¶
func (o *ObservableTokenRepositoryImpl) GetAccessToken() (string, error)
Implement TokenRepository methods for ObservableTokenRepositoryImpl
func (*ObservableTokenRepositoryImpl) RegisterObserver ¶
func (o *ObservableTokenRepositoryImpl) RegisterObserver(observer repository.TokenRepositoryObserver) bool
func (*ObservableTokenRepositoryImpl) SetAccessToken ¶
func (o *ObservableTokenRepositoryImpl) SetAccessToken(token interface{}) error
func (*ObservableTokenRepositoryImpl) UnregisterObserver ¶
func (o *ObservableTokenRepositoryImpl) UnregisterObserver(observer repository.TokenRepositoryObserver) bool
type RefreshTokenImpl ¶
type RefreshTokenImpl struct { // RefreshRate specifies the percentage of token lifetime at which refresh should occur. // Value should be between 0.0 and 1.0 (e.g., 0.8 means refresh when 80% of token lifetime has passed). // This helps ensure tokens are refreshed before they expire, preventing authentication failures. // If the `AutoRefresh` sets to `true` this value must be set below 1.0. RefreshRate float64 // AutoRefresh enables or disables automatic token refresh in the background. // When true, the SDK will automatically refresh tokens based on RefreshRate. // When false, tokens must be refreshed manually by calling refresh methods. AutoRefresh bool // IsRefreshInProgress indicates whether a token refresh operation is currently running. // This flag prevents multiple concurrent refresh operations and helps avoid race conditions. // Should be treated as read-only in most cases. IsRefreshInProgress bool }
RefreshTokenImpl handles automatic token refresh functionality for AccelByte SDK authentication. It manages the timing and behavior of token refresh operations to maintain valid access tokens throughout the application lifecycle.
func DefaultRefreshTokenImpl ¶
func DefaultRefreshTokenImpl() *RefreshTokenImpl
DefaultRefreshTokenImpl creates a new RefreshTokenImpl with the default settings. Returns a RefreshTokenImpl configured with:
- RefreshRate: 0.8 (refresh when token is 80% through its lifetime)
- AutoRefresh: false (manual refresh mode by default)
func (*RefreshTokenImpl) DisableAutoRefresh ¶
func (r *RefreshTokenImpl) DisableAutoRefresh() bool
func (*RefreshTokenImpl) GetRefreshRate ¶
func (r *RefreshTokenImpl) GetRefreshRate() float64
func (*RefreshTokenImpl) SetRefreshIsRunningInBackground ¶
func (r *RefreshTokenImpl) SetRefreshIsRunningInBackground(b bool)
type RefreshTokenScheduler ¶
type Session ¶
type Session struct { Token repository.TokenRepository Config repository.ConfigRepository Refresh repository.RefreshTokenRepository }
type TokenRepositoryImpl ¶
type TokenRepositoryImpl struct { IssuedTime *time.Time AccessToken *repository.Token // contains filtered or unexported fields }
func DefaultTokenRepositoryImpl ¶
func DefaultTokenRepositoryImpl() *TokenRepositoryImpl
func (*TokenRepositoryImpl) GetToken ¶
func (t *TokenRepositoryImpl) GetToken() (*repository.Token, error)
func (*TokenRepositoryImpl) RemoveToken ¶
func (t *TokenRepositoryImpl) RemoveToken() error
func (*TokenRepositoryImpl) Store ¶
func (t *TokenRepositoryImpl) Store(accessToken interface{}) error
func (*TokenRepositoryImpl) TokenIssuedTimeUTC ¶
func (t *TokenRepositoryImpl) TokenIssuedTimeUTC() time.Time
Source Files
¶
Click to show internal directories.
Click to hide internal directories.