Skip to content

Commit

Permalink
Adds BasicAuth checks for username and password sourcing (#12)
Browse files Browse the repository at this point in the history
- Bumps chart versions
- Fixes Helm version in Github action

Signed-off-by: ChrisJBurns <[email protected]>
  • Loading branch information
ChrisJBurns authored Nov 15, 2022
1 parent b6dd528 commit 817daf4
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Helm
uses: azure/setup-helm@v1
with:
version: 3.*
version: 3.10.1

- name: Add dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion charts/pact-broker/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: pact-broker
description: The Pact Broker is an application for sharing for Pact contracts and verification results.
type: application
version: 0.2.0
version: 0.2.1
appVersion: 2.100.0.1
dependencies:
- condition: postgresql.enabled
Expand Down
2 changes: 1 addition & 1 deletion charts/pact-broker/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# pact-broker

![Version: 0.2.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.100.0.1](https://img.shields.io/badge/AppVersion-2.100.0.1-informational?style=flat-square)
![Version: 0.2.1](https://img.shields.io/badge/Version-0.2.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.100.0.1](https://img.shields.io/badge/AppVersion-2.100.0.1-informational?style=flat-square)

The Pact Broker is an application for sharing for Pact contracts and verification results.

Expand Down
8 changes: 8 additions & 0 deletions charts/pact-broker/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ spec:
# Authentication and authorization
- name: PACT_BROKER_BASIC_AUTH_ENABLED
value: {{ .Values.broker.config.basicAuth.enabled | quote }}
{{- if .Values.broker.config.basicAuth.enabled }}
- name: PACT_BROKER_BASIC_AUTH_USERNAME
{{- if .Values.broker.config.basicAuth.writeUser.username }}
value: {{ .Values.broker.config.basicAuth.writeUser.username }}
Expand All @@ -129,6 +130,8 @@ spec:
name: {{ .Values.broker.config.basicAuth.writeUser.existingSecret }}
key: {{ .Values.broker.config.basicAuth.writeUser.existingSecretUsernameKey }}
{{- end }}
{{- end }}
{{- if .Values.broker.config.basicAuth.enabled }}
- name: PACT_BROKER_BASIC_AUTH_PASSWORD
{{- if .Values.broker.config.basicAuth.writeUser.password }}
value: {{ .Values.broker.config.basicAuth.writeUser.password }}
Expand All @@ -138,6 +141,8 @@ spec:
name: {{ .Values.broker.config.basicAuth.writeUser.existingSecret }}
key: {{ .Values.broker.config.basicAuth.writeUser.existingSecretPasswordKey }}
{{- end }}
{{- end }}
{{- if .Values.broker.config.basicAuth.enabled }}
- name: PACT_BROKER_BASIC_AUTH_READ_ONLY_USERNAME
{{- if .Values.broker.config.basicAuth.readUser.username }}
value: {{ .Values.broker.config.basicAuth.readUser.username }}
Expand All @@ -147,6 +152,8 @@ spec:
name: {{ .Values.broker.config.basicAuth.readUser.existingSecret }}
key: {{ .Values.broker.config.basicAuth.readUser.existingSecretUsernameKey }}
{{- end }}
{{- end }}
{{- if .Values.broker.config.basicAuth.enabled }}
- name: PACT_BROKER_BASIC_AUTH_READ_ONLY_PASSWORD
{{- if .Values.broker.config.basicAuth.readUser.password }}
value: {{ .Values.broker.config.basicAuth.readUser.password }}
Expand All @@ -156,6 +163,7 @@ spec:
name: {{ .Values.broker.config.basicAuth.readUser.existingSecret }}
key: {{ .Values.broker.config.basicAuth.readUser.existingSecretPasswordKey }}
{{- end }}
{{- end }}
- name: PACT_BROKER_ALLOW_PUBLIC_READ
value: {{ .Values.broker.config.basicAuth.allowPublicRead | quote }}
- name: PACT_BROKER_PUBLIC_HEARTBEAT
Expand Down
10 changes: 5 additions & 5 deletions charts/pact-broker/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ broker:

# -- Set to true if you basic authentication to be enabled
#
enabled: true
enabled: false

# -- Set to true if you want public read access, but still require credentials for writing.
#
Expand All @@ -152,10 +152,10 @@ broker:
writeUser:

# -- Usermame for write access to the Pact Broker
username: "admin"
username: ""

# -- Password for write access to the Pact Broker
password: "admin"
password: ""

# -- Name of an existing Kubernetes secret containing credentials to access the Pact Broker
existingSecret: ""
Expand All @@ -170,10 +170,10 @@ broker:
readUser:

# -- Usermame for read access to the Pact Broker
username: "admin"
username: ""

# -- Password for read access to the Pact Broker
password: "admin"
password: ""

# -- Name of an existing Kubernetes secret containing credentials to access the Pact Broker
existingSecret: ""
Expand Down

0 comments on commit 817daf4

Please sign in to comment.