ocicredentials

package
v0.1.62 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2025 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultConfigFile     = ".smrctl/auth.yaml"
	ConfigFilePermissions = 0600
	ConfigDirPermissions  = 0700
)
View Source
const (
	DefaultRegistry = "registry.simplecontainer.io"
)

Variables

View Source
var (
	ErrRegistryRequired   = errors.New("registry URL is required")
	ErrPasswordRequired   = errors.New("password is required when username is provided")
	ErrCredentialsNil     = errors.New("credentials cannot be nil")
	ErrInvalidCredentials = errors.New("invalid credentials")
	ErrUnknownConfigKey   = errors.New("unknown credentials key")
	ErrInvalidInputFormat = errors.New("invalid input format")
)

Functions

This section is empty.

Types

type Credentials

type Credentials struct {
	Registry string `yaml:"registry" json:"registry"`
	Username string `yaml:"username,omitempty" json:"username,omitempty"`
	Password string `yaml:"password,omitempty" json:"password,omitempty"`
}

func Default

func Default(registry string) *Credentials

func New

func New() *Credentials

func (*Credentials) Clone

func (c *Credentials) Clone() *Credentials

func (*Credentials) IsAnonymous

func (c *Credentials) IsAnonymous() bool

func (*Credentials) Validate

func (c *Credentials) Validate() error

type InputReader

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

func NewInputReader

func NewInputReader() *InputReader

func (*InputReader) PromptForCredentials

func (ir *InputReader) PromptForCredentials(registry string) (*Credentials, error)

func (*InputReader) ReadFromStdin

func (ir *InputReader) ReadFromStdin(registry string) (*Credentials, error)

type Manager

type Manager struct {
	Credentials map[string]*Credentials
	// contains filtered or unexported fields
}

func NewManager

func NewManager(home string) *Manager

func (*Manager) Default

func (m *Manager) Default(registry string)

func (*Manager) Delete

func (m *Manager) Delete() error

func (*Manager) Exists

func (m *Manager) Exists() bool

func (*Manager) Find

func (m *Manager) Find(registry string) (*Credentials, bool)

func (*Manager) GetPath

func (m *Manager) GetPath() string

func (*Manager) Input

func (m *Manager) Input(registry string) error

func (*Manager) Load

func (m *Manager) Load() error

func (*Manager) Save

func (m *Manager) Save() error

Jump to

Keyboard shortcuts

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