auth

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ServiceName is the keyring service name
	ServiceName = "cu-cli"
	// DefaultWorkspace is the default workspace key
	DefaultWorkspace = "default"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager handles authentication

func NewManager

func NewManager() *Manager

NewManager creates a new authentication manager

func (*Manager) DeleteToken

func (m *Manager) DeleteToken(workspace string) error

DeleteToken removes a token from the keyring

func (*Manager) GetCurrentToken

func (m *Manager) GetCurrentToken() (*Token, error)

GetCurrentToken gets the token for the current workspace

func (*Manager) GetToken

func (m *Manager) GetToken(workspace string) (*Token, error)

GetToken retrieves a token from the keyring

func (*Manager) IsAuthenticated

func (m *Manager) IsAuthenticated(workspace string) bool

IsAuthenticated checks if the user is authenticated

func (*Manager) ListWorkspaces

func (m *Manager) ListWorkspaces() ([]string, error)

ListWorkspaces returns all workspaces with stored tokens

func (*Manager) SaveToken

func (m *Manager) SaveToken(workspace string, token *Token) error

SaveToken saves a token to the keyring

type Token

type Token struct {
	Value     string `json:"value"`
	Workspace string `json:"workspace,omitempty"`
	Email     string `json:"email,omitempty"`
}

Token represents an authentication token

Directories

Path Synopsis
Package mock provides test fixtures for authentication testing
Package mock provides test fixtures for authentication testing

Jump to

Keyboard shortcuts

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