config

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PersonalPath

func PersonalPath() (string, error)

func SavePersonal

func SavePersonal(path string, c Personal) error

SavePersonal replaces only complete, validated files. Never writes secret values to stdout.

func ValidName

func ValidName(name string) bool

Types

type CertificateStatus added in v0.2.0

type CertificateStatus = ranjit.CertificateStatus

CertificateStatus deliberately omits certificate subjects, serials and paths.

type Config

type Config struct {
	PreviousAPIKey          string
	PreviousAPIKeyExpiresAt time.Time
	PersonalFile            string
	WebhookURL              string
	WebhookSecret           string
	Profiles                []Profile
	Addr                    string
	BaseURL                 string
	APIKey                  string
	Database                string
	SyncInterval            time.Duration
	Provider                string
	EFI                     efi.Config
	Inter                   inter.Config
	Sicoob                  sicoob.Config
	Santander               santander.Config
	C6                      c6.Config
}

func Load

func Load() (Config, error)

func (Config) APIKeys added in v0.4.0

func (c Config) APIKeys(now time.Time) ([]string, error)

APIKeys reads personal configuration on each authentication so atomic CLI rotations take effect without restarting. Read errors deliberately fail closed.

func (Config) Certificates added in v0.2.0

func (c Config) Certificates(now time.Time) []CertificateStatus

type Personal

type Personal struct {
	PreviousAPIKey          string    `json:"previous_api_key,omitempty"`
	PreviousAPIKeyExpiresAt time.Time `json:"previous_api_key_expires_at,omitzero"`
	WebhookURL              string    `json:"webhook_url,omitempty"`
	WebhookSecret           string    `json:"webhook_secret,omitempty"`
	Version                 int       `json:"version"`
	Database                string    `json:"database"`
	APIKey                  string    `json:"api_key"`
	Addr                    string    `json:"addr"`
	BaseURL                 string    `json:"base_url"`
	SyncInterval            string    `json:"sync_interval"`
	Profiles                []Profile `json:"profiles"`
}

func NewPersonal

func NewPersonal() Personal

func ReadPersonal

func ReadPersonal(path string) (Personal, error)

func (Personal) Runtime

func (c Personal) Runtime(path string) Config

func (Personal) Validate

func (c Personal) Validate() error

type Profile

type Profile struct {
	Name             string `json:"name"`
	Provider         string `json:"provider"`
	Environment      string `json:"environment,omitempty"`
	ClientID         string `json:"client_id,omitempty"`
	ClientSecretFile string `json:"client_secret_file,omitempty"`
	CertificateFile  string `json:"certificate_file,omitempty"`
	PrivateKeyFile   string `json:"private_key_file,omitempty"`
	AccessTokenFile  string `json:"access_token_file,omitempty"`
	Account          string `json:"account,omitempty"`
	LookbackDays     int    `json:"lookback_days,omitempty"`
}

Jump to

Keyboard shortcuts

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