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) (envFile *os.File, err 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. https://docs.gitlab.com/ee/ci/variables/#enable-debug-logging
IsDebug bool `env:"CI_DEBUG_TRACE"` // IsDebug is based on gitlab flagging as debug/trace level.
CIProjectDirectory string `env:"CI_PROJECT_DIR,notEmpty"` // CIProjectDirectory is populated by CI_PROJECT_DIR which provides the fully qualified path to the project. https://docs.gitlab.com/ee/ci/variables/
CIJobName string `env:"CI_JOB_NAME,notEmpty"` // CIJobName is populated by CI_JOB_NAME which provides the fully qualified path to the project. https://docs.gitlab.com/ee/ci/variables/
DomainEnv string `env:"DSV_DOMAIN,notEmpty"` // Tenant domain name (e.g. example.secretsvaultcloud.com).
ClientIDEnv string `env:"DSV_CLIENT_ID,notEmpty"` // Client ID for authentication.
ClientSecretEnv string `json:"-" env:"DSV_CLIENT_SECRET,notEmpty"` // Client Secret for authentication.
RetrieveEnv string `env:"DSV_RETRIEVE,notEmpty"` // 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"`
}
SecretToRetrieve defines JSON format of elements that expected in DSV_RETRIEVE list.
func ParseRetrieve ¶
func ParseRetrieve(retrieve string) ([]SecretToRetrieve, error)
Click to show internal directories.
Click to hide internal directories.