Skip to content

Commit

Permalink
Merge pull request #98 from snyk/feat/add-scmtokenpool-value
Browse files Browse the repository at this point in the history
feat: credential pooling for github and gitlab scms
  • Loading branch information
pavel-snyk authored Dec 22, 2023
2 parents d926cb8 + c511413 commit c46a227
Show file tree
Hide file tree
Showing 24 changed files with 483 additions and 75 deletions.
3 changes: 3 additions & 0 deletions .gitleaks.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ useDefault = true

[allowlist]
description = "global allow list"
paths = [
'charts/snyk-broker/tests/__snapshot__/*',
]

# ignoring historical secrets from past commits
# (not present in the current codebase)
Expand Down
2 changes: 1 addition & 1 deletion charts/snyk-broker/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
name: snyk-broker
version: 2.4.0
version: 2.5.0
description: A Helm chart for Kubernetes
type: application
21 changes: 21 additions & 0 deletions charts/snyk-broker/templates/broker_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@ spec:
secretKeyRef:
name: {{ .Values.scmType}}-token{{if not .Values.disableSuffixes }}-{{ .Release.Name }}{{ end }}
key: "{{ .Values.scmType}}-token-key"
{{- if .Values.scmTokenPool }}
- name: GITHUB_TOKEN_POOL
valueFrom:
secretKeyRef:
name: {{ .Values.scmType }}-token-pool{{if not .Values.disableSuffixes }}-{{ .Release.Name }}{{ end }}
key: "{{ .Values.scmType}}-token-key-pool"
{{- end }}
- name: PORT
value: {{ .Values.deployment.container.containerPort | squote }}
- name: BROKER_CLIENT_URL
Expand All @@ -130,6 +137,13 @@ spec:
secretKeyRef:
name: {{ .Values.scmType}}-token{{if not .Values.disableSuffixes }}-{{ .Release.Name }}{{ end }}
key: "{{ .Values.scmType}}-token-key"
{{- if .Values.scmTokenPool }}
- name: GITHUB_TOKEN_POOL
valueFrom:
secretKeyRef:
name: {{ .Values.scmType }}-token-pool{{if not .Values.disableSuffixes }}-{{ .Release.Name }}{{ end }}
key: "{{ .Values.scmType}}-token-key-pool"
{{- end }}
- name: GITHUB
value: {{ .Values.github }}
- name: GITHUB_API
Expand Down Expand Up @@ -177,6 +191,13 @@ spec:
secretKeyRef:
name: {{ .Values.scmType}}-token{{if not .Values.disableSuffixes }}-{{ .Release.Name }}{{ end }}
key: "{{ .Values.scmType}}-token-key"
{{- if .Values.scmTokenPool }}
- name: GITLAB_TOKEN_POOL
valueFrom:
secretKeyRef:
name: {{ .Values.scmType }}-token-pool{{if not .Values.disableSuffixes }}-{{ .Release.Name }}{{ end }}
key: "{{ .Values.scmType}}-token-key-pool"
{{- end }}
- name: GITLAB
value: {{ .Values.gitlab }}
- name: PORT
Expand Down
10 changes: 10 additions & 0 deletions charts/snyk-broker/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,18 @@ metadata:
type: Opaque
data:
"{{ .Values.scmType}}-token-key": {{ .Values.scmToken | b64enc | quote }}
{{- end }}
---
{{- if .Values.scmTokenPool }}
apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.scmType }}-token-pool{{if not .Values.disableSuffixes }}-{{ .Release.Name }}{{ end }}
type: Opaque
data:
"{{ .Values.scmType }}-token-key-pool": {{ .Values.scmTokenPool | b64enc | quote }}
{{- end }}
---
{{- if .Values.bitbucketPassword }}
apiVersion: v1
kind: Secret
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ with CRA:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: container-registry-agent-broker-RELEASE-NAME
namespace: NAMESPACE
spec:
Expand Down Expand Up @@ -106,7 +106,7 @@ with CRA:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: container-registry-agent-broker-service-RELEASE-NAME
namespace: NAMESPACE
spec:
Expand All @@ -133,6 +133,6 @@ with CRA:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: snyk-broker-RELEASE-NAME
namespace: NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ with CRA:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: container-registry-agent-broker-RELEASE-NAME
namespace: NAMESPACE
spec:
Expand Down Expand Up @@ -106,7 +106,7 @@ with CRA:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: container-registry-agent-broker-service-RELEASE-NAME
namespace: NAMESPACE
spec:
Expand All @@ -133,6 +133,6 @@ with CRA:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: snyk-broker-RELEASE-NAME
namespace: NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ apprisk enabled:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: github-com-broker-RELEASE-NAME
namespace: NAMESPACE
spec:
Expand Down Expand Up @@ -105,7 +105,7 @@ apprisk enabled:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: github-com-broker-service-RELEASE-NAME
namespace: NAMESPACE
spec:
Expand All @@ -132,6 +132,6 @@ apprisk enabled:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: snyk-broker-RELEASE-NAME
namespace: NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cacert:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: github-com-broker
namespace: NAMESPACE
spec:
Expand Down Expand Up @@ -113,7 +113,7 @@ cacert:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: github-com-broker-service
namespace: NAMESPACE
spec:
Expand Down Expand Up @@ -155,7 +155,7 @@ cacert:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: RELEASE-NAME-snyk-broker-cacert-configmap
namespace: NAMESPACE
4: |
Expand All @@ -174,7 +174,7 @@ cacert:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: snyk-broker
namespace: NAMESPACE
cacertfile:
Expand All @@ -186,7 +186,7 @@ cacertfile:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: github-com-broker
namespace: NAMESPACE
spec:
Expand Down Expand Up @@ -282,7 +282,7 @@ cacertfile:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: github-com-broker-service
namespace: NAMESPACE
spec:
Expand All @@ -303,7 +303,7 @@ cacertfile:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: RELEASE-NAME-snyk-broker-cacert-configmap
namespace: NAMESPACE
4: |
Expand All @@ -322,6 +322,6 @@ cacertfile:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: snyk-broker
namespace: NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cacert:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: github-com-broker-RELEASE-NAME
namespace: NAMESPACE
spec:
Expand Down Expand Up @@ -113,7 +113,7 @@ cacert:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: github-com-broker-service-RELEASE-NAME
namespace: NAMESPACE
spec:
Expand Down Expand Up @@ -155,7 +155,7 @@ cacert:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: RELEASE-NAME-snyk-broker-cacert-configmap-RELEASE-NAME
namespace: NAMESPACE
4: |
Expand All @@ -174,7 +174,7 @@ cacert:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: snyk-broker-RELEASE-NAME
namespace: NAMESPACE
cacertfile:
Expand All @@ -186,7 +186,7 @@ cacertfile:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: github-com-broker-RELEASE-NAME
namespace: NAMESPACE
spec:
Expand Down Expand Up @@ -282,7 +282,7 @@ cacertfile:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: github-com-broker-service-RELEASE-NAME
namespace: NAMESPACE
spec:
Expand All @@ -303,7 +303,7 @@ cacertfile:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: RELEASE-NAME-snyk-broker-cacert-configmap-RELEASE-NAME
namespace: NAMESPACE
4: |
Expand All @@ -322,6 +322,6 @@ cacertfile:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: snyk-broker-RELEASE-NAME
namespace: NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ customaccept values:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: RELEASE-NAME-snyk-broker-accept-configmap
namespace: NAMESPACE
2: |
Expand All @@ -20,7 +20,7 @@ customaccept values:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: github-com-broker
namespace: NAMESPACE
spec:
Expand Down Expand Up @@ -120,7 +120,7 @@ customaccept values:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: github-com-broker-service
namespace: NAMESPACE
spec:
Expand All @@ -147,6 +147,6 @@ customaccept values:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: snyk-broker
namespace: NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ customaccept values:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: RELEASE-NAME-snyk-broker-accept-configmap-RELEASE-NAME
namespace: NAMESPACE
2: |
Expand All @@ -20,7 +20,7 @@ customaccept values:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: github-com-broker-RELEASE-NAME
namespace: NAMESPACE
spec:
Expand Down Expand Up @@ -120,7 +120,7 @@ customaccept values:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: github-com-broker-service-RELEASE-NAME
namespace: NAMESPACE
spec:
Expand All @@ -147,6 +147,6 @@ customaccept values:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.4.0
helm.sh/chart: snyk-broker-2.5.0
name: snyk-broker-RELEASE-NAME
namespace: NAMESPACE
Loading

0 comments on commit c46a227

Please sign in to comment.