auth

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateNonce

func GenerateNonce() string

GenerateNonce generates a random nonce for OAuth.

Types

type OAuthFlow

type OAuthFlow struct {
	Provider string
	ClientID string
}

OAuthFlow handles OAuth authentication flow.

func (*OAuthFlow) Callback

func (o *OAuthFlow) Callback(code string) (string, error)

Callback handles the OAuth callback.

func (*OAuthFlow) Start

func (o *OAuthFlow) Start() (string, error)

Start starts the OAuth flow.

type SecureStorage

type SecureStorage struct {
	// contains filtered or unexported fields
}

SecureStorage handles secure token storage using OS keychain/keyring.

func NewSecureStorage

func NewSecureStorage(service string) *SecureStorage

NewSecureStorage creates a new secure storage.

func (*SecureStorage) Get

func (s *SecureStorage) Get(account string) (string, error)

Get retrieves a token from secure storage.

func (*SecureStorage) Set

func (s *SecureStorage) Set(account, token string) error

Set stores a token in secure storage.

type TokenStore

type TokenStore struct {
	// contains filtered or unexported fields
}

TokenStore manages authentication tokens.

func NewTokenStore

func NewTokenStore() *TokenStore

NewTokenStore creates a new token store.

func (*TokenStore) Get

func (t *TokenStore) Get(provider string) string

Get returns a token for a provider.

func (*TokenStore) Has

func (t *TokenStore) Has(provider string) bool

Has returns true if a token exists for a provider.

func (*TokenStore) Load

func (t *TokenStore) Load() error

Load loads tokens from secure storage.

func (*TokenStore) Save

func (t *TokenStore) Save() error

Save saves tokens to secure storage.

func (*TokenStore) Set

func (t *TokenStore) Set(provider, token string)

Set sets a token for a provider.

Jump to

Keyboard shortcuts

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