Documentation
¶
Index ¶
- Constants
- func ActionsExportVariable(envFile *os.File, key, val string) error
- func ActionsOpenEnvFile(cfg *Config) (*os.File, error)
- func DSVGetSecret(client HTTPClient, apiEndpoint, accessToken string, item SecretToRetrieve, ...) (map[string]interface{}, error)
- func DSVGetToken(c HTTPClient, apiEndpoint string, cfg *Config) (string, error)
- func Run() error
- type Config
- type HTTPClient
- type SecretToRetrieve
Constants ¶
View Source
const PermissionReadWriteOwner = 0o600
PermissionReadWriteOwner is the octal permission for Read Write for the owner of the file.
Variables ¶
This section is empty.
Functions ¶
func ActionsOpenEnvFile ¶
ActionsOpenEnvFile is used for writing secrets back in GitHub.
func DSVGetSecret ¶
func DSVGetSecret(client HTTPClient, apiEndpoint, accessToken string, item SecretToRetrieve, cfg *Config) (map[string]interface{}, error)
func DSVGetToken ¶
func DSVGetToken(c HTTPClient, apiEndpoint string, cfg *Config) (string, error)
Types ¶
type Config ¶
type Config struct {
IsCI bool `env:"GITHUB_ACTIONS"` // IsCI determines if the system is detecting being in CI system.
IsDebug bool `env:"RUNNER_DEBUG"` // IsDebug is based on github action flagging as debug/trace level.
SetEnv bool `env:"DSV_SET_ENV"` // SetEnv is only for GitHub Actions.
DomainEnv string `env:"DSV_DOMAIN,required"` // Tenant domain name (e.g. example.secretsvaultcloud.com).
ClientIDEnv string `env:"DSV_CLIENT_ID,required"` // Client ID for authentication.
ClientSecretEnv string `json:"-" env:"DSV_CLIENT_SECRET,required"` // Client Secret for authentication.
RetrieveEnv string `env:"DSV_RETRIEVE,required"` // JSON formatted string with data to retrieve from DSV.
}
type SecretToRetrieve ¶
type SecretToRetrieve struct {
SecretPath string `json:"secretPath"`
SecretKey string `json:"secretKey"`
OutputVariable string `json:"outputVariable"`
}
RetrieveValues is the struct to put keyvalues into
type RetrieveValues struct {
SecretToRetrieve []SingleValue
}
func ParseRetrieve ¶
func ParseRetrieve(retrieve string) ([]SecretToRetrieve, error)
Click to show internal directories.
Click to hide internal directories.