Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeBasicAuth ¶
DecodeBasicAuth decodes a Base64-encoded "username:password" string and returns the username and password separately.
func DeletePassword ¶
DeletePassword removes the credential for username from the OS keychain.
func EncodeBasicAuth ¶
EncodeBasicAuth returns the Base64 encoding of "username:password".
func GetPassword ¶
GetPassword retrieves the password for username from the OS keychain.
func StorePassword ¶
StorePassword stores password for username in the OS keychain.
Types ¶
type TokenManager ¶
type TokenManager struct {
ClientID string
ClientSecret string
TokenURL string
// contains filtered or unexported fields
}
TokenManager handles fetching and caching OAuth2 client credentials tokens.
func NewTokenManager ¶
func NewTokenManager(clientID, clientSecret, tokenURL string) *TokenManager
NewTokenManager creates a TokenManager for the given client credentials and token URL.
func (*TokenManager) GetToken ¶
func (tm *TokenManager) GetToken() (string, error)
GetToken returns a valid Bearer token, fetching a new one if the cached token is missing or within 1 minute of expiry.