auth

package
v0.1.1-beta Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeBasicAuth

func DecodeBasicAuth(encoded string) (string, string, error)

DecodeBasicAuth decodes a Base64-encoded "username:password" string and returns the username and password separately.

func DeletePassword

func DeletePassword(username string) error

DeletePassword removes the credential for username from the OS keychain.

func EncodeBasicAuth

func EncodeBasicAuth(username, password string) string

EncodeBasicAuth returns the Base64 encoding of "username:password".

func GetPassword

func GetPassword(username string) (string, error)

GetPassword retrieves the password for username from the OS keychain.

func StorePassword

func StorePassword(username, password string) error

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.

Jump to

Keyboard shortcuts

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