1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-09-16 09:26:22 +02:00

Feature/vault refactoring (#3113)

* refactor vault code

* adjust generator

* wip: fix tests

* regenerate influxdb

* fix test

* add another test

* fix test & docs

* fix formatting

* Minorupdate and fixes

Co-authored-by: Kevin Stiehl <kevin.stiehl@numericas.de>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
This commit is contained in:
Eugene Kortelyov
2021-09-21 14:06:32 +03:00
committed by GitHub
parent 893edfe4d6
commit 56be54c504
55 changed files with 338 additions and 348 deletions

View File

@@ -169,9 +169,9 @@ func abapEnvironmentCreateSystemMetadata() config.StepData {
}, },
{ {
Name: "", Name: "cloudfoundryVaultSecretName",
Paths: []string{"$(vaultPath)/cloudfoundry-$(org)-$(space)", "$(vaultBasePath)/$(vaultPipelineName)/cloudfoundry-$(org)-$(space)", "$(vaultBasePath)/GROUP-SECRETS/cloudfoundry-$(org)-$(space)"}, Type: "vaultSecret",
Type: "vaultSecret", Default: "cloudfoundry-$(org)-$(space)",
}, },
}, },
Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"PARAMETERS", "STAGES", "STEPS"},
@@ -190,9 +190,9 @@ func abapEnvironmentCreateSystemMetadata() config.StepData {
}, },
{ {
Name: "", Name: "cloudfoundryVaultSecretName",
Paths: []string{"$(vaultPath)/cloudfoundry-$(org)-$(space)", "$(vaultBasePath)/$(vaultPipelineName)/cloudfoundry-$(org)-$(space)", "$(vaultBasePath)/GROUP-SECRETS/cloudfoundry-$(org)-$(space)"}, Type: "vaultSecret",
Type: "vaultSecret", Default: "cloudfoundry-$(org)-$(space)",
}, },
}, },
Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"PARAMETERS", "STAGES", "STEPS"},

View File

@@ -368,9 +368,9 @@ func artifactPrepareVersionMetadata() config.StepData {
}, },
{ {
Name: "", Name: "gitHttpsCredentialVaultSecretName",
Paths: []string{"$(vaultPath)/gitHttpsCredential", "$(vaultBasePath)/$(vaultPipelineName)/gitHttpsCredential", "$(vaultBasePath)/GROUP-SECRETS/gitHttpsCredential"}, Type: "vaultSecret",
Type: "vaultSecret", Default: "gitHttpsCredential",
}, },
}, },
Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"PARAMETERS", "STAGES", "STEPS"},
@@ -425,9 +425,9 @@ func artifactPrepareVersionMetadata() config.StepData {
}, },
{ {
Name: "", Name: "gitHttpsCredentialVaultSecretName",
Paths: []string{"$(vaultPath)/gitHttpsCredential", "$(vaultBasePath)/$(vaultPipelineName)/gitHttpsCredential", "$(vaultBasePath)/GROUP-SECRETS/gitHttpsCredential"}, Type: "vaultSecret",
Type: "vaultSecret", Default: "gitHttpsCredential",
}, },
}, },
Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"PARAMETERS", "STAGES", "STEPS"},

View File

@@ -380,9 +380,9 @@ func checkmarxExecuteScanMetadata() config.StepData {
}, },
{ {
Name: "", Name: "checkmarxVaultSecretName",
Paths: []string{"$(vaultPath)/checkmarx", "$(vaultBasePath)/$(vaultPipelineName)/checkmarx", "$(vaultBasePath)/GROUP-SECRETS/checkmarx"}, Type: "vaultSecret",
Type: "vaultSecret", Default: "checkmarx",
}, },
}, },
Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"PARAMETERS", "STAGES", "STEPS"},
@@ -464,9 +464,9 @@ func checkmarxExecuteScanMetadata() config.StepData {
}, },
{ {
Name: "", Name: "checkmarxVaultSecretName",
Paths: []string{"$(vaultPath)/checkmarx", "$(vaultBasePath)/$(vaultPipelineName)/checkmarx", "$(vaultBasePath)/GROUP-SECRETS/checkmarx"}, Type: "vaultSecret",
Type: "vaultSecret", Default: "checkmarx",
}, },
}, },
Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"PARAMETERS", "STAGES", "STEPS"},

View File

@@ -153,9 +153,9 @@ func cloudFoundryCreateServiceKeyMetadata() config.StepData {
}, },
{ {
Name: "", Name: "cloudfoundryVaultSecretName",
Paths: []string{"$(vaultPath)/cloudfoundry-$(org)-$(space)", "$(vaultBasePath)/$(vaultPipelineName)/cloudfoundry-$(org)-$(space)", "$(vaultBasePath)/GROUP-SECRETS/cloudfoundry-$(org)-$(space)"}, Type: "vaultSecret",
Type: "vaultSecret", Default: "cloudfoundry-$(org)-$(space)",
}, },
}, },
Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"PARAMETERS", "STAGES", "STEPS"},
@@ -174,9 +174,9 @@ func cloudFoundryCreateServiceKeyMetadata() config.StepData {
}, },
{ {
Name: "", Name: "cloudfoundryVaultSecretName",
Paths: []string{"$(vaultPath)/cloudfoundry-$(org)-$(space)", "$(vaultBasePath)/$(vaultPipelineName)/cloudfoundry-$(org)-$(space)", "$(vaultBasePath)/GROUP-SECRETS/cloudfoundry-$(org)-$(space)"}, Type: "vaultSecret",
Type: "vaultSecret", Default: "cloudfoundry-$(org)-$(space)",
}, },
}, },
Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"PARAMETERS", "STAGES", "STEPS"},

View File

@@ -172,9 +172,9 @@ func cloudFoundryCreateServiceMetadata() config.StepData {
}, },
{ {
Name: "", Name: "cloudfoundryVaultSecretName",
Paths: []string{"$(vaultPath)/cloudfoundry-$(org)-$(space)", "$(vaultBasePath)/$(vaultPipelineName)/cloudfoundry-$(org)-$(space)", "$(vaultBasePath)/GROUP-SECRETS/cloudfoundry-$(org)-$(space)"}, Type: "vaultSecret",
Type: "vaultSecret", Default: "cloudfoundry-$(org)-$(space)",
}, },
}, },
Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"PARAMETERS", "STAGES", "STEPS"},
@@ -193,9 +193,9 @@ func cloudFoundryCreateServiceMetadata() config.StepData {
}, },
{ {
Name: "", Name: "cloudfoundryVaultSecretName",
Paths: []string{"$(vaultPath)/cloudfoundry-$(org)-$(space)", "$(vaultBasePath)/$(vaultPipelineName)/cloudfoundry-$(org)-$(space)", "$(vaultBasePath)/GROUP-SECRETS/cloudfoundry-$(org)-$(space)"}, Type: "vaultSecret",
Type: "vaultSecret", Default: "cloudfoundry-$(org)-$(space)",
}, },
}, },
Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"PARAMETERS", "STAGES", "STEPS"},

View File

@@ -150,9 +150,9 @@ func cloudFoundryDeleteServiceMetadata() config.StepData {
}, },
{ {
Name: "", Name: "cloudfoundryVaultSecretName",
Paths: []string{"$(vaultPath)/cloudfoundry-$(org)-$(space)", "$(vaultBasePath)/$(vaultPipelineName)/cloudfoundry-$(org)-$(space)", "$(vaultBasePath)/GROUP-SECRETS/cloudfoundry-$(org)-$(space)"}, Type: "vaultSecret",
Type: "vaultSecret", Default: "cloudfoundry-$(org)-$(space)",
}, },
}, },
Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"PARAMETERS", "STAGES", "STEPS"},
@@ -171,9 +171,9 @@ func cloudFoundryDeleteServiceMetadata() config.StepData {
}, },
{ {
Name: "", Name: "cloudfoundryVaultSecretName",
Paths: []string{"$(vaultPath)/cloudfoundry-$(org)-$(space)", "$(vaultBasePath)/$(vaultPipelineName)/cloudfoundry-$(org)-$(space)", "$(vaultBasePath)/GROUP-SECRETS/cloudfoundry-$(org)-$(space)"}, Type: "vaultSecret",
Type: "vaultSecret", Default: "cloudfoundry-$(org)-$(space)",
}, },
}, },
Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"PARAMETERS", "STAGES", "STEPS"},

View File

@@ -478,9 +478,9 @@ func cloudFoundryDeployMetadata() config.StepData {
}, },
{ {
Name: "", Name: "cloudfoundryVaultSecretName",
Paths: []string{"$(vaultPath)/cloudfoundry-$(org)-$(space)", "$(vaultBasePath)/$(vaultPipelineName)/cloudfoundry-$(org)-$(space)", "$(vaultBasePath)/GROUP-SECRETS/cloudfoundry-$(org)-$(space)"}, Type: "vaultSecret",
Type: "vaultSecret", Default: "cloudfoundry-$(org)-$(space)",
}, },
}, },
Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"PARAMETERS", "STAGES", "STEPS"},
@@ -526,9 +526,9 @@ func cloudFoundryDeployMetadata() config.StepData {
}, },
{ {
Name: "", Name: "cloudfoundryVaultSecretName",
Paths: []string{"$(vaultPath)/cloudfoundry-$(org)-$(space)", "$(vaultBasePath)/$(vaultPipelineName)/cloudfoundry-$(org)-$(space)", "$(vaultBasePath)/GROUP-SECRETS/cloudfoundry-$(org)-$(space)"}, Type: "vaultSecret",
Type: "vaultSecret", Default: "cloudfoundry-$(org)-$(space)",
}, },
}, },
Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"PARAMETERS", "STAGES", "STEPS"},

View File

@@ -229,9 +229,8 @@ func cnbBuildMetadata() config.StepData {
}, },
{ {
Name: "", Name: "",
Paths: []string{"$(vaultPath)/docker-config", "$(vaultBasePath)/$(vaultPipelineName)/docker-config", "$(vaultBasePath)/GROUP-SECRETS/docker-config"}, Type: "vaultSecretFile",
Type: "vaultSecretFile",
}, },
}, },
Scope: []string{"PARAMETERS"}, Scope: []string{"PARAMETERS"},

View File

@@ -229,9 +229,9 @@ func detectExecuteScanMetadata() config.StepData {
}, },
{ {
Name: "", Name: "detectVaultSecretName",
Paths: []string{"$(vaultPath)/detect", "$(vaultBasePath)/$(vaultPipelineName)/detect", "$(vaultBasePath)/GROUP-SECRETS/detect"}, Type: "vaultSecret",
Type: "vaultSecret", Default: "detect",
}, },
}, },
Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"PARAMETERS", "STAGES", "STEPS"},

View File

@@ -329,9 +329,9 @@ func fortifyExecuteScanMetadata() config.StepData {
}, },
{ {
Name: "", Name: "fortifyVaultSecretName",
Paths: []string{"$(vaultPath)/fortify", "$(vaultBasePath)/$(vaultPipelineName)/fortify", "$(vaultBasePath)/GROUP-SECRETS/fortify"}, Type: "vaultSecret",
Type: "vaultSecret", Default: "fortify",
}, },
}, },
Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"PARAMETERS", "STAGES", "STEPS"},
@@ -367,9 +367,9 @@ func fortifyExecuteScanMetadata() config.StepData {
}, },
{ {
Name: "", Name: "githubVaultSecretName",
Paths: []string{"$(vaultPath)/github", "$(vaultBasePath)/$(vaultPipelineName)/github", "$(vaultBasePath)/GROUP-SECRETS/github"}, Type: "vaultSecret",
Type: "vaultSecret", Default: "github",
}, },
}, },
Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"},

View File

@@ -215,9 +215,9 @@ func githubCheckBranchProtectionMetadata() config.StepData {
}, },
{ {
Name: "", Name: "githubVaultSecretName",
Paths: []string{"$(vaultPath)/github", "$(vaultBasePath)/$(vaultPipelineName)/github", "$(vaultBasePath)/GROUP-SECRETS/github"}, Type: "vaultSecret",
Type: "vaultSecret", Default: "github",
}, },
}, },
Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"},

View File

@@ -195,9 +195,9 @@ func githubCommentIssueMetadata() config.StepData {
}, },
{ {
Name: "", Name: "githubVaultSecretName",
Paths: []string{"$(vaultPath)/github", "$(vaultBasePath)/$(vaultPipelineName)/github", "$(vaultBasePath)/GROUP-SECRETS/github"}, Type: "vaultSecret",
Type: "vaultSecret", Default: "github",
}, },
}, },
Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"},

View File

@@ -204,9 +204,9 @@ func githubCreateIssueMetadata() config.StepData {
}, },
{ {
Name: "", Name: "githubVaultSecretName",
Paths: []string{"$(vaultPath)/github", "$(vaultBasePath)/$(vaultPipelineName)/github", "$(vaultBasePath)/GROUP-SECRETS/github"}, Type: "vaultSecret",
Type: "vaultSecret", Default: "github",
}, },
}, },
Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"},

View File

@@ -243,9 +243,9 @@ func githubCreatePullRequestMetadata() config.StepData {
}, },
{ {
Name: "", Name: "githubVaultSecretName",
Paths: []string{"$(vaultPath)/github", "$(vaultBasePath)/$(vaultPipelineName)/github", "$(vaultBasePath)/GROUP-SECRETS/github"}, Type: "vaultSecret",
Type: "vaultSecret", Default: "github",
}, },
}, },
Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"},

View File

@@ -283,9 +283,9 @@ func githubPublishReleaseMetadata() config.StepData {
}, },
{ {
Name: "", Name: "githubVaultSecretName",
Paths: []string{"$(vaultPath)/github", "$(vaultBasePath)/$(vaultPipelineName)/github", "$(vaultBasePath)/GROUP-SECRETS/github"}, Type: "vaultSecret",
Type: "vaultSecret", Default: "github",
}, },
}, },
Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"},

View File

@@ -240,9 +240,9 @@ func githubSetCommitStatusMetadata() config.StepData {
}, },
{ {
Name: "", Name: "githubVaultSecretName",
Paths: []string{"$(vaultPath)/github", "$(vaultBasePath)/$(vaultPipelineName)/github", "$(vaultBasePath)/GROUP-SECRETS/github"}, Type: "vaultSecret",
Type: "vaultSecret", Default: "github",
}, },
}, },
Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"},

View File

@@ -143,9 +143,9 @@ func influxWriteDataMetadata() config.StepData {
}, },
{ {
Name: "", Name: "influxVaultSecretName",
Paths: []string{"$(vaultPath)/influxdb", "$(vaultBasePath)/$(vaultPipelineName)/influxdb", "$(vaultBasePath)/GROUP-SECRETS/influxdb"}, Type: "vaultSecret",
Type: "vaultSecret", Default: "influxdb",
}, },
}, },
Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"PARAMETERS", "STAGES", "STEPS"},

View File

@@ -260,9 +260,9 @@ func kanikoExecuteMetadata() config.StepData {
}, },
{ {
Name: "", Name: "dockerConfigFileVaultSecretName",
Paths: []string{"$(vaultPath)/docker-config", "$(vaultBasePath)/$(vaultPipelineName)/docker-config", "$(vaultBasePath)/GROUP-SECRETS/docker-config"}, Type: "vaultSecretFile",
Type: "vaultSecretFile", Default: "docker-config",
}, },
}, },
Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"PARAMETERS", "STAGES", "STEPS"},

View File

@@ -370,9 +370,9 @@ func kubernetesDeployMetadata() config.StepData {
}, },
{ {
Name: "", Name: "kubeConfigFileSecretName",
Paths: []string{"$(vaultPath)/kube-config", "$(vaultBasePath)/$(vaultPipelineName)/kube-config", "$(vaultBasePath)/GROUP-SECRETS/kube-config"}, Type: "vaultSecretFile",
Type: "vaultSecretFile", Default: "kube-config",
}, },
}, },
Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"},
@@ -436,9 +436,8 @@ func kubernetesDeployMetadata() config.StepData {
}, },
{ {
Name: "", Name: "dockerConfigFileVaultSecretName",
Paths: []string{"$(vaultPath)/docker-config", "$(vaultBasePath)/$(vaultPipelineName)/docker-config", "$(vaultBasePath)/GROUP-SECRETS/docker-config"}, Type: "vaultSecretFile",
Type: "vaultSecretFile",
}, },
}, },
Scope: []string{"PARAMETERS"}, Scope: []string{"PARAMETERS"},

View File

@@ -244,9 +244,9 @@ func mavenBuildMetadata() config.StepData {
}, },
{ {
Name: "", Name: "altDeploymentRepositoryPasswordFileVaultSecretName",
Paths: []string{"$(vaultPath)/alt-deployment-repository-passowrd", "$(vaultBasePath)/$(vaultPipelineName)/alt-deployment-repository-passowrd", "$(vaultBasePath)/GROUP-SECRETS/alt-deployment-repository-passowrd"}, Type: "vaultSecretFile",
Type: "vaultSecretFile", Default: "alt-deployment-repository-passowrd",
}, },
}, },
Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"},

View File

@@ -268,9 +268,9 @@ func protecodeExecuteScanMetadata() config.StepData {
}, },
{ {
Name: "", Name: "dockerConfigFileVaultSecretName",
Paths: []string{"$(vaultPath)/docker-config", "$(vaultBasePath)/$(vaultPipelineName)/docker-config", "$(vaultBasePath)/GROUP-SECRETS/docker-config"}, Type: "vaultSecretFile",
Type: "vaultSecretFile", Default: "docker-config",
}, },
}, },
Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"PARAMETERS", "STAGES", "STEPS"},
@@ -379,9 +379,9 @@ func protecodeExecuteScanMetadata() config.StepData {
}, },
{ {
Name: "", Name: "protecodeVaultSecretName",
Paths: []string{"$(vaultPath)/protecode", "$(vaultBasePath)/$(vaultPipelineName)/protecode", "$(vaultBasePath)/GROUP-SECRETS/protecode"}, Type: "vaultSecret",
Type: "vaultSecret", Default: "protecode",
}, },
}, },
Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"PARAMETERS", "STAGES", "STEPS"},
@@ -400,9 +400,9 @@ func protecodeExecuteScanMetadata() config.StepData {
}, },
{ {
Name: "", Name: "protecodeVaultSecretName",
Paths: []string{"$(vaultPath)/protecode", "$(vaultBasePath)/$(vaultPipelineName)/protecode", "$(vaultBasePath)/GROUP-SECRETS/protecode"}, Type: "vaultSecret",
Type: "vaultSecret", Default: "protecode",
}, },
}, },
Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"PARAMETERS", "STAGES", "STEPS"},

View File

@@ -241,9 +241,9 @@ func sonarExecuteScanMetadata() config.StepData {
Name: "token", Name: "token",
ResourceRef: []config.ResourceReference{ ResourceRef: []config.ResourceReference{
{ {
Name: "", Name: "sonarSecretName",
Paths: []string{"$(vaultPath)/sonar", "$(vaultBasePath)/$(vaultPipelineName)/sonar", "$(vaultBasePath)/GROUP-SECRETS/sonar"}, Type: "vaultSecret",
Type: "vaultSecret", Default: "sonar",
}, },
{ {
@@ -452,9 +452,9 @@ func sonarExecuteScanMetadata() config.StepData {
}, },
{ {
Name: "", Name: "githubVaultSecretName",
Paths: []string{"$(vaultPath)/github", "$(vaultBasePath)/$(vaultPipelineName)/github", "$(vaultBasePath)/GROUP-SECRETS/github"}, Type: "vaultSecret",
Type: "vaultSecret", Default: "github",
}, },
}, },
Scope: []string{"PARAMETERS"}, Scope: []string{"PARAMETERS"},

View File

@@ -125,9 +125,9 @@ func terraformExecuteMetadata() config.StepData {
Name: "terraformSecrets", Name: "terraformSecrets",
ResourceRef: []config.ResourceReference{ ResourceRef: []config.ResourceReference{
{ {
Name: "", Name: "terraformExecuteFileVaultSecret",
Paths: []string{"$(vaultPath)/terraformExecute", "$(vaultBasePath)/$(vaultPipelineName)/terraformExecute", "$(vaultBasePath)/GROUP-SECRETS/terraformExecute"}, Type: "vaultSecretFile",
Type: "vaultSecretFile", Default: "terraformExecute",
}, },
}, },
Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"PARAMETERS", "STAGES", "STEPS"},

View File

@@ -151,9 +151,9 @@ func vaultRotateSecretIdMetadata() config.StepData {
Name: "jenkinsUrl", Name: "jenkinsUrl",
ResourceRef: []config.ResourceReference{ ResourceRef: []config.ResourceReference{
{ {
Name: "", Name: "jenkinsVaultSecret",
Paths: []string{"$(vaultPath)/jenkins", "$(vaultBasePath)/$(vaultPipelineName)/jenkins", "$(vaultBasePath)/GROUP-SECRETS/jenkins"}, Type: "vaultSecret",
Type: "vaultSecret", Default: "jenkins",
}, },
}, },
Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"PARAMETERS", "STAGES", "STEPS"},
@@ -175,9 +175,9 @@ func vaultRotateSecretIdMetadata() config.StepData {
Name: "jenkinsUsername", Name: "jenkinsUsername",
ResourceRef: []config.ResourceReference{ ResourceRef: []config.ResourceReference{
{ {
Name: "", Name: "jenkinsVaultSecret",
Paths: []string{"$(vaultPath)/jenkins", "$(vaultBasePath)/$(vaultPipelineName)/jenkins", "$(vaultBasePath)/GROUP-SECRETS/jenkins"}, Type: "vaultSecret",
Type: "vaultSecret", Default: "jenkins",
}, },
}, },
Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"PARAMETERS", "STAGES", "STEPS"},
@@ -190,9 +190,9 @@ func vaultRotateSecretIdMetadata() config.StepData {
Name: "jenkinsToken", Name: "jenkinsToken",
ResourceRef: []config.ResourceReference{ ResourceRef: []config.ResourceReference{
{ {
Name: "", Name: "jenkinsVaultSecret",
Paths: []string{"$(vaultPath)/jenkins", "$(vaultBasePath)/$(vaultPipelineName)/jenkins", "$(vaultBasePath)/GROUP-SECRETS/jenkins"}, Type: "vaultSecret",
Type: "vaultSecret", Default: "jenkins",
}, },
}, },
Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"PARAMETERS", "STAGES", "STEPS"},
@@ -250,9 +250,8 @@ func vaultRotateSecretIdMetadata() config.StepData {
Name: "adoPersonalAccessToken", Name: "adoPersonalAccessToken",
ResourceRef: []config.ResourceReference{ ResourceRef: []config.ResourceReference{
{ {
Name: "", Name: "",
Paths: []string{"$(vaultPath)/jenkins", "$(vaultBasePath)/$(vaultPipelineName)/jenkins", "$(vaultBasePath)/GROUP-SECRETS/jenkins"}, Type: "vaultSecret",
Type: "vaultSecret",
}, },
}, },
Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"PARAMETERS", "STAGES", "STEPS"},

View File

@@ -614,9 +614,9 @@ func whitesourceExecuteScanMetadata() config.StepData {
}, },
{ {
Name: "", Name: "whitesourceVaultSecret",
Paths: []string{"$(vaultPath)/whitesource", "$(vaultBasePath)/$(vaultPipelineName)/whitesource", "$(vaultBasePath)/GROUP-SECRETS/whitesource"}, Type: "vaultSecret",
Type: "vaultSecret", Default: "whitesource",
}, },
}, },
Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"}, Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"},

View File

@@ -191,7 +191,7 @@ func (c *Config) GetStepConfig(flagValues map[string]interface{}, paramJSON stri
stepConfig.mixIn(def.General, filters.General) stepConfig.mixIn(def.General, filters.General)
stepConfig.mixIn(def.Steps[stepName], filters.Steps) stepConfig.mixIn(def.Steps[stepName], filters.Steps)
stepConfig.mixIn(def.Stages[stageName], filters.Steps) stepConfig.mixIn(def.Stages[stageName], filters.Steps)
stepConfig.mixinVaultConfig(def.General, def.Steps[stepName], def.Stages[stageName]) stepConfig.mixinVaultConfig(parameters, def.General, def.Steps[stepName], def.Stages[stageName])
stepConfig.mixInHookConfig(def.Hooks) stepConfig.mixInHookConfig(def.Hooks)
} }
@@ -233,7 +233,7 @@ func (c *Config) GetStepConfig(flagValues map[string]interface{}, paramJSON stri
log.Entry().Warnf("invalid value for parameter verbose: '%v'", stepConfig.Config["verbose"]) log.Entry().Warnf("invalid value for parameter verbose: '%v'", stepConfig.Config["verbose"])
} }
stepConfig.mixinVaultConfig(c.General, c.Steps[stepName], c.Stages[stageName]) stepConfig.mixinVaultConfig(parameters, c.General, c.Steps[stepName], c.Stages[stageName])
// check whether vault should be skipped // check whether vault should be skipped
if skip, ok := stepConfig.Config["skipVault"].(bool); !ok || !skip { if skip, ok := stepConfig.Config["skipVault"].(bool); !ok || !skip {
// fetch secrets from vault // fetch secrets from vault

View File

@@ -61,11 +61,11 @@ type StepParameters struct {
// ResourceReference defines the parameters of a resource reference // ResourceReference defines the parameters of a resource reference
type ResourceReference struct { type ResourceReference struct {
Name string `json:"name"` Name string `json:"name"`
Type string `json:"type,omitempty"` Type string `json:"type,omitempty"`
Param string `json:"param,omitempty"` Param string `json:"param,omitempty"`
Paths []string `json:"paths,omitempty"` Default string `json:"default,omitempty"`
Aliases []Alias `json:"aliases,omitempty"` Aliases []Alias `json:"aliases,omitempty"`
} }
// Alias defines a step input parameter alias // Alias defines a step input parameter alias
@@ -411,6 +411,23 @@ func (m *StepParameters) GetReference(refType string) *ResourceReference {
return nil return nil
} }
func getFilterForResourceReferences(params []StepParameters) []string {
var filter []string
for _, param := range params {
reference := param.GetReference("vaultSecret")
if reference == nil {
reference = param.GetReference("vaultSecretFile")
}
if reference == nil {
return filter
}
if reference.Name != "" {
filter = append(filter, reference.Name)
}
}
return filter
}
// HasReference checks whether StepData contains a parameter that has Reference with the given type // HasReference checks whether StepData contains a parameter that has Reference with the given type
func (m *StepData) HasReference(refType string) bool { func (m *StepData) HasReference(refType string) bool {
for _, param := range m.Spec.Inputs.Parameters { for _, param := range m.Spec.Inputs.Parameters {

View File

@@ -3,6 +3,7 @@ package config
import ( import (
"io/ioutil" "io/ioutil"
"os" "os"
"path"
"regexp" "regexp"
"strings" "strings"
@@ -13,27 +14,45 @@ import (
) )
const ( const (
vaultTestCredentialPath = "vaultTestCredentialPath" vaultRootPaths = "vaultRootPaths"
vaultTestCredentialKeys = "vaultTestCredentialKeys" vaultTestCredentialPath = "vaultTestCredentialPath"
vaultTestCredentialEnvPrefix_Default = "PIPER_TESTCREDENTIAL_" vaultTestCredentialKeys = "vaultTestCredentialKeys"
vaultAppRoleID = "vaultAppRoleID"
vaultAppRoleSecretID = "vaultAppRoleSecreId"
vaultServerUrl = "vaultServerUrl"
vaultNamespace = "vaultNamespace"
vaultBasePath = "vaultBasePath"
vaultPipelineName = "vaultPipelineName"
vaultPath = "vaultPath"
skipVault = "skipVault"
vaultDisableOverwrite = "vaultDisableOverwrite"
vaultTestCredentialEnvPrefixDefault = "PIPER_TESTCREDENTIAL_"
) )
var ( var (
vaultFilter = []string{ vaultFilter = []string{
"vaultAppRoleID", vaultRootPaths,
"vaultAppRoleSecreId", vaultAppRoleID,
"vaultServerUrl", vaultAppRoleSecretID,
"vaultNamespace", vaultServerUrl,
"vaultBasePath", vaultNamespace,
"vaultPipelineName", vaultBasePath,
"vaultPath", vaultPipelineName,
"vaultTestCredentialEnvPrefix", vaultPath,
"skipVault", skipVault,
"vaultDisableOverwrite", vaultDisableOverwrite,
vaultTestCredentialPath, vaultTestCredentialPath,
vaultTestCredentialKeys, vaultTestCredentialKeys,
} }
// VaultRootPaths are the lookup paths piper tries to use during the vault lookup.
// A path is only used if it's variables can be interpolated from the config
VaultRootPaths = []string{
"$(vaultPath)",
"$(vaultBasePath)/$(vaultPipelineName)",
"$(vaultBasePath)/GROUP-SECRETS",
}
// VaultSecretFileDirectory holds the directory for the current step run to temporarily store secret files fetched from vault // VaultSecretFileDirectory holds the directory for the current step run to temporarily store secret files fetched from vault
VaultSecretFileDirectory = "" VaultSecretFileDirectory = ""
) )
@@ -51,9 +70,13 @@ type vaultClient interface {
MustRevokeToken() MustRevokeToken()
} }
func (s *StepConfig) mixinVaultConfig(configs ...map[string]interface{}) { func (s *StepConfig) mixinVaultConfig(parameters []StepParameters, configs ...map[string]interface{}) {
for _, config := range configs { for _, config := range configs {
s.mixIn(config, vaultFilter) s.mixIn(config, vaultFilter)
// when an empty filter is returned we skip the mixin call since an empty filter will allow everything
if referencesFilter := getFilterForResourceReferences(parameters); len(referencesFilter) > 0 {
s.mixIn(config, referencesFilter)
}
} }
} }
@@ -109,7 +132,7 @@ func resolveVaultReference(ref *ResourceReference, config *StepConfig, client va
} }
var secretValue *string var secretValue *string
for _, vaultPath := range ref.Paths { for _, vaultPath := range getSecretReferencePaths(ref, config.Config) {
// it should be possible to configure the root path were the secret is stored // it should be possible to configure the root path were the secret is stored
vaultPath, ok := interpolation.ResolveString(vaultPath, config.Config) vaultPath, ok := interpolation.ResolveString(vaultPath, config.Config)
if !ok { if !ok {
@@ -179,7 +202,7 @@ func populateTestCredentialsAsEnvs(config *StepConfig, secret map[string]string,
vaultTestCredentialEnvPrefix, ok := config.Config["vaultTestCredentialEnvPrefix"].(string) vaultTestCredentialEnvPrefix, ok := config.Config["vaultTestCredentialEnvPrefix"].(string)
if !ok || len(vaultTestCredentialEnvPrefix) == 0 { if !ok || len(vaultTestCredentialEnvPrefix) == 0 {
vaultTestCredentialEnvPrefix = vaultTestCredentialEnvPrefix_Default vaultTestCredentialEnvPrefix = vaultTestCredentialEnvPrefixDefault
} }
for secretKey, secretValue := range secret { for secretKey, secretValue := range secret {
for _, key := range keys { for _, key := range keys {
@@ -284,3 +307,28 @@ func lookupPath(client vaultClient, path string, param *StepParameters) *string
} }
return nil return nil
} }
func getSecretReferencePaths(reference *ResourceReference, config map[string]interface{}) []string {
retPaths := make([]string, 0, len(VaultRootPaths))
secretName := reference.Default
if providedName, ok := config[reference.Name].(string); ok && providedName != "" {
secretName = providedName
}
for _, rootPath := range VaultRootPaths {
fullPath := path.Join(rootPath, secretName)
retPaths = append(retPaths, fullPath)
}
return retPaths
}
func toStringSlice(interfaceSlice []interface{}) []string {
retSlice := make([]string, 0, len(interfaceSlice))
for _, vRaw := range interfaceSlice {
if v, ok := vRaw.(string); ok {
retSlice = append(retSlice, v)
continue
}
log.Entry().Warnf("'%s' needs to be of type string or an array of strings but got %T (%[2]v)", vaultPath, vRaw)
}
return retSlice
}

View File

@@ -2,28 +2,44 @@ package config
import ( import (
"fmt" "fmt"
"github.com/stretchr/testify/mock"
"io/ioutil" "io/ioutil"
"os" "os"
"path"
"strings" "strings"
"testing" "testing"
"github.com/SAP/jenkins-library/pkg/config/mocks" "github.com/SAP/jenkins-library/pkg/config/mocks"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
) )
func TestVaultConfigLoad(t *testing.T) { func TestVaultConfigLoad(t *testing.T) {
const secretName = "testSecret" const secretName = "testSecret"
const secretNameOverrideKey = "mySecretVaultSecretName"
t.Parallel() t.Parallel()
t.Run("Load secret from vault", func(t *testing.T) { t.Run("Load secret from vault", func(t *testing.T) {
vaultMock := &mocks.VaultMock{} vaultMock := &mocks.VaultMock{}
stepConfig := StepConfig{Config: map[string]interface{}{ stepConfig := StepConfig{Config: map[string]interface{}{
"vaultBasePath": "team1", "vaultPath": "team1",
}} }}
stepParams := []StepParameters{stepParam(secretName, "vaultSecret", "$(vaultBasePath)/pipelineA")} stepParams := []StepParameters{stepParam(secretName, "vaultSecret", secretNameOverrideKey, secretName)}
vaultData := map[string]string{secretName: "value1"} vaultData := map[string]string{secretName: "value1"}
vaultMock.On("GetKvSecret", "team1/pipelineA").Return(vaultData, nil) vaultMock.On("GetKvSecret", path.Join("team1", secretName)).Return(vaultData, nil)
resolveAllVaultReferences(&stepConfig, vaultMock, stepParams)
assert.Equal(t, "value1", stepConfig.Config[secretName])
})
t.Run("Load secret from vault with path override", func(t *testing.T) {
vaultMock := &mocks.VaultMock{}
stepConfig := StepConfig{Config: map[string]interface{}{
"vaultPath": "team1",
secretNameOverrideKey: "overrideSecretName",
}}
stepParams := []StepParameters{stepParam(secretName, "vaultSecret", secretNameOverrideKey, secretName)}
vaultData := map[string]string{secretName: "value1"}
vaultMock.On("GetKvSecret", path.Join("team1", "overrideSecretName")).Return(vaultData, nil)
resolveAllVaultReferences(&stepConfig, vaultMock, stepParams) resolveAllVaultReferences(&stepConfig, vaultMock, stepParams)
assert.Equal(t, "value1", stepConfig.Config[secretName]) assert.Equal(t, "value1", stepConfig.Config[secretName])
}) })
@@ -31,13 +47,13 @@ func TestVaultConfigLoad(t *testing.T) {
t.Run("Secrets are not overwritten", func(t *testing.T) { t.Run("Secrets are not overwritten", func(t *testing.T) {
vaultMock := &mocks.VaultMock{} vaultMock := &mocks.VaultMock{}
stepConfig := StepConfig{Config: map[string]interface{}{ stepConfig := StepConfig{Config: map[string]interface{}{
"vaultBasePath": "team1", "vaultPath": "team1",
secretName: "preset value", secretName: "preset value",
"vaultDisableOverwrite": true, "vaultDisableOverwrite": true,
}} }}
stepParams := []StepParameters{stepParam(secretName, "vaultSecret", "$(vaultBasePath)/pipelineA")} stepParams := []StepParameters{stepParam(secretName, "vaultSecret", secretNameOverrideKey, secretName)}
vaultData := map[string]string{secretName: "value1"} vaultData := map[string]string{secretName: "value1"}
vaultMock.On("GetKvSecret", "team1/pipelineA").Return(vaultData, nil) vaultMock.On("GetKvSecret", path.Join("team1", secretName)).Return(vaultData, nil)
resolveAllVaultReferences(&stepConfig, vaultMock, stepParams) resolveAllVaultReferences(&stepConfig, vaultMock, stepParams)
assert.Equal(t, "preset value", stepConfig.Config[secretName]) assert.Equal(t, "preset value", stepConfig.Config[secretName])
@@ -46,12 +62,12 @@ func TestVaultConfigLoad(t *testing.T) {
t.Run("Secrets can be overwritten", func(t *testing.T) { t.Run("Secrets can be overwritten", func(t *testing.T) {
vaultMock := &mocks.VaultMock{} vaultMock := &mocks.VaultMock{}
stepConfig := StepConfig{Config: map[string]interface{}{ stepConfig := StepConfig{Config: map[string]interface{}{
"vaultBasePath": "team1", "vaultPath": "team1",
secretName: "preset value", secretName: "preset value",
}} }}
stepParams := []StepParameters{stepParam(secretName, "vaultSecret", "$(vaultBasePath)/pipelineA")} stepParams := []StepParameters{stepParam(secretName, "vaultSecret", secretNameOverrideKey, secretName)}
vaultData := map[string]string{secretName: "value1"} vaultData := map[string]string{secretName: "value1"}
vaultMock.On("GetKvSecret", "team1/pipelineA").Return(vaultData, nil) vaultMock.On("GetKvSecret", path.Join("team1", secretName)).Return(vaultData, nil)
resolveAllVaultReferences(&stepConfig, vaultMock, stepParams) resolveAllVaultReferences(&stepConfig, vaultMock, stepParams)
assert.Equal(t, "value1", stepConfig.Config[secretName]) assert.Equal(t, "value1", stepConfig.Config[secretName])
@@ -60,10 +76,10 @@ func TestVaultConfigLoad(t *testing.T) {
t.Run("Error is passed through", func(t *testing.T) { t.Run("Error is passed through", func(t *testing.T) {
vaultMock := &mocks.VaultMock{} vaultMock := &mocks.VaultMock{}
stepConfig := StepConfig{Config: map[string]interface{}{ stepConfig := StepConfig{Config: map[string]interface{}{
"vaultBasePath": "team1", "vaultPath": "team1",
}} }}
stepParams := []StepParameters{stepParam(secretName, "vaultSecret", "$(vaultBasePath)/pipelineA")} stepParams := []StepParameters{stepParam(secretName, "vaultSecret", secretNameOverrideKey, secretName)}
vaultMock.On("GetKvSecret", "team1/pipelineA").Return(nil, fmt.Errorf("test")) vaultMock.On("GetKvSecret", path.Join("team1", secretName)).Return(nil, fmt.Errorf("test"))
resolveAllVaultReferences(&stepConfig, vaultMock, stepParams) resolveAllVaultReferences(&stepConfig, vaultMock, stepParams)
assert.Len(t, stepConfig.Config, 1) assert.Len(t, stepConfig.Config, 1)
}) })
@@ -71,10 +87,10 @@ func TestVaultConfigLoad(t *testing.T) {
t.Run("Secret doesn't exist", func(t *testing.T) { t.Run("Secret doesn't exist", func(t *testing.T) {
vaultMock := &mocks.VaultMock{} vaultMock := &mocks.VaultMock{}
stepConfig := StepConfig{Config: map[string]interface{}{ stepConfig := StepConfig{Config: map[string]interface{}{
"vaultBasePath": "team1", "vaultPath": "team1",
}} }}
stepParams := []StepParameters{stepParam(secretName, "vaultSecret", "$(vaultBasePath)/pipelineA")} stepParams := []StepParameters{stepParam(secretName, "vaultSecret", secretNameOverrideKey, secretName)}
vaultMock.On("GetKvSecret", "team1/pipelineA").Return(nil, nil) vaultMock.On("GetKvSecret", path.Join("team1", secretName)).Return(nil, nil)
resolveAllVaultReferences(&stepConfig, vaultMock, stepParams) resolveAllVaultReferences(&stepConfig, vaultMock, stepParams)
assert.Len(t, stepConfig.Config, 1) assert.Len(t, stepConfig.Config, 1)
}) })
@@ -83,13 +99,13 @@ func TestVaultConfigLoad(t *testing.T) {
aliasName := "alias" aliasName := "alias"
vaultMock := &mocks.VaultMock{} vaultMock := &mocks.VaultMock{}
stepConfig := StepConfig{Config: map[string]interface{}{ stepConfig := StepConfig{Config: map[string]interface{}{
"vaultBasePath": "team1", "vaultPath": "team1",
}} }}
param := stepParam(secretName, "vaultSecret", "$(vaultBasePath)/pipelineA") param := stepParam(secretName, "vaultSecret", secretNameOverrideKey, secretName)
addAlias(&param, aliasName) addAlias(&param, aliasName)
stepParams := []StepParameters{param} stepParams := []StepParameters{param}
vaultData := map[string]string{aliasName: "value1"} vaultData := map[string]string{aliasName: "value1"}
vaultMock.On("GetKvSecret", "team1/pipelineA").Return(vaultData, nil) vaultMock.On("GetKvSecret", path.Join("team1", secretName)).Return(vaultData, nil)
resolveAllVaultReferences(&stepConfig, vaultMock, stepParams) resolveAllVaultReferences(&stepConfig, vaultMock, stepParams)
assert.Equal(t, "value1", stepConfig.Config[secretName]) assert.Equal(t, "value1", stepConfig.Config[secretName])
}) })
@@ -97,37 +113,23 @@ func TestVaultConfigLoad(t *testing.T) {
t.Run("Search over multiple paths", func(t *testing.T) { t.Run("Search over multiple paths", func(t *testing.T) {
vaultMock := &mocks.VaultMock{} vaultMock := &mocks.VaultMock{}
stepConfig := StepConfig{Config: map[string]interface{}{ stepConfig := StepConfig{Config: map[string]interface{}{
"vaultBasePath": "team1", "vaultBasePath": "team2",
"vaultPath": "team1",
}} }}
stepParams := []StepParameters{ stepParams := []StepParameters{
stepParam(secretName, "vaultSecret", "$(vaultBasePath)/pipelineA", "$(vaultBasePath)/pipelineB"), stepParam(secretName, "vaultSecret", secretNameOverrideKey, secretName),
} }
vaultData := map[string]string{secretName: "value1"} vaultData := map[string]string{secretName: "value1"}
vaultMock.On("GetKvSecret", "team1/pipelineA").Return(nil, nil) vaultMock.On("GetKvSecret", path.Join("team1", secretName)).Return(nil, nil)
vaultMock.On("GetKvSecret", "team1/pipelineB").Return(vaultData, nil) vaultMock.On("GetKvSecret", path.Join("team2/GROUP-SECRETS", secretName)).Return(vaultData, nil)
resolveAllVaultReferences(&stepConfig, vaultMock, stepParams) resolveAllVaultReferences(&stepConfig, vaultMock, stepParams)
assert.Equal(t, "value1", stepConfig.Config[secretName]) assert.Equal(t, "value1", stepConfig.Config[secretName])
}) })
t.Run("Stop lookup when secret was found", func(t *testing.T) {
vaultMock := &mocks.VaultMock{}
stepConfig := StepConfig{Config: map[string]interface{}{
"vaultBasePath": "team1",
}}
stepParams := []StepParameters{
stepParam(secretName, "vaultSecret", "$(vaultBasePath)/pipelineA", "$(vaultBasePath)/pipelineB"),
}
vaultData := map[string]string{secretName: "value1"}
vaultMock.On("GetKvSecret", "team1/pipelineA").Return(vaultData, nil)
resolveAllVaultReferences(&stepConfig, vaultMock, stepParams)
assert.Equal(t, "value1", stepConfig.Config[secretName])
vaultMock.AssertNotCalled(t, "GetKvSecret", "team1/pipelineB")
})
t.Run("No BasePath is stepConfig.Configured", func(t *testing.T) { t.Run("No BasePath is stepConfig.Configured", func(t *testing.T) {
vaultMock := &mocks.VaultMock{} vaultMock := &mocks.VaultMock{}
stepConfig := StepConfig{Config: map[string]interface{}{}} stepConfig := StepConfig{Config: map[string]interface{}{}}
stepParams := []StepParameters{stepParam(secretName, "vaultSecret", "$(vaultBasePath)/pipelineA")} stepParams := []StepParameters{stepParam(secretName, "vaultSecret", secretNameOverrideKey, secretName)}
resolveAllVaultReferences(&stepConfig, vaultMock, stepParams) resolveAllVaultReferences(&stepConfig, vaultMock, stepParams)
assert.Equal(t, nil, stepConfig.Config[secretName]) assert.Equal(t, nil, stepConfig.Config[secretName])
vaultMock.AssertNotCalled(t, "GetKvSecret", mock.AnythingOfType("string")) vaultMock.AssertNotCalled(t, "GetKvSecret", mock.AnythingOfType("string"))
@@ -136,14 +138,15 @@ func TestVaultConfigLoad(t *testing.T) {
func TestVaultSecretFiles(t *testing.T) { func TestVaultSecretFiles(t *testing.T) {
const secretName = "testSecret" const secretName = "testSecret"
const secretNameOverrideKey = "mySecretVaultSecretName"
t.Run("Test Vault Secret File Reference", func(t *testing.T) { t.Run("Test Vault Secret File Reference", func(t *testing.T) {
vaultMock := &mocks.VaultMock{} vaultMock := &mocks.VaultMock{}
stepConfig := StepConfig{Config: map[string]interface{}{ stepConfig := StepConfig{Config: map[string]interface{}{
"vaultPath": "team1", "vaultPath": "team1",
}} }}
stepParams := []StepParameters{stepParam(secretName, "vaultSecretFile", "$(vaultPath)/pipelineA")} stepParams := []StepParameters{stepParam(secretName, "vaultSecretFile", secretNameOverrideKey, secretName)}
vaultData := map[string]string{secretName: "value1"} vaultData := map[string]string{secretName: "value1"}
vaultMock.On("GetKvSecret", "team1/pipelineA").Return(vaultData, nil) vaultMock.On("GetKvSecret", path.Join("team1", secretName)).Return(vaultData, nil)
resolveAllVaultReferences(&stepConfig, vaultMock, stepParams) resolveAllVaultReferences(&stepConfig, vaultMock, stepParams)
assert.NotNil(t, stepConfig.Config[secretName]) assert.NotNil(t, stepConfig.Config[secretName])
path := stepConfig.Config[secretName].(string) path := stepConfig.Config[secretName].(string)
@@ -161,10 +164,10 @@ func TestVaultSecretFiles(t *testing.T) {
stepConfig := StepConfig{Config: map[string]interface{}{ stepConfig := StepConfig{Config: map[string]interface{}{
"vaultPath": "team1", "vaultPath": "team1",
}} }}
stepParams := []StepParameters{stepParam(secretName, "vaultSecretFile", "$(vaultPath)/pipelineA")} stepParams := []StepParameters{stepParam(secretName, "vaultSecretFile", secretNameOverrideKey, secretName)}
vaultData := map[string]string{secretName: "value1"} vaultData := map[string]string{secretName: "value1"}
assert.NoDirExists(t, VaultSecretFileDirectory) assert.NoDirExists(t, VaultSecretFileDirectory)
vaultMock.On("GetKvSecret", "team1/pipelineA").Return(vaultData, nil) vaultMock.On("GetKvSecret", path.Join("team1", secretName)).Return(vaultData, nil)
resolveAllVaultReferences(&stepConfig, vaultMock, stepParams) resolveAllVaultReferences(&stepConfig, vaultMock, stepParams)
assert.NotNil(t, stepConfig.Config[secretName]) assert.NotNil(t, stepConfig.Config[secretName])
path := stepConfig.Config[secretName].(string) path := stepConfig.Config[secretName].(string)
@@ -191,7 +194,7 @@ func TestMixinVault(t *testing.T) {
"unknownConfig": "test", "unknownConfig": "test",
} }
config.mixinVaultConfig(general, steps) config.mixinVaultConfig(nil, general, steps)
assert.Contains(t, config.Config, "vaultServerUrl") assert.Contains(t, config.Config, "vaultServerUrl")
assert.Equal(t, vaultServerUrl, config.Config["vaultServerUrl"]) assert.Equal(t, vaultServerUrl, config.Config["vaultServerUrl"])
@@ -201,14 +204,15 @@ func TestMixinVault(t *testing.T) {
} }
func stepParam(name string, refType string, refPaths ...string) StepParameters { func stepParam(name, refType, vaultSecretNameProperty, defaultSecretNameName string) StepParameters {
return StepParameters{ return StepParameters{
Name: name, Name: name,
Aliases: []Alias{}, Aliases: []Alias{},
ResourceRef: []ResourceReference{ ResourceRef: []ResourceReference{
{ {
Type: refType, Type: refType,
Paths: refPaths, Name: vaultSecretNameProperty,
Default: defaultSecretNameName,
}, },
}, },
} }

View File

@@ -2,6 +2,7 @@ package generator
import ( import (
"fmt" "fmt"
"path"
"sort" "sort"
"strings" "strings"
@@ -271,8 +272,8 @@ func addVaultResourceDetails(resource config.ResourceReference, resourceDetails
if resource.Type == "vaultSecret" { if resource.Type == "vaultSecret" {
resourceDetails += "<br/>Vault paths: <br />" resourceDetails += "<br/>Vault paths: <br />"
resourceDetails += "<ul>" resourceDetails += "<ul>"
for _, path := range resource.Paths[0:1] { for _, rootPath := range config.VaultRootPaths {
resourceDetails += fmt.Sprintf("<li>`%s`</li>", path) resourceDetails += fmt.Sprintf("<li>`%s`</li>", path.Join(rootPath, resource.Default))
} }
resourceDetails += "</ul>" resourceDetails += "</ul>"
} }

View File

@@ -172,11 +172,11 @@ func {{.FlagsFunc}}(cmd *cobra.Command, stepConfig *{{.StepName}}Options) {
{{- if .Param }} {{- if .Param }}
Param: "{{ .Param }}", Param: "{{ .Param }}",
{{- end }} {{- end }}
{{- if gt (len .Paths) 0 }}
Paths: []string{{ "{" }}{{ range $_, $path := .Paths }}"{{$path}}",{{ end }}{{"}"}},
{{- end }}
{{- if .Type }} {{- if .Type }}
Type: "{{ .Type }}", Type: "{{ .Type }}",
{{- if .Default }}
Default: "{{ .Default }}",
{{- end}}
{{- end }} {{- end }}
{{ "}" }}, {{ "}" }},
{{- nindent 24 ""}} {{- nindent 24 ""}}

View File

@@ -39,10 +39,8 @@ spec:
type: secret type: secret
param: username param: username
- type: vaultSecret - type: vaultSecret
paths: name: cloudfoundryVaultSecretName
- $(vaultPath)/cloudfoundry-$(org)-$(space) default: cloudfoundry-$(org)-$(space)
- $(vaultBasePath)/$(vaultPipelineName)/cloudfoundry-$(org)-$(space)
- $(vaultBasePath)/GROUP-SECRETS/cloudfoundry-$(org)-$(space)
- name: password - name: password
type: string type: string
description: Password for Cloud Foundry User description: Password for Cloud Foundry User
@@ -57,10 +55,8 @@ spec:
type: secret type: secret
param: password param: password
- type: vaultSecret - type: vaultSecret
paths: name: cloudfoundryVaultSecretName
- $(vaultPath)/cloudfoundry-$(org)-$(space) default: cloudfoundry-$(org)-$(space)
- $(vaultBasePath)/$(vaultPipelineName)/cloudfoundry-$(org)-$(space)
- $(vaultBasePath)/GROUP-SECRETS/cloudfoundry-$(org)-$(space)
- name: cfOrg - name: cfOrg
type: string type: string
description: Cloud Foundry org description: Cloud Foundry org

View File

@@ -95,10 +95,8 @@ spec:
type: secret type: secret
param: password param: password
- type: vaultSecret - type: vaultSecret
paths: name: checkmarxVaultSecretName
- $(vaultPath)/checkmarx default: checkmarx
- $(vaultBasePath)/$(vaultPipelineName)/checkmarx
- $(vaultBasePath)/GROUP-SECRETS/checkmarx
- name: preset - name: preset
type: string type: string
description: The preset to use for scanning, if not set explicitly the step will attempt to look up the project's setting based on the availability of `checkmarxCredentialsId` description: The preset to use for scanning, if not set explicitly the step will attempt to look up the project's setting based on the availability of `checkmarxCredentialsId`
@@ -177,10 +175,8 @@ spec:
type: secret type: secret
param: username param: username
- type: vaultSecret - type: vaultSecret
paths: name: checkmarxVaultSecretName
- $(vaultPath)/checkmarx default: checkmarx
- $(vaultBasePath)/$(vaultPipelineName)/checkmarx
- $(vaultBasePath)/GROUP-SECRETS/checkmarx
- name: verifyOnly - name: verifyOnly
type: bool type: bool
description: Whether the step shall only apply verification checks or whether it does a full scan and check cycle description: Whether the step shall only apply verification checks or whether it does a full scan and check cycle

View File

@@ -47,10 +47,8 @@ spec:
type: secret type: secret
param: username param: username
- type: vaultSecret - type: vaultSecret
paths: name: cloudfoundryVaultSecretName
- $(vaultPath)/cloudfoundry-$(org)-$(space) default: cloudfoundry-$(org)-$(space)
- $(vaultBasePath)/$(vaultPipelineName)/cloudfoundry-$(org)-$(space)
- $(vaultBasePath)/GROUP-SECRETS/cloudfoundry-$(org)-$(space)
- name: password - name: password
type: string type: string
description: Password for Cloud Foundry User description: Password for Cloud Foundry User
@@ -65,10 +63,8 @@ spec:
type: secret type: secret
param: password param: password
- type: vaultSecret - type: vaultSecret
paths: default: cloudfoundry-$(org)-$(space)
- $(vaultPath)/cloudfoundry-$(org)-$(space) name: cloudfoundryVaultSecretName
- $(vaultBasePath)/$(vaultPipelineName)/cloudfoundry-$(org)-$(space)
- $(vaultBasePath)/GROUP-SECRETS/cloudfoundry-$(org)-$(space)
- name: cfOrg - name: cfOrg
type: string type: string
description: Cloud Foundry org description: Cloud Foundry org

View File

@@ -35,10 +35,8 @@ spec:
type: secret type: secret
param: username param: username
- type: vaultSecret - type: vaultSecret
paths: default: cloudfoundry-$(org)-$(space)
- $(vaultPath)/cloudfoundry-$(org)-$(space) name: cloudfoundryVaultSecretName
- $(vaultBasePath)/$(vaultPipelineName)/cloudfoundry-$(org)-$(space)
- $(vaultBasePath)/GROUP-SECRETS/cloudfoundry-$(org)-$(space)
- name: password - name: password
type: string type: string
description: User Password for CF User description: User Password for CF User
@@ -53,10 +51,8 @@ spec:
type: secret type: secret
param: password param: password
- type: vaultSecret - type: vaultSecret
paths: default: cloudfoundry-$(org)-$(space)
- $(vaultPath)/cloudfoundry-$(org)-$(space) name: cloudfoundryVaultSecretName
- $(vaultBasePath)/$(vaultPipelineName)/cloudfoundry-$(org)-$(space)
- $(vaultBasePath)/GROUP-SECRETS/cloudfoundry-$(org)-$(space)
- name: cfOrg - name: cfOrg
type: string type: string
description: CF org description: CF org

View File

@@ -35,10 +35,8 @@ spec:
type: secret type: secret
param: username param: username
- type: vaultSecret - type: vaultSecret
paths: default: cloudfoundry-$(org)-$(space)
- $(vaultPath)/cloudfoundry-$(org)-$(space) name: cloudfoundryVaultSecretName
- $(vaultBasePath)/$(vaultPipelineName)/cloudfoundry-$(org)-$(space)
- $(vaultBasePath)/GROUP-SECRETS/cloudfoundry-$(org)-$(space)
- name: password - name: password
type: string type: string
description: User Password for CF User description: User Password for CF User
@@ -53,10 +51,8 @@ spec:
type: secret type: secret
param: password param: password
- type: vaultSecret - type: vaultSecret
paths: default: cloudfoundry-$(org)-$(space)
- $(vaultPath)/cloudfoundry-$(org)-$(space) name: cloudfoundryVaultSecretName
- $(vaultBasePath)/$(vaultPipelineName)/cloudfoundry-$(org)-$(space)
- $(vaultBasePath)/GROUP-SECRETS/cloudfoundry-$(org)-$(space)
- name: cfOrg - name: cfOrg
type: string type: string
description: CF org description: CF org

View File

@@ -321,10 +321,8 @@ spec:
type: secret type: secret
param: password param: password
- type: vaultSecret - type: vaultSecret
paths: default: cloudfoundry-$(org)-$(space)
- $(vaultPath)/cloudfoundry-$(org)-$(space) name: cloudfoundryVaultSecretName
- $(vaultBasePath)/$(vaultPipelineName)/cloudfoundry-$(org)-$(space)
- $(vaultBasePath)/GROUP-SECRETS/cloudfoundry-$(org)-$(space)
- name: smokeTestScript - name: smokeTestScript
type: string type: string
description: description:
@@ -376,10 +374,8 @@ spec:
type: secret type: secret
param: username param: username
- type: vaultSecret - type: vaultSecret
paths: default: cloudfoundry-$(org)-$(space)
- $(vaultPath)/cloudfoundry-$(org)-$(space) name: cloudfoundryVaultSecretName
- $(vaultBasePath)/$(vaultPipelineName)/cloudfoundry-$(org)-$(space)
- $(vaultBasePath)/GROUP-SECRETS/cloudfoundry-$(org)-$(space)
containers: containers:
- name: cfDeploy - name: cfDeploy
image: ppiper/cf-cli:6 image: ppiper/cf-cli:6

View File

@@ -35,10 +35,8 @@ spec:
- name: detectTokenCredentialsId - name: detectTokenCredentialsId
type: secret type: secret
- type: vaultSecret - type: vaultSecret
paths: name: detectVaultSecretName
- $(vaultPath)/detect default: detect
- $(vaultBasePath)/$(vaultPipelineName)/detect
- $(vaultBasePath)/GROUP-SECRETS/detect
scope: scope:
- PARAMETERS - PARAMETERS
- STAGES - STAGES

View File

@@ -57,10 +57,8 @@ spec:
- name: fortifyCredentialsId - name: fortifyCredentialsId
type: secret type: secret
- type: vaultSecret - type: vaultSecret
paths: name: fortifyVaultSecretName
- $(vaultPath)/fortify default: fortify
- $(vaultBasePath)/$(vaultPipelineName)/fortify
- $(vaultBasePath)/GROUP-SECRETS/fortify
- name: buildDescriptorExcludeList - name: buildDescriptorExcludeList
type: "[]string" type: "[]string"
description: "List of build descriptors and therefore modules to exclude from the scan and assessment activities." description: "List of build descriptors and therefore modules to exclude from the scan and assessment activities."
@@ -97,10 +95,8 @@ spec:
- name: githubTokenCredentialsId - name: githubTokenCredentialsId
type: secret type: secret
- type: vaultSecret - type: vaultSecret
paths: default: github
- $(vaultPath)/github name: githubVaultSecretName
- $(vaultBasePath)/$(vaultPipelineName)/github
- $(vaultBasePath)/GROUP-SECRETS/github
- name: autoCreate - name: autoCreate
type: bool type: bool
description: description:

View File

@@ -97,7 +97,5 @@ spec:
- name: githubTokenCredentialsId - name: githubTokenCredentialsId
type: secret type: secret
- type: vaultSecret - type: vaultSecret
paths: default: github
- $(vaultPath)/github name: githubVaultSecretName
- $(vaultBasePath)/$(vaultPipelineName)/github
- $(vaultBasePath)/GROUP-SECRETS/github

View File

@@ -84,7 +84,5 @@ spec:
- name: githubTokenCredentialsId - name: githubTokenCredentialsId
type: secret type: secret
- type: vaultSecret - type: vaultSecret
paths: default: github
- $(vaultPath)/github name: githubVaultSecretName
- $(vaultBasePath)/$(vaultPipelineName)/github
- $(vaultBasePath)/GROUP-SECRETS/github

View File

@@ -89,7 +89,5 @@ spec:
- name: githubTokenCredentialsId - name: githubTokenCredentialsId
type: secret type: secret
- type: vaultSecret - type: vaultSecret
paths: default: github
- $(vaultPath)/github name: githubVaultSecretName
- $(vaultBasePath)/$(vaultPipelineName)/github
- $(vaultBasePath)/GROUP-SECRETS/github

View File

@@ -118,10 +118,8 @@ spec:
- name: githubTokenCredentialsId - name: githubTokenCredentialsId
type: secret type: secret
- type: vaultSecret - type: vaultSecret
paths: default: github
- $(vaultPath)/github name: githubVaultSecretName
- $(vaultBasePath)/$(vaultPipelineName)/github
- $(vaultBasePath)/GROUP-SECRETS/github
- name: labels - name: labels
description: Labels to be added to the pull request. description: Labels to be added to the pull request.
scope: scope:

View File

@@ -146,10 +146,8 @@ spec:
- name: githubTokenCredentialsId - name: githubTokenCredentialsId
type: secret type: secret
- type: vaultSecret - type: vaultSecret
paths: default: github
- $(vaultPath)/github name: githubVaultSecretName
- $(vaultBasePath)/$(vaultPipelineName)/github
- $(vaultBasePath)/GROUP-SECRETS/github
- name: uploadUrl - name: uploadUrl
aliases: aliases:
- name: githubUploadUrl - name: githubUploadUrl

View File

@@ -119,7 +119,5 @@ spec:
- name: githubTokenCredentialsId - name: githubTokenCredentialsId
type: secret type: secret
- type: vaultSecret - type: vaultSecret
paths: default: github
- $(vaultPath)/github name: githubVaultSecretName
- $(vaultBasePath)/$(vaultPipelineName)/github
- $(vaultBasePath)/GROUP-SECRETS/github

View File

@@ -32,10 +32,8 @@ spec:
- name: influxAuthTokenId - name: influxAuthTokenId
type: secret type: secret
- type: vaultSecret - type: vaultSecret
paths: name: influxVaultSecretName
- $(vaultPath)/influxdb default: influxdb
- $(vaultBasePath)/$(vaultPipelineName)/influxdb
- $(vaultBasePath)/GROUP-SECRETS/influxdb
- name: bucket - name: bucket
type: string type: string
description: Name of database (1.8) or bucket (2.0) description: Name of database (1.8) or bucket (2.0)

View File

@@ -100,10 +100,8 @@ spec:
- name: dockerConfigJsonCredentialsId - name: dockerConfigJsonCredentialsId
type: secret type: secret
- type: vaultSecretFile - type: vaultSecretFile
paths: name: dockerConfigFileVaultSecretName
- $(vaultPath)/docker-config default: docker-config
- $(vaultBasePath)/$(vaultPipelineName)/docker-config
- $(vaultBasePath)/GROUP-SECRETS/docker-config
- name: dockerfilePath - name: dockerfilePath
aliases: aliases:
- name: dockerfile - name: dockerfile

View File

@@ -245,10 +245,8 @@ spec:
- name: kubeConfigFileCredentialsId - name: kubeConfigFileCredentialsId
type: secret type: secret
- type: vaultSecretFile - type: vaultSecretFile
paths: name: kubeConfigFileSecretName
- $(vaultPath)/kube-config default: kube-config
- $(vaultBasePath)/$(vaultPipelineName)/kube-config
- $(vaultBasePath)/GROUP-SECRETS/kube-config
- name: kubeContext - name: kubeContext
type: string type: string
description: Defines the context to use from the \"kubeconfig\" file. description: Defines the context to use from the \"kubeconfig\" file.
@@ -300,10 +298,7 @@ spec:
- name: dockerConfigJsonCredentialsId - name: dockerConfigJsonCredentialsId
type: secret type: secret
- type: vaultSecretFile - type: vaultSecretFile
paths: name: dockerConfigFileVaultSecretName
- $(vaultPath)/docker-config
- $(vaultBasePath)/$(vaultPipelineName)/docker-config
- $(vaultBasePath)/GROUP-SECRETS/docker-config
containers: containers:
- image: dtzar/helm-kubectl:3.4.1 - image: dtzar/helm-kubectl:3.4.1
workingDir: /config workingDir: /config

View File

@@ -115,10 +115,8 @@ spec:
- name: altDeploymentRepositoryPasswordId - name: altDeploymentRepositoryPasswordId
type: secret type: secret
- type: vaultSecretFile - type: vaultSecretFile
paths: name: altDeploymentRepositoryPasswordFileVaultSecretName
- $(vaultPath)/alt-deployment-repository-passowrd default: alt-deployment-repository-passowrd
- $(vaultBasePath)/$(vaultPipelineName)/alt-deployment-repository-passowrd
- $(vaultBasePath)/GROUP-SECRETS/alt-deployment-repository-passowrd
- name: altDeploymentRepositoryUser - name: altDeploymentRepositoryUser
type: string type: string
description: User for the alternative deployment repository to which the project artifacts should be deployed ( other than those specified in <distributionManagement> ). This user will be updated in settings.xml . When no settings.xml is provided a new one is created corresponding with <servers> tag description: User for the alternative deployment repository to which the project artifacts should be deployed ( other than those specified in <distributionManagement> ). This user will be updated in settings.xml . When no settings.xml is provided a new one is created corresponding with <servers> tag

View File

@@ -75,10 +75,8 @@ spec:
- name: dockerConfigJsonCredentialsId - name: dockerConfigJsonCredentialsId
type: secret type: secret
- type: vaultSecretFile - type: vaultSecretFile
paths: name: dockerConfigFileVaultSecretName
- $(vaultPath)/docker-config default: docker-config
- $(vaultBasePath)/$(vaultPipelineName)/docker-config
- $(vaultBasePath)/GROUP-SECRETS/docker-config
- name: cleanupMode - name: cleanupMode
type: string type: string
description: Decides which parts are removed from the Protecode backend after the scan description: Decides which parts are removed from the Protecode backend after the scan
@@ -187,10 +185,8 @@ spec:
type: secret type: secret
param: username param: username
- type: vaultSecret - type: vaultSecret
paths: name: protecodeVaultSecretName
- $(vaultPath)/protecode default: protecode
- $(vaultBasePath)/$(vaultPipelineName)/protecode
- $(vaultBasePath)/GROUP-SECRETS/protecode
- name: password - name: password
type: string type: string
description: Password which is used for the user description: Password which is used for the user
@@ -205,10 +201,8 @@ spec:
type: secret type: secret
param: password param: password
- type: vaultSecret - type: vaultSecret
paths: name: protecodeVaultSecretName
- $(vaultPath)/protecode default: protecode
- $(vaultBasePath)/$(vaultPipelineName)/protecode
- $(vaultBasePath)/GROUP-SECRETS/protecode
- name: version - name: version
aliases: aliases:
- name: artifactVersion - name: artifactVersion

View File

@@ -42,10 +42,8 @@ spec:
secret: true secret: true
resourceRef: resourceRef:
- type: vaultSecret - type: vaultSecret
paths: name: sonarSecretName
- $(vaultPath)/sonar default: sonar
- $(vaultBasePath)/$(vaultPipelineName)/sonar
- $(vaultBasePath)/GROUP-SECRETS/sonar
- name: sonarTokenCredentialsId - name: sonarTokenCredentialsId
type: secret type: secret
aliases: aliases:
@@ -226,10 +224,8 @@ spec:
- name: githubTokenCredentialsId - name: githubTokenCredentialsId
type: secret type: secret
- type: vaultSecret - type: vaultSecret
paths: name: githubVaultSecretName
- $(vaultPath)/github default: github
- $(vaultBasePath)/$(vaultPipelineName)/github
- $(vaultBasePath)/GROUP-SECRETS/github
- name: disableInlineComments - name: disableInlineComments
type: bool type: bool
description: "Pull-Request only: Disables the pull-request decoration with inline comments. description: "Pull-Request only: Disables the pull-request decoration with inline comments.

View File

@@ -21,10 +21,8 @@ spec:
type: string type: string
resourceRef: resourceRef:
- type: vaultSecretFile - type: vaultSecretFile
paths: name: terraformExecuteFileVaultSecret
- $(vaultPath)/terraformExecute default: terraformExecute
- $(vaultBasePath)/$(vaultPipelineName)/terraformExecute
- $(vaultBasePath)/GROUP-SECRETS/terraformExecute
- name: additionalArgs - name: additionalArgs
type: "[]string" type: "[]string"
scope: scope:

View File

@@ -26,10 +26,8 @@ spec:
secret: true secret: true
resourceRef: resourceRef:
- type: vaultSecret - type: vaultSecret
paths: name: jenkinsVaultSecret
- $(vaultPath)/jenkins default: jenkins
- $(vaultBasePath)/$(vaultPipelineName)/jenkins
- $(vaultBasePath)/GROUP-SECRETS/jenkins
aliases: aliases:
- name: url - name: url
- name: jenkinsCredentialDomain - name: jenkinsCredentialDomain
@@ -52,10 +50,8 @@ spec:
- name: userId - name: userId
resourceRef: resourceRef:
- type: vaultSecret - type: vaultSecret
paths: name: jenkinsVaultSecret
- $(vaultPath)/jenkins default: jenkins
- $(vaultBasePath)/$(vaultPipelineName)/jenkins
- $(vaultBasePath)/GROUP-SECRETS/jenkins
- name: jenkinsToken - name: jenkinsToken
type: string type: string
description: "The jenkins token" description: "The jenkins token"
@@ -68,10 +64,8 @@ spec:
- name: token - name: token
resourceRef: resourceRef:
- type: vaultSecret - type: vaultSecret
paths: name: jenkinsVaultSecret
- $(vaultPath)/jenkins default: jenkins
- $(vaultBasePath)/$(vaultPipelineName)/jenkins
- $(vaultBasePath)/GROUP-SECRETS/jenkins
- name: vaultAppRoleSecretTokenCredentialsId - name: vaultAppRoleSecretTokenCredentialsId
type: string type: string
description: The Jenkins credential ID or Azure DevOps variable name for the Vault AppRole Secret ID credential description: The Jenkins credential ID or Azure DevOps variable name for the Vault AppRole Secret ID credential

View File

@@ -198,10 +198,8 @@ spec:
type: secret type: secret
param: password param: password
- type: vaultSecret - type: vaultSecret
paths: name: gitHttpsCredentialVaultSecretName
- $(vaultPath)/gitHttpsCredential default: gitHttpsCredential
- $(vaultBasePath)/$(vaultPipelineName)/gitHttpsCredential
- $(vaultBasePath)/GROUP-SECRETS/gitHttpsCredential
- name: projectSettingsFile - name: projectSettingsFile
aliases: aliases:
- name: maven/projectSettingsFile - name: maven/projectSettingsFile
@@ -247,10 +245,8 @@ spec:
type: secret type: secret
param: username param: username
- type: vaultSecret - type: vaultSecret
paths: name: gitHttpsCredentialVaultSecretName
- $(vaultPath)/gitHttpsCredential default: gitHttpsCredential
- $(vaultBasePath)/$(vaultPipelineName)/gitHttpsCredential
- $(vaultBasePath)/GROUP-SECRETS/gitHttpsCredential
- name: versioningTemplate - name: versioningTemplate
type: string type: string
description: "DEPRECATED: Defines the template for the automatic version which will be created" description: "DEPRECATED: Defines the template for the automatic version which will be created"

View File

@@ -360,10 +360,8 @@ spec:
- name: userTokenCredentialsId - name: userTokenCredentialsId
type: secret type: secret
- type: vaultSecret - type: vaultSecret
paths: name: whitesourceVaultSecret
- $(vaultPath)/whitesource default: whitesource
- $(vaultBasePath)/$(vaultPipelineName)/whitesource
- $(vaultBasePath)/GROUP-SECRETS/whitesource
- name: versioningModel - name: versioningModel
type: string type: string
description: "The default project versioning model used in case `projectVersion` parameter is description: "The default project versioning model used in case `projectVersion` parameter is