Skip to content

Commit

Permalink
feat(proxy): test proxy connection with an authenticated route (#110)
Browse files Browse the repository at this point in the history
Update `test-connection.yaml` in the Unleash proxy Helm chart
to use an authenticated route.

The /proxy/health route of the Unleash proxy does not require
authentication. The Authentication header is ignored for this route.
Even if there's an issue with the way client shared secrets are
configured, the test-connection.yaml test will succeed.

Using the /proxy route (which does require authentication) allows
testing a shared secret.

This change implements the recommended method to test the proxy
deployment from
https://docs.getunleash.io/how-to/how-to-run-the-unleash-proxy#verify-that-the-proxy-is-working

Also update the way `wget` is called (the Authentication header was not
correctly set, but as it was ignored this mistake was not visible).

Note: The same Helm value is used to configure the proxy shared
secrets environment variable, and the authentication header in test-connection.yaml.
As such, as long as the chart is correct, the user can't
actually make a mistake here.

However, this test is misleading to a user reading the chart templates
and manually reproducing the test against the deployed proxy, as the
current test does not actually validates shared secrets.

* chore: bump chart version to 0.6.3
  • Loading branch information
Neki authored Dec 18, 2023
1 parent bb12148 commit 4cd3a4a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/unleash-proxy/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.6.2
version: 0.6.3

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
8 changes: 5 additions & 3 deletions charts/unleash-proxy/templates/tests/test-connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ spec:
- name: wget
image: busybox
command: ['wget']
args: ['-O -',
"--header='Authorization: {{ .Values.proxy.clientKeys | first }}'",
'{{ include "unleash-proxy.fullname" . }}:{{ .Values.service.port }}/proxy/health']
args: [
'-O', '-',
'--header', 'Authorization: {{ .Values.proxy.clientKeys | first }}',
'{{ include "unleash-proxy.fullname" . }}:{{ .Values.service.port }}/proxy'
]
restartPolicy: Never

0 comments on commit 4cd3a4a

Please sign in to comment.