Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add bitbucket-server bearer auth flavor #117

Merged
merged 3 commits into from
May 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
@@ -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
@@ -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 }}
10 changes: 10 additions & 0 deletions charts/snyk-broker/templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -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