kobra

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: Apache-2.0 Imports: 65 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnsibleBin                  = "ansible"
	AnsiblePlaybookBin          = "ansible-playbook"
	AnsiblePlaybookInventoryBin = "ansible-inventory"
	AnsibleGalaxyBin            = "ansible-galaxy"
	AnsibleConfigFile           = "ansible.cfg"

	AnsibleIniSection             = "defaults"
	AnsibleIniCollections         = "collections_paths"
	AnsibleIniRoles               = "roles_path"
	AnsibleIniInventory           = "inventory"
	AnsiblePlaybooksDir           = "playbooks"
	AnsibleRolesPathDefault       = "./roles"
	AnsibleCollectionsPathDefault = "./collections"
	AnsibleCollectionsSpecialPath = "ansible_collections"
	AnsibleRequirements           = "requirements.yml"
	AnsibleInventoryFile          = "hosts.txt"
	AnsibleInventoryDir           = "inventories"
	AnsibleHostsLocal             = "localhost"
	AnsibleConnectionLocal        = "local"
)
View Source
const (
	GitOrigin = "origin"

	GitDivergenceError = "Divergence between local and remote Git branches. Stopping here ..."
	GitReadError       = "Unable to read Git repository: %s"
	GitFetchError      = "Unable to fetch remote Git repository: %s"
	GitHeadError       = "Unable to read Git local head config: %s"
	GitRemoteError     = "Unable to read from Git remote: %s"
	GitRemoteHeadError = "Unable to read Git remote head config: %s"
	GitRemoteRefError  = "Unable to find the requested remote reference"
	GitRevHistoryError = "Unable to get revisions history changes between local and remote branches"
	GitMethodError     = "Unsupported Git access method"
)
View Source
const (
	HelmBin                    = "helm"
	HelmfileBin                = "helmfile"
	HelmfileConfigFile         = "helmfile.yaml"
	HelmfileConfigFileTemplate = "helmfile.yaml.gotmpl"
)
View Source
const (
	KobraConfigDir      = ".kobra.d"
	KobraPlatformBinDir = "bin"

	AnsibleDirName   = "ansible"
	HelmfileDirName  = "helmfile"
	TerraformDirName = "terraform"
)
View Source
const (
	PlatformConfigFile       = "kobra.yml"
	PlatformConfigCustomFile = ".kobra.yml"
	InvalidConfigField       = "empty or invalid %s in platform configuration file: '%s'"

	GitMethodUnknown = ""
	GitMethodSSH     = "ssh"
	GitMethodHTTP    = "http"

	GitDefaultUserSSH = "git"

	SecretsProviderAWS     = "aws"
	SecretsProviderEnv     = "env"
	SecretsProviderFile    = "file"
	SecretsProviderHCP     = "hcp"
	SecretsProviderInput   = "input"
	SecretsProviderKeyring = "keyring"

	SecretsHCPAuthMethodCredentials = "credentials"
	SecretsHCPAuthMethodLdap        = "ldap"

	KubesealControllerDefaultNamespace = "kube-system"
	KubesealControllerDefaultName      = "sealed-secrets"

	ToolchainVersionLatest = "latest"

	TfProviderOpenTofu  = "opentofu"
	TfProviderTerraform = "terraform"
)
View Source
const (
	SopsCreateAtPrefix     = "# created: "
	SopsPublicKeyPrefix    = "# public key: "
	SopsAgeSecretKeyPrefix = "AGE-SECRET-KEY"

	SopsAgeKeyFileEnv    = "SOPS_AGE_KEY_FILE"
	SopsAgeRecipientsEnv = "SOPS_AGE_RECIPIENTS"

	SecretsFeatureSyncMap = "SECRETS_FEATURE_SYNC_MAP"
)
View Source
const (
	VaultEndpointDefault     = "http://127.0.0.1:8200"
	VaultTokenEnvDefault     = "VAULT_TOKEN"
	VaultTokenFileDefault    = ".vault-token"
	VaultUsernameEnvDefault  = "VAULT_USERNAME"
	VaultUsernameFileDefault = ".vault-username"
	VaultPasswordEnvDefault  = "VAULT_PASSWORD"
	VaultPasswordFileDefault = ".vault-password"
	VaultMasterKeyID         = "kobra_master_key"
	VaultMountPathDefault    = "secret"
	OneDaySeconds            = (60 * 60 * 24)
	OneWeekSeconds           = (OneDaySeconds * 7)
)
View Source
const (
	KobraConfigPluginsManifestFile = "MANIFEST.json"

	KobraThirdPartyTemplateUriVersion    = "{VERSION}"
	KobraThirdPartyTemplateUriArch       = "{ARCH}"
	KobraThirdPartyTemplateUriArchAlt    = "{ARCH_ALT}"
	KobraThirdPartyTemplateUriArchAlt2   = "{ARCH_ALT2}"
	KobraThirdPartyTemplateUriArchCompat = "{ARCH_COMPAT}"
	KobraThirdPartyTemplateUriOs         = "{OS}"
	KobraThirdPartyTemplateUriOsAlt      = "{OS_ALT}"
	KobraThirdPartyTemplateUriOsAlt2     = "{OS_ALT2}"

	ToolchainToolTF       = "tf"
	ToolchainToolHelm     = "helm"
	ToolchainToolHelmfile = "helmfile"
	ToolchainToolAnsible  = "ansible"
	ToolchainToolSops     = "sops"
	ToolchainToolKubeseal = "kubeseal"

	PythonBin = "python3"
	PipBin    = "pip3"
)
View Source
const (
	SopsBin              = "sops"
	SopsReadFileErr      = "error reading file: %s"
	SopsUnmarshalErr     = "error unmarshalling file: %s"
	SopsEmptyFileErr     = "file cannot be completely empty, it must contain at least one document"
	SopsGenerateKeyErr   = "could not generate data key: %s"
	SopsMarshalTreeErr   = "could not marshal tree: %s"
	SopsNoEditorErr      = "could not run editor: %s"
	SopsHashErr          = "could not hash file: %s"
	SopsUnchangedFileErr = "file has not changed, exiting."
	SopsReadErr          = "could not read edited file: %s"
	SopsComparisonErr    = "failed to compare document version %q with program version %q: %v"
	SopsEditorErr        = "" /* 189-byte string literal not displayed */
	SopsEncryptErr       = "error encrypting the data key with one or more master keys: %s"
	SopsInPlaceErr       = "could not open in-place file for writing: %s"
	SopsCreateDirErr     = "could not create temporary directory: %s"
	SopsCreateFileErr    = "could not create temporary file: %s"
	SopsWriteErr         = "could not write output file: %s"
)
View Source
const (
	SSHConfigUser     = "user"
	SSHConfigKey      = "IdentityFile"
	SSHAgentSocketEnv = "SSH_AUTH_SOCK"
)
View Source
const (
	TerraformBin = "terraform"
	OpenTofuBin  = "tofu"
)
View Source
const (
	KeyringService = "kobra"
)
View Source
const (
	KubesealBin = "kubeseal"
)
View Source
const (
	SecretsProviderEnvVariableDefault = "KOBRA_MASTER_KEY" // #nosec G101
)

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "kobra",
	Short: "Kobra - DevOps deployment swiss-army knife utility",
}

Functions

func BinExec

func BinExec(bin, dir string, args, envs []string) error

func BinExecOut

func BinExecOut(bin, dir string, args, envs []string) (string, error)

func BinExecOutNoErr

func BinExecOutNoErr(bin, dir string, args, envs []string) (string, error)

func CheckSameDevice

func CheckSameDevice(src string) (bool, error)

func DownloadFile

func DownloadFile(name, src string, dst *os.File) error

func GetPlatformConfigCustomFile added in v0.5.0

func GetPlatformConfigCustomFile() string

func GetPlatformConfigFile

func GetPlatformConfigFile() string

func GetSSHCredentials

func GetSSHCredentials(ptfCfg *PlatformConfig, bootstrap bool) (string, string, error)

func GrantExecRights

func GrantExecRights(bin string) error

func IsGitRepoUpToDate

func IsGitRepoUpToDate(ptfCfg *PlatformConfig, bypass bool) (bool, error)

func KobraError

func KobraError(format string, args ...any) error

func LookupAnsibleDir

func LookupAnsibleDir() (string, error)

func LookupBooleanDefault

func LookupBooleanDefault(cfg *bool, v string, dft bool) bool

func LookupDefault

func LookupDefault(cfg *string, v, dft string) bool

func LookupEnv

func LookupEnv(cfg *string, env, dft string) bool

func LookupHelmfileDir

func LookupHelmfileDir() (string, error)

func LookupPlatformBinDir

func LookupPlatformBinDir() (string, error)

func LookupPlatformBinary

func LookupPlatformBinary(binName string) (string, error)

func LookupPlatformConfigDir

func LookupPlatformConfigDir() (string, error)

func LookupPlatformDir

func LookupPlatformDir() (string, error)

func LookupSystemBinary

func LookupSystemBinary(binName string) (string, error)

func LookupTerraformDir

func LookupTerraformDir() (string, error)

func NewAnsibleDeploySubCommand

func NewAnsibleDeploySubCommand() *cobra.Command

func NewAnsibleInventorySubCommand added in v0.5.0

func NewAnsibleInventorySubCommand(name, desc string) *cobra.Command

func NewHfSubCommand

func NewHfSubCommand(name, desc string) *cobra.Command

func NewSealCommand added in v0.3.2

func NewSealCommand() *cobra.Command

func NewSecretsGetSetSubCommand

func NewSecretsGetSetSubCommand(name, desc string) *cobra.Command

func NewTfSubCommand

func NewTfSubCommand(name, desc string) *cobra.Command

func ParseCommands

func ParseCommands()

func RunAnsible

func RunAnsible(toolchainUpdate bool, playbook string, upgrade, check, bootstrap, listTags bool, tags, skip_tags, extraVars, limit string, verbose, bypass bool, freeArgs []string) error

func RunAnsibleInventory added in v0.5.0

func RunAnsibleInventory(toolchainUpdate bool, cmd, playbook, group, host, out, extraVars, limit string, filters []string, verbose bool, freeArgs []string) error

func RunAnsiblePull

func RunAnsiblePull() error

func RunHelmfile

func RunHelmfile(toolchainUpdate bool, cmd string, verbose, bypass bool, release, outputDir string, freeArgs []string) error

func RunKubeseal added in v0.3.2

func RunKubeseal(toolchainUpdate bool, sealNamespace, sealSecret, sealLiteral string, freeArgs []string) error

func RunSecretsEdit

func RunSecretsEdit(file string) error

func RunSecretsEncrypt

func RunSecretsEncrypt(file string) error

func RunSecretsGet

func RunSecretsGet() error

func RunSecretsInit

func RunSecretsInit() error

func RunSecretsSet

func RunSecretsSet(masterKey string) error

func RunSecretsView

func RunSecretsView(file string) error

func RunTF

func RunTF(toolchainUpdate bool, cmd, module, resource, output string, auto, bypass bool, extraArgs []string) error

func SetupPlatformToolchain

func SetupPlatformToolchain(cfg *PlatformConfig, update bool, tools ...string) error

func SopsEditFile

func SopsEditFile(file string) error

func SopsEncryptFile

func SopsEncryptFile(file string) error

func SopsViewFile

func SopsViewFile(file string) error

func StandaloneBinary

func StandaloneBinary(src, dst string) error

func TemplatedURI

func TemplatedURI(uri, version string) string

Types

type GitHubRelease

type GitHubRelease struct {
	Tag        string `json:"tag_name"`
	Draft      bool   `json:"draft"`
	PreRelease bool   `json:"prerelease"`
}

type KobraSecretData

type KobraSecretData struct {
	CreatedAt string `json:"created_at"`
	PublicKey string `json:"public_key"`
	SecretKey string `json:"secret_key"`
}

func GetSecrets

func GetSecrets(ptfCfg *PlatformConfig) (*KobraSecretData, error)

type PlatformConfig

type PlatformConfig struct {
	Git       PlatformConfigGit       `yaml:"git,omitempty"`
	Secrets   PlatformConfigSecrets   `yaml:"secrets"`
	SSH       PlatformConfigSSH       `yaml:"ssh,omitempty"`
	Toolchain PlatformConfigToolchain `yaml:"toolchain"`
}

PlatformConfig is the root definition of a managed platform

func GetPlatformConfig

func GetPlatformConfig() (*PlatformConfig, error)

func (*PlatformConfig) IsValid

func (p *PlatformConfig) IsValid() error

type PlatformConfigGit

type PlatformConfigGit struct {
	Method string                `yaml:"method,omitempty"`
	SSH    PlatformConfigGitSSH  `yaml:"ssh,omitempty"`
	HTTP   PlatformConfigGitHTTP `yaml:"http,omitempty"`
}

PlatformConfigGit contains git-specific configuration

type PlatformConfigGitHTTP

type PlatformConfigGitHTTP struct {
	Username string `yaml:"username,omitempty"`
	Password string `yaml:"password,omitempty"` // #nosec G117
	Token    string `yaml:"token,omitempty"`
}

PlatformConfigGitHTTP contains git-http-specific configuration

type PlatformConfigGitSSH

type PlatformConfigGitSSH struct {
	User       string `yaml:"user,omitempty"`
	PrivateKey string `yaml:"private_key_file,omitempty"` // #nosec G117
	Password   string `yaml:"password,omitempty"`         // #nosec G117
}

PlatformConfigGitSSH contains git-ssh-specific configuration

type PlatformConfigSSH

type PlatformConfigSSH struct {
	Remote    PlatformConfigSshConfig `yaml:"remote,omitempty"`
	Bootstrap PlatformConfigSshConfig `yaml:"bootstrap,omitempty"`
}

PlatformConfigSSH contains ssh-specific configuration

type PlatformConfigSecrets

type PlatformConfigSecrets struct {
	Provider    string                         `yaml:"provider"`
	MasterKeyID string                         `yaml:"master_key_id"`
	SyncMaps    []PlatformConfigSecretsSyncMap `yaml:"sync_maps,omitempty"`
	AWS         PlatformConfigSecretsAWS       `yaml:"aws,omitempty"`
	Env         PlatformConfigSecretsEnv       `yaml:"env,omitempty"`
	File        PlatformConfigSecretsFile      `yaml:"file,omitempty"`
	HCP         PlatformConfigSecretsHCP       `yaml:"hcp,omitempty"`
}

PlatformConfigSecrets contains secrets-specific configuration

type PlatformConfigSecretsAWS

type PlatformConfigSecretsAWS struct {
	Region  string `yaml:"region"`
	ID      string `yaml:"id"`
	RoleARN string `yaml:"role_arn"`
}

PlatformConfigSecretsAWS contains AWS Secrets Manager secrets-specific configuration

type PlatformConfigSecretsEnv

type PlatformConfigSecretsEnv struct {
	Var string `yaml:"var,omitempty"`
}

PlatformConfigSecretsEnv contains environment variable secrets-specific configuration

type PlatformConfigSecretsFile

type PlatformConfigSecretsFile struct {
	Path string `yaml:"path"`
}

PlatformConfigSecretsFile contains file-based secrets-specific configuration

type PlatformConfigSecretsHCP

type PlatformConfigSecretsHCP struct {
	Endpoint     string `yaml:"endpoint,omitempty"`
	Mount        string `yaml:"mount,omitempty"`
	AuthMethod   string `yaml:"auth_method,omitempty"`
	TokenEnv     string `yaml:"token_env,omitempty"`
	TokenFile    string `yaml:"token_file,omitempty"`
	UsernameEnv  string `yaml:"username_env,omitempty"`
	UsernameFile string `yaml:"username_file,omitempty"`
	PasswordEnv  string `yaml:"password_env,omitempty"`
	PasswordFile string `yaml:"password_file,omitempty"`
}

PlatformConfigSecretsHCP contains Hashicorp Vault secrets-specific configuration

type PlatformConfigSecretsSyncMap added in v0.5.0

type PlatformConfigSecretsSyncMap struct {
	Path     string `yaml:"path,omitempty"`
	Secret   string `yaml:"secret"`
	SopsFile string `yaml:"sops_file"`
}

PlatformConfigSecretsSyncMap contains local-remote secrets syncrhonization mappings

type PlatformConfigSshConfig

type PlatformConfigSshConfig struct {
	User    string `yaml:"user"`
	KeyFile string `yaml:"key_file"`
}

PlatformConfigSshConfig contains ssh-specific configuration

type PlatformConfigToolchain

type PlatformConfigToolchain struct {
	UseSystem bool                            `yaml:"use_system,omitempty"`
	TF        PlatformConfigToolchainTF       `yaml:"tf,omitempty"`
	Helm      PlatformConfigToolchainHelm     `yaml:"helm,omitempty"`
	Helmfile  PlatformConfigToolchainHelmfile `yaml:"helmfile,omitempty"`
	Sops      PlatformConfigToolchainSops     `yaml:"sops,omitempty"`
	Kubeseal  PlatformConfigToolchainKubeseal `yaml:"kubeseal,omitempty"`
	Ansible   PlatformConfigToolchainAnsible  `yaml:"ansible,omitempty"`
}

PlatformConfigToolchain toolchain-specific configuration

type PlatformConfigToolchainAnsible

type PlatformConfigToolchainAnsible struct {
	Version  string            `yaml:"version,omitempty"`
	Packages map[string]string `yaml:"packages,omitempty"`
}

PlatformConfigToolchainAnsible contains ansible-specific configuration

type PlatformConfigToolchainHelm

type PlatformConfigToolchainHelm struct {
	Version string `yaml:"version,omitempty"`
}

PlatformConfigToolchainHelm contains helm-specific configuration

type PlatformConfigToolchainHelmfile

type PlatformConfigToolchainHelmfile struct {
	Version string `yaml:"version,omitempty"`
}

PlatformConfigToolchainHelmfile contains helmfile-specific configuration

type PlatformConfigToolchainKubeseal added in v0.3.1

type PlatformConfigToolchainKubeseal struct {
	Version    string                                    `yaml:"version,omitempty"`
	Controller PlatformConfigToolchainKubesealController `yaml:"controller,omitempty"`
}

PlatformConfigToolchainKubeseal contains kubeseal-specific configuration

type PlatformConfigToolchainKubesealController added in v0.3.2

type PlatformConfigToolchainKubesealController struct {
	NS   string `yaml:"namespace,omitempty"`
	Name string `yaml:"name,omitempty"`
}

PlatformConfigToolchainKubeseal contains kubeseal-controller-specific configuration

type PlatformConfigToolchainSops added in v0.3.0

type PlatformConfigToolchainSops struct {
	Version string `yaml:"version,omitempty"`
}

PlatformConfigToolchainSops contains sops-specific configuration

type PlatformConfigToolchainTF

type PlatformConfigToolchainTF struct {
	Provider string `yaml:"provider,omitempty"`
	Version  string `yaml:"version,omitempty"`
}

PlatformConfigToolchainTF contains tf-specific configuration

type PlaybookTarget

type PlaybookTarget struct {
	Hosts      string `yaml:"hosts"`
	Connection string `yaml:"connection,omitempty"`
}

type ProgressReader

type ProgressReader struct {
	Name   string
	Reader io.Reader
	Size   int64
	Pos    int64
}

func (*ProgressReader) Read

func (pr *ProgressReader) Read(p []byte) (int, error)

type PypiSimpleManifest

type PypiSimpleManifest struct {
	Releases []string `json:"versions"`
}

type SecretProviderEnv

type SecretProviderEnv struct {
	EnvVar string
}

func NewSecretProviderEnv

func NewSecretProviderEnv(ptfCfg *PlatformConfig) (*SecretProviderEnv, error)

func (*SecretProviderEnv) Get

func (s *SecretProviderEnv) Get() (string, error)

func (*SecretProviderEnv) IsSupported added in v0.5.0

func (s *SecretProviderEnv) IsSupported(feature string) bool

func (*SecretProviderEnv) LastMod added in v0.5.0

func (s *SecretProviderEnv) LastMod(path, secret string) (time.Time, error)

func (*SecretProviderEnv) Login

func (s *SecretProviderEnv) Login() error

func (*SecretProviderEnv) PostFlight

func (s *SecretProviderEnv) PostFlight() error

func (*SecretProviderEnv) Read added in v0.5.0

func (s *SecretProviderEnv) Read(path, secret string) (map[string]any, error)

func (*SecretProviderEnv) Set

func (s *SecretProviderEnv) Set(secret string) error

func (*SecretProviderEnv) Write added in v0.5.0

func (s *SecretProviderEnv) Write(path, secret string, payload map[string]any) error

type SecretProviderFile

type SecretProviderFile struct {
	Filename string
}

func NewSecretProviderFile

func NewSecretProviderFile(ptfCfg *PlatformConfig) (*SecretProviderFile, error)

func (*SecretProviderFile) Get

func (s *SecretProviderFile) Get() (string, error)

func (*SecretProviderFile) IsSupported added in v0.5.0

func (s *SecretProviderFile) IsSupported(feature string) bool

func (*SecretProviderFile) LastMod added in v0.5.0

func (s *SecretProviderFile) LastMod(path, secret string) (time.Time, error)

func (*SecretProviderFile) Login

func (s *SecretProviderFile) Login() error

func (*SecretProviderFile) PostFlight

func (s *SecretProviderFile) PostFlight() error

func (*SecretProviderFile) Read added in v0.5.0

func (s *SecretProviderFile) Read(path, secret string) (map[string]any, error)

func (*SecretProviderFile) Set

func (s *SecretProviderFile) Set(secret string) error

func (*SecretProviderFile) Write added in v0.5.0

func (s *SecretProviderFile) Write(path, secret string, payload map[string]any) error

type SecretProviderHCP

type SecretProviderHCP struct {
	Client       *vault.Client
	ID           string
	Mount        string
	AuthMethod   string
	Token        string
	TokenEnv     string
	TokenFile    string
	UsernameEnv  string
	UsernameFile string
	PasswordEnv  string
	PasswordFile string
	// contains filtered or unexported fields
}

func NewSecretProviderHCP

func NewSecretProviderHCP(ptfCfg *PlatformConfig) (*SecretProviderHCP, error)

func (*SecretProviderHCP) Get

func (s *SecretProviderHCP) Get() (string, error)

func (*SecretProviderHCP) IsSupported added in v0.5.0

func (s *SecretProviderHCP) IsSupported(feature string) bool

func (*SecretProviderHCP) LastMod added in v0.5.0

func (s *SecretProviderHCP) LastMod(path, secret string) (time.Time, error)

func (*SecretProviderHCP) Login

func (s *SecretProviderHCP) Login() error

func (*SecretProviderHCP) PostFlight

func (s *SecretProviderHCP) PostFlight() error

func (*SecretProviderHCP) Read added in v0.5.0

func (s *SecretProviderHCP) Read(path, secret string) (map[string]any, error)

func (*SecretProviderHCP) Set

func (s *SecretProviderHCP) Set(secret string) error

func (*SecretProviderHCP) UserpassLogin added in v0.5.0

func (s *SecretProviderHCP) UserpassLogin(username, password string) error

func (*SecretProviderHCP) Write added in v0.5.0

func (s *SecretProviderHCP) Write(path, secret string, payload map[string]any) error

type SecretProviderInput

type SecretProviderInput struct{}

func NewSecretProviderInput

func NewSecretProviderInput(ptfCfg *PlatformConfig) (*SecretProviderInput, error)

func (*SecretProviderInput) Get

func (s *SecretProviderInput) Get() (string, error)

func (*SecretProviderInput) IsSupported added in v0.5.0

func (s *SecretProviderInput) IsSupported(feature string) bool

func (*SecretProviderInput) LastMod added in v0.5.0

func (s *SecretProviderInput) LastMod(path, secret string) (time.Time, error)

func (*SecretProviderInput) Login

func (s *SecretProviderInput) Login() error

func (*SecretProviderInput) PostFlight

func (s *SecretProviderInput) PostFlight() error

func (*SecretProviderInput) Read added in v0.5.0

func (s *SecretProviderInput) Read(path, secret string) (map[string]any, error)

func (*SecretProviderInput) Set

func (s *SecretProviderInput) Set(secret string) error

func (*SecretProviderInput) Write added in v0.5.0

func (s *SecretProviderInput) Write(path, secret string, payload map[string]any) error

type SecretProviderKeyring

type SecretProviderKeyring struct {
	Keyring keyring.Keyring
	ID      string
}

func NewSecretProviderKeyring

func NewSecretProviderKeyring(ptfCfg *PlatformConfig) (*SecretProviderKeyring, error)

func (*SecretProviderKeyring) Get

func (s *SecretProviderKeyring) Get() (string, error)

func (*SecretProviderKeyring) IsSupported added in v0.5.0

func (s *SecretProviderKeyring) IsSupported(feature string) bool

func (*SecretProviderKeyring) LastMod added in v0.5.0

func (s *SecretProviderKeyring) LastMod(path, secret string) (time.Time, error)

func (*SecretProviderKeyring) Login

func (s *SecretProviderKeyring) Login() error

func (*SecretProviderKeyring) PostFlight

func (s *SecretProviderKeyring) PostFlight() error

func (*SecretProviderKeyring) Read added in v0.5.0

func (s *SecretProviderKeyring) Read(path, secret string) (map[string]any, error)

func (*SecretProviderKeyring) Set

func (s *SecretProviderKeyring) Set(secret string) error

func (*SecretProviderKeyring) Write added in v0.5.0

func (s *SecretProviderKeyring) Write(path, secret string, payload map[string]any) error

type SecretSync added in v0.5.0

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

func NewSecretSync added in v0.5.0

func NewSecretSync(ptfCfg *PlatformConfig, file, path, secret string) (SecretSync, error)

func (*SecretSync) EditAndSync added in v0.5.0

func (s *SecretSync) EditAndSync() error

func (*SecretSync) LocalHasPrecedence added in v0.5.0

func (s *SecretSync) LocalHasPrecedence() bool

type SecretSyncLocal added in v0.5.0

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

func (*SecretSyncLocal) Decrypt added in v0.5.0

func (s *SecretSyncLocal) Decrypt() error

func (*SecretSyncLocal) Encrypt added in v0.5.0

func (s *SecretSyncLocal) Encrypt() error

func (*SecretSyncLocal) LastMod added in v0.5.0

func (s *SecretSyncLocal) LastMod() error

type SecretSyncRemote added in v0.5.0

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

func (*SecretSyncRemote) Decrypt added in v0.5.0

func (s *SecretSyncRemote) Decrypt() error

func (*SecretSyncRemote) Encrypt added in v0.5.0

func (s *SecretSyncRemote) Encrypt() error

func (*SecretSyncRemote) LastMod added in v0.5.0

func (s *SecretSyncRemote) LastMod() error

type SecretsProvider

type SecretsProvider interface {
	IsSupported(feature string) bool
	Login() error
	Get() (string, error)
	Set(secret string) error
	LastMod(path, secret string) (time.Time, error)
	Read(path, secret string) (map[string]any, error)
	Write(path, secret string, payload map[string]any) error
	PostFlight() error
}

func GetSecretsProvider

func GetSecretsProvider(ptfCfg *PlatformConfig) (SecretsProvider, error)

type SopsMetadata added in v0.5.0

type SopsMetadata struct {
	Sops struct {
		LastModified string `yaml:"lastmodified"`
	} `yaml:"sops"`
}

SopsMetadata represents the internal structure of the SOPS block

type ThirdPartyTool

type ThirdPartyTool struct {
	Name       string
	Version    string
	GitHubRepo string
	SourceURI  string
	Binaries   []string
	BinaryName string
	PypiRepo   string
	PipAddOns  map[string]string
}

func (*ThirdPartyTool) Download

func (tp *ThirdPartyTool) Download() (string, error)

func (*ThirdPartyTool) ExtractFromTarballArchive

func (tp *ThirdPartyTool) ExtractFromTarballArchive(dstDir string) error

func (*ThirdPartyTool) ExtractFromZipArchive

func (tp *ThirdPartyTool) ExtractFromZipArchive(dstDir string) error

func (*ThirdPartyTool) PipCheckAndInstall

func (tp *ThirdPartyTool) PipCheckAndInstall(venvDir, requestedVersion string, update bool) error

func (*ThirdPartyTool) PipInstall

func (tp *ThirdPartyTool) PipInstall(venvDir string) error

func (*ThirdPartyTool) StandaloneBinary

func (tp *ThirdPartyTool) StandaloneBinary(dst string) error

Jump to

Keyboard shortcuts

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