Skip to content

Commit

Permalink
Merge pull request #117 from snyk/fix/add-bearer-types
Browse files Browse the repository at this point in the history
fix: add bitbucket-server bearer auth flavor
  • Loading branch information
aarlaud authored May 7, 2024
2 parents 44efe7d + 324f7ae commit 0de3041
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
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.6.6
version: 2.6.7
description: A Helm chart for Kubernetes
type: application
23 changes: 22 additions & 1 deletion charts/snyk-broker/templates/broker_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,27 @@ spec:
- name: BROKER_CLIENT_URL
value: {{ .Values.brokerClientUrl }}
{{- end }}
{{- if eq .Values.scmType "bitbucket-server-bearer-auth" }}
# Bitbucket Bearer Auth
- name: BROKER_TOKEN
valueFrom:
secretKeyRef:
name: {{ .Values.scmType}}-broker-token{{if not .Values.disableSuffixes }}-{{ .Release.Name }}{{ end }}
key: "{{ .Values.scmType}}-broker-token-key"
- name: BITBUCKET_PAT
valueFrom:
secretKeyRef:
name: {{ .Values.scmType}}-token{{if not .Values.disableSuffixes }}-{{ .Release.Name }}{{ end }}
key: "{{ .Values.scmType}}-token-key"
- name: BITBUCKET
value: {{ .Values.bitbucket }}
- name: BITBUCKET_API
value: {{ .Values.bitbucketApi }}
- name: PORT
value: {{ .Values.deployment.container.containerPort | squote }}
- name: BROKER_CLIENT_URL
value: {{ .Values.brokerClientUrl }}
{{- end }}
{{- if eq .Values.scmType "gitlab" }}
# GitLab
- name: BROKER_TOKEN
Expand Down Expand Up @@ -441,7 +462,7 @@ spec:
- name: ACCEPT
value: /home/node/private/accept.json
{{ else }}
{{- if or (eq .Values.scmType "github-com") (eq .Values.scmType "github-enterprise") (eq .Values.scmType "bitbucket-server") (eq .Values.scmType "gitlab") (eq .Values.scmType "azure-repos") }}
{{- if has .Values.scmType ( list "github-com" "github-enterprise" "bitbucket-server" "bitbucket-server-bearer-auth" "gitlab" "azure-repos") }}
{{- if not .Values.disableAutoAcceptRules }}
# Default Values to allow Snyk Code Snippets and Snyk IaC
{{- if not .Values.enableSnykCodeLocalEngine }}
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 @@ -38,6 +38,16 @@ data:
"{{ .Values.scmType}}-token-key": {{ .Values.bitbucketPassword | b64enc | quote }}
---
{{- end }}
{{- if .Values.bitbucketPat }}
apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.scmType}}-token{{if not .Values.disableSuffixes }}-{{ .Release.Name }}{{ end }}
type: Opaque
stringData:
"{{ .Values.scmType}}-token-key": {{ .Values.bitbucketPat | quote }}
---
{{- end }}
{{- if .Values.azureReposToken }}
apiVersion: v1
kind: Secret
Expand Down

0 comments on commit 0de3041

Please sign in to comment.