Documentation
¶
Index ¶
- Constants
- Variables
- func BinExec(bin, dir string, args, envs []string) error
- func BinExecOut(bin, dir string, args, envs []string) (string, error)
- func BinExecOutNoErr(bin, dir string, args, envs []string) (string, error)
- func CheckSameDevice(src string) (bool, error)
- func DownloadFile(name, src string, dst *os.File) error
- func GetPlatformConfigCustomFile() string
- func GetPlatformConfigFile() string
- func GetSSHCredentials(ptfCfg *PlatformConfig, bootstrap bool) (string, string, error)
- func GrantExecRights(bin string) error
- func IsGitRepoUpToDate(ptfCfg *PlatformConfig, bypass bool) (bool, error)
- func KobraError(format string, args ...any) error
- func LookupAnsibleDir() (string, error)
- func LookupBooleanDefault(cfg *bool, v string, dft bool) bool
- func LookupDefault(cfg *string, v, dft string) bool
- func LookupEnv(cfg *string, env, dft string) bool
- func LookupHelmfileDir() (string, error)
- func LookupPlatformBinDir() (string, error)
- func LookupPlatformBinary(binName string) (string, error)
- func LookupPlatformConfigDir() (string, error)
- func LookupPlatformDir() (string, error)
- func LookupSystemBinary(binName string) (string, error)
- func LookupTerraformDir() (string, error)
- func NewAnsibleDeploySubCommand() *cobra.Command
- func NewAnsibleInventorySubCommand(name, desc string) *cobra.Command
- func NewHfSubCommand(name, desc string) *cobra.Command
- func NewSealCommand() *cobra.Command
- func NewSecretsGetSetSubCommand(name, desc string) *cobra.Command
- func NewTfSubCommand(name, desc string) *cobra.Command
- func ParseCommands()
- func RunAnsible(toolchainUpdate bool, playbook string, ...) error
- func RunAnsibleInventory(toolchainUpdate bool, cmd, playbook, group, host, out, extraVars, limit string, ...) error
- func RunAnsiblePull() error
- func RunHelmfile(toolchainUpdate bool, cmd string, verbose, bypass bool, ...) error
- func RunKubeseal(toolchainUpdate bool, sealNamespace, sealSecret, sealLiteral string, ...) error
- func RunSecretsEdit(file string) error
- func RunSecretsEncrypt(file string) error
- func RunSecretsGet() error
- func RunSecretsInit() error
- func RunSecretsSet(masterKey string) error
- func RunSecretsView(file string) error
- func RunTF(toolchainUpdate bool, cmd, module, resource, output string, auto, bypass bool, ...) error
- func SetupPlatformToolchain(cfg *PlatformConfig, update bool, tools ...string) error
- func SopsEditFile(file string) error
- func SopsEncryptFile(file string) error
- func SopsViewFile(file string) error
- func StandaloneBinary(src, dst string) error
- func TemplatedURI(uri, version string) string
- type GitHubRelease
- type KobraSecretData
- type PlatformConfig
- type PlatformConfigGit
- type PlatformConfigGitHTTP
- type PlatformConfigGitSSH
- type PlatformConfigSSH
- type PlatformConfigSecrets
- type PlatformConfigSecretsAWS
- type PlatformConfigSecretsEnv
- type PlatformConfigSecretsFile
- type PlatformConfigSecretsHCP
- type PlatformConfigSecretsSyncMap
- type PlatformConfigSshConfig
- type PlatformConfigToolchain
- type PlatformConfigToolchainAnsible
- type PlatformConfigToolchainHelm
- type PlatformConfigToolchainHelmfile
- type PlatformConfigToolchainKubeseal
- type PlatformConfigToolchainKubesealController
- type PlatformConfigToolchainSops
- type PlatformConfigToolchainTF
- type PlaybookTarget
- type ProgressReader
- type PypiSimpleManifest
- type SecretProviderEnv
- func (s *SecretProviderEnv) Get() (string, error)
- func (s *SecretProviderEnv) IsSupported(feature string) bool
- func (s *SecretProviderEnv) LastMod(path, secret string) (time.Time, error)
- func (s *SecretProviderEnv) Login() error
- func (s *SecretProviderEnv) PostFlight() error
- func (s *SecretProviderEnv) Read(path, secret string) (map[string]any, error)
- func (s *SecretProviderEnv) Set(secret string) error
- func (s *SecretProviderEnv) Write(path, secret string, payload map[string]any) error
- type SecretProviderFile
- func (s *SecretProviderFile) Get() (string, error)
- func (s *SecretProviderFile) IsSupported(feature string) bool
- func (s *SecretProviderFile) LastMod(path, secret string) (time.Time, error)
- func (s *SecretProviderFile) Login() error
- func (s *SecretProviderFile) PostFlight() error
- func (s *SecretProviderFile) Read(path, secret string) (map[string]any, error)
- func (s *SecretProviderFile) Set(secret string) error
- func (s *SecretProviderFile) Write(path, secret string, payload map[string]any) error
- type SecretProviderHCP
- func (s *SecretProviderHCP) Get() (string, error)
- func (s *SecretProviderHCP) IsSupported(feature string) bool
- func (s *SecretProviderHCP) LastMod(path, secret string) (time.Time, error)
- func (s *SecretProviderHCP) Login() error
- func (s *SecretProviderHCP) PostFlight() error
- func (s *SecretProviderHCP) Read(path, secret string) (map[string]any, error)
- func (s *SecretProviderHCP) Set(secret string) error
- func (s *SecretProviderHCP) UserpassLogin(username, password string) error
- func (s *SecretProviderHCP) Write(path, secret string, payload map[string]any) error
- type SecretProviderInput
- func (s *SecretProviderInput) Get() (string, error)
- func (s *SecretProviderInput) IsSupported(feature string) bool
- func (s *SecretProviderInput) LastMod(path, secret string) (time.Time, error)
- func (s *SecretProviderInput) Login() error
- func (s *SecretProviderInput) PostFlight() error
- func (s *SecretProviderInput) Read(path, secret string) (map[string]any, error)
- func (s *SecretProviderInput) Set(secret string) error
- func (s *SecretProviderInput) Write(path, secret string, payload map[string]any) error
- type SecretProviderKeyring
- func (s *SecretProviderKeyring) Get() (string, error)
- func (s *SecretProviderKeyring) IsSupported(feature string) bool
- func (s *SecretProviderKeyring) LastMod(path, secret string) (time.Time, error)
- func (s *SecretProviderKeyring) Login() error
- func (s *SecretProviderKeyring) PostFlight() error
- func (s *SecretProviderKeyring) Read(path, secret string) (map[string]any, error)
- func (s *SecretProviderKeyring) Set(secret string) error
- func (s *SecretProviderKeyring) Write(path, secret string, payload map[string]any) error
- type SecretSync
- type SecretSyncLocal
- type SecretSyncRemote
- type SecretsProvider
- type SopsMetadata
- type ThirdPartyTool
- func (tp *ThirdPartyTool) Download() (string, error)
- func (tp *ThirdPartyTool) ExtractFromTarballArchive(dstDir string) error
- func (tp *ThirdPartyTool) ExtractFromZipArchive(dstDir string) error
- func (tp *ThirdPartyTool) PipCheckAndInstall(venvDir, requestedVersion string, update bool) error
- func (tp *ThirdPartyTool) PipInstall(venvDir string) error
- func (tp *ThirdPartyTool) StandaloneBinary(dst string) error
Constants ¶
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" )
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" )
const ( HelmBin = "helm" HelmfileBin = "helmfile" HelmfileConfigFile = "helmfile.yaml" HelmfileConfigFileTemplate = "helmfile.yaml.gotmpl" )
const ( KobraConfigDir = ".kobra.d" KobraPlatformBinDir = "bin" AnsibleDirName = "ansible" HelmfileDirName = "helmfile" TerraformDirName = "terraform" )
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" )
const ( SopsCreateAtPrefix = "# created: " SopsPublicKeyPrefix = "# public key: " SopsAgeSecretKeyPrefix = "AGE-SECRET-KEY" SopsAgeKeyFileEnv = "SOPS_AGE_KEY_FILE" SopsAgeRecipientsEnv = "SOPS_AGE_RECIPIENTS" SecretsFeatureSyncMap = "SECRETS_FEATURE_SYNC_MAP" )
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) )
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" )
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" )
const ( SSHConfigUser = "user" SSHConfigKey = "IdentityFile" SSHAgentSocketEnv = "SSH_AUTH_SOCK" )
const ( TerraformBin = "terraform" OpenTofuBin = "tofu" )
const (
KeyringService = "kobra"
)
const (
KubesealBin = "kubeseal"
)
const (
SecretsProviderEnvVariableDefault = "KOBRA_MASTER_KEY" // #nosec G101
)
Variables ¶
var RootCmd = &cobra.Command{
Use: "kobra",
Short: "Kobra - DevOps deployment swiss-army knife utility",
}
Functions ¶
func CheckSameDevice ¶
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 IsGitRepoUpToDate ¶
func IsGitRepoUpToDate(ptfCfg *PlatformConfig, bypass bool) (bool, error)
func KobraError ¶
func LookupAnsibleDir ¶
func LookupDefault ¶
func LookupHelmfileDir ¶
func LookupPlatformBinDir ¶
func LookupPlatformBinary ¶
func LookupPlatformConfigDir ¶
func LookupPlatformDir ¶
func LookupSystemBinary ¶
func LookupTerraformDir ¶
func NewAnsibleInventorySubCommand ¶ added in v0.5.0
func NewHfSubCommand ¶
func NewSealCommand ¶ added in v0.3.2
func NewTfSubCommand ¶
func ParseCommands ¶
func ParseCommands()
func RunAnsible ¶
func RunAnsibleInventory ¶ added in v0.5.0
func RunAnsiblePull ¶
func RunAnsiblePull() error
func RunHelmfile ¶
func RunKubeseal ¶ added in v0.3.2
func RunSecretsEdit ¶
func RunSecretsEncrypt ¶
func RunSecretsGet ¶
func RunSecretsGet() error
func RunSecretsInit ¶
func RunSecretsInit() error
func RunSecretsSet ¶
func RunSecretsView ¶
func SetupPlatformToolchain ¶
func SetupPlatformToolchain(cfg *PlatformConfig, update bool, tools ...string) error
func SopsEditFile ¶
func SopsEncryptFile ¶
func SopsViewFile ¶
func StandaloneBinary ¶
func TemplatedURI ¶
Types ¶
type GitHubRelease ¶
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 ¶
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 ProgressReader ¶
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
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
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
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
type SecretProviderKeyring ¶
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
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
Source Files
¶
- ansible.go
- cmd_ansible.go
- cmd_helmfile.go
- cmd_kubeseal.go
- cmd_secrets.go
- cmd_tf.go
- cmd_version.go
- commands.go
- errors.go
- exec.go
- git.go
- helmfile.go
- kubeseal.go
- lookups.go
- platform_config.go
- secrets.go
- secrets_provider_env.go
- secrets_provider_file.go
- secrets_provider_hcp.go
- secrets_provider_input.go
- secrets_provider_keyring.go
- setup.go
- sops.go
- ssh.go
- tf.go