Documentation
¶
Index ¶
- Constants
- Variables
- func ConfigDirs() (user, system string, err error)
- func LogDir() (string, error)
- type ClientOIDCConfig
- type Config
- func (c *Config) CerificateExpiry() time.Time
- func (c *Config) CertificateAuthority() ssh.PublicKey
- func (c *Config) CertificateAuthorityURL() string
- func (c *Config) CertificateValid() bool
- func (c *Config) GetCertificateBytes() ([]byte, error)
- func (c *Config) GetPrivateKeyBytes() ([]byte, error)
- func (c *Config) GetPublicKeyBytes() ([]byte, error)
- func (c *Config) GetRefreshToken() (string, error)
- func (c *Config) HasCertificate() bool
- func (c *Config) HasPrivateKey() bool
- func (c *Config) Oidc() ClientOIDCConfig
- func (c *Config) Save() error
- func (c *Config) SetCertificateBytes(pemBytes []byte) error
- func (c *Config) SetPrivateKeyBytes(pemBytes []byte) error
- func (c *Config) SetRefreshToken(token string) error
- func (c *Config) Signer() (ssh.Signer, error)
- func (c *Config) System() *SystemConfig
- type Persistence
- type SystemConfig
- type UserConfig
- type YamlPersistence
Constants ¶
View Source
const AppName = "serverless-ssh-ca"
View Source
const FriendlyAppName = "Serverless SSH CA Client"
Variables ¶
Functions ¶
func ConfigDirs ¶
Types ¶
type ClientOIDCConfig ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func LoadConfig ¶
func LoadUserConfigOnly ¶
func (*Config) CerificateExpiry ¶
func (*Config) CertificateAuthority ¶
CertificateAuthority returns the CA PublicKey
func (*Config) CertificateAuthorityURL ¶
func (*Config) CertificateValid ¶
func (*Config) GetCertificateBytes ¶
func (*Config) GetPrivateKeyBytes ¶
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 (*Config) GetRefreshToken ¶
func (*Config) HasCertificate ¶
func (*Config) HasPrivateKey ¶
func (*Config) Oidc ¶
func (c *Config) Oidc() ClientOIDCConfig
func (*Config) SetCertificateBytes ¶
func (*Config) SetPrivateKeyBytes ¶
SetPrivateKeyBytes encrypts and persists the PEM private key []byte slice via Persistence
func (*Config) SetRefreshToken ¶
func (*Config) System ¶
func (c *Config) System() *SystemConfig
CertificateAuthority returns the CA PublicKey
type Persistence ¶
type Persistence interface {
Save(config UserConfig) error
}
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
type UserConfig ¶
type YamlPersistence ¶
type YamlPersistence struct {
// contains filtered or unexported fields
}
YamlPersistence handles persisting user config to disk as a YAML file
func (*YamlPersistence) Save ¶
func (p *YamlPersistence) Save(c UserConfig) error
This saves the user part of the config
Click to show internal directories.
Click to hide internal directories.