Documentation
¶
Index ¶
- Constants
- func DSVGetSecret(client HTTPClient, apiEndpoint, accessToken string, item SecretToRetrieve, ...) (map[string]interface{}, error)
- func DSVGetToken(c HTTPClient, apiEndpoint string, cfg *Config) (string, error)
- func ExportEnvVariable(envFile *os.File, key, val string) error
- func OpenEnvFile(cfg *Config) (*os.File, 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 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)
func OpenEnvFile ¶
OpenEnvFile storing secrets that can extend to another job or task in Gitlab. See [GitLab - Passing An Environment Variable to Another Job](https://docs.gitlab.com/ee/ci/variables/#pass-an-environment-variable-to-another-job)
Types ¶
type Config ¶
type Config struct {
IsCI bool `env:"GITLAB_CI"` // IsCI determines if the system is detecting being in CI system.
IsDebug bool `env:"DEBUG"` // IsDebug is based on gitlab 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"`
}
func ParseRetrieve ¶
func ParseRetrieve(retrieve string) ([]SecretToRetrieve, error)
Click to show internal directories.
Click to hide internal directories.