auth

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Credential

type Credential struct {
	Type  string `json:"type"` // "token", "basic", "header"
	Token string `json:"token,omitempty"`
	User  string `json:"user,omitempty"`
	Pass  string `json:"pass,omitempty"`
	Key   string `json:"key,omitempty"`
	Value string `json:"value,omitempty"`
}

Credential represents stored auth credentials for an endpoint.

func (*Credential) AuthHeaders

func (c *Credential) AuthHeaders() map[string]string

AuthHeaders returns HTTP headers for this credential.

func (*Credential) String

func (c *Credential) String() string

String returns a display-safe summary (no secrets).

type Store

type Store struct{}

Store manages credential persistence. Primary: OS keyring. Fallback: config file (insecure).

func NewStore

func NewStore() *Store

func (*Store) Delete

func (s *Store) Delete(endpointName string) error

Delete removes a credential for the given endpoint.

func (*Store) Load

func (s *Store) Load(endpointName string) (*Credential, error)

Load retrieves a credential for the given endpoint.

func (*Store) Save

func (s *Store) Save(endpointName string, cred *Credential) (bool, error)

Save stores a credential for the given endpoint. Returns (insecureStorageUsed, error).

Jump to

Keyboard shortcuts

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