Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewOauth2ClientCredentials ¶
func NewOauth2ClientCredentials(clientID, clientSecret, tokenUrl string, scopes []string) auth.Authenticator
Types ¶
type Authenticator ¶ added in v1.3.6
type Authenticator struct {
// contains filtered or unexported fields
}
Authenticator uses TokenStorage to add auth headers
func NewAuthenticator ¶ added in v1.3.6
func NewAuthenticator(ts *TokenStorage) *Authenticator
NewAuthenticator creates a new Authenticator with TokenStorage
func (*Authenticator) Authenticate ¶ added in v1.3.6
func (a *Authenticator) Authenticate(r *http.Request) error
type TokenStorage ¶ added in v1.3.6
type TokenStorage struct {
// contains filtered or unexported fields
}
TokenStorage is a thread-safe wrapper for the token
func NewTokenStorage ¶ added in v1.3.6
func NewTokenStorage(initialToken string) *TokenStorage
NewTokenStorage creates a new TokenStorage instance
func (*TokenStorage) Get ¶ added in v1.3.6
func (ts *TokenStorage) Get() string
Get retrieves the token
func (*TokenStorage) Update ¶ added in v1.3.6
func (ts *TokenStorage) Update(newToken string)
Update updates the token
Click to show internal directories.
Click to hide internal directories.