config

package
v0.19.3 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: Apache-2.0 Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoPrivateKey   = errors.New("no private key found")
	ErrNoCertificate  = errors.New("no certificate found")
	ErrNoRefreshToken = errors.New("no refresh token found")
)

Functions

func ConfigDirs

func ConfigDirs() (user, system string, err error)

func LogDir

func LogDir() (string, error)

Types

type ClientOIDCConfig

type ClientOIDCConfig struct {
	Issuer      string   `json:"issuer"`
	ClientID    string   `json:"client_id"`
	Scopes      []string `json:"scopes"`
	RedirectURL string   `json:"redirect_url"`
}

type Config

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

func LoadConfig

func LoadConfig(system, user string, opts ...ConfigOption) (*Config, error)

func LoadUserConfigOnly

func LoadUserConfigOnly(name string, opts ...ConfigOption) (*Config, error)

func (*Config) CertificateAuthority

func (c *Config) CertificateAuthority() ssh.PublicKey

CertificateAuthority returns the CA PublicKey

func (*Config) CertificateAuthorityURL

func (c *Config) CertificateAuthorityURL() string

func (*Config) CertificateExpiry added in v0.17.7

func (c *Config) CertificateExpiry() time.Time

func (*Config) CertificateValid

func (c *Config) CertificateValid() bool

func (*Config) GetCertificateBytes

func (c *Config) GetCertificateBytes() ([]byte, error)

func (*Config) GetPrivateKeyBytes

func (c *Config) GetPrivateKeyBytes() ([]byte, error)

GetPrivateKeyBytes returns a []byte slice that contains the users unencrypted SSH private key. It is up to the caller to ensure this is handled securely.

func (*Config) GetPublicKeyBytes

func (c *Config) GetPublicKeyBytes() ([]byte, error)

func (*Config) GetRefreshToken

func (c *Config) GetRefreshToken() (string, error)

func (*Config) HasCertificate

func (c *Config) HasCertificate() bool

func (*Config) HasPrivateKey

func (c *Config) HasPrivateKey() bool

func (*Config) Oidc

func (c *Config) Oidc() ClientOIDCConfig

func (*Config) Save

func (c *Config) Save() error

func (*Config) SetCertificateBytes

func (c *Config) SetCertificateBytes(pemBytes []byte) error

func (*Config) SetPrivateKeyBytes

func (c *Config) SetPrivateKeyBytes(pemBytes []byte) error

SetPrivateKeyBytes encrypts and persists the PEM private key []byte slice via [Persistence]

func (*Config) SetRefreshToken

func (c *Config) SetRefreshToken(token string) error

func (*Config) Signer

func (c *Config) Signer() (ssh.Signer, error)

Signer returns a ssh.Signer

func (*Config) System

func (c *Config) System() *SystemConfig

CertificateAuthority returns the CA PublicKey

type ConfigOption added in v0.17.8

type ConfigOption func(*Config)

Options for *Config

func WithPersistence added in v0.17.8

func WithPersistence(p persistence.Persistence) ConfigOption

func WithProtector added in v0.17.8

func WithProtector(p protect.Protector) ConfigOption

type SystemConfig

type SystemConfig struct {
	Issuer                      string   `json:"issuer"`
	ClientID                    string   `json:"client_id"`
	Scopes                      []string `json:"scopes"`
	RedirectURL                 string   `json:"redirect_url"`
	CertificateAuthorityURL     string   `json:"ca_url"`
	TrustedCertificateAuthority string   `json:"trusted_ca"`
	// contains filtered or unexported fields
}

func (*SystemConfig) CertificateAuthority

func (c *SystemConfig) CertificateAuthority() ssh.PublicKey

Jump to

Keyboard shortcuts

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