temporary fix to cleanup auth forward (#422)
* temporary fix to cleanup auth forward * actually: its crd based to begin with! * update tests * actually fix tests
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
apiVersion: v2
|
||||
kubeVersion: ">=1.16.0-0"
|
||||
name: common
|
||||
version: 3.5.2
|
||||
version: 3.5.3
|
||||
# upstream_version:
|
||||
appVersion: none
|
||||
description: Function library for TrueCharts
|
||||
|
||||
@@ -30,11 +30,6 @@ of the main Ingress and any additionalIngresses.
|
||||
{{- include "common.classes.ingress" $ -}}
|
||||
{{ end -}}
|
||||
|
||||
{{- if $ingressValues.authForwardURL -}}
|
||||
{{- print ("---") | nindent 0 -}}
|
||||
{{- include "common.classes.ingress.authForward" $ }}
|
||||
{{ end -}}
|
||||
|
||||
{{- if eq $ingressValues.certType "ixcert" -}}
|
||||
{{- $_ := set $ "ObjectValues" (dict "certHolder" $ingressValues) -}}
|
||||
{{- print ("---") | nindent 0 -}}
|
||||
@@ -74,11 +69,6 @@ of the main Ingress and any additionalIngresses.
|
||||
{{- include "common.classes.ingress" $ -}}
|
||||
{{ end -}}
|
||||
|
||||
{{- if $ingressValues.authForwardURL -}}
|
||||
{{- print ("---") | nindent 0 -}}
|
||||
{{- include "common.classes.ingress.authForward" $ }}
|
||||
{{ end -}}
|
||||
|
||||
{{- if eq $ingressValues.certType "ixcert" -}}
|
||||
{{- $_ := set $ "ObjectValues" (dict "certHolder" $ingressValues) -}}
|
||||
{{- print ("---") | nindent 0 -}}
|
||||
@@ -121,11 +111,6 @@ of the main Ingress and any additionalIngresses.
|
||||
{{- print ("---") | nindent 0 -}}
|
||||
{{- include "common.classes.externalService" $ }}
|
||||
|
||||
{{- if $ingressValues.authForwardURL -}}
|
||||
{{- print ("---") | nindent 0 -}}
|
||||
{{- include "common.classes.ingress.authForward" $ }}
|
||||
{{ end -}}
|
||||
|
||||
{{- if eq $ingressValues.certType "ixcert" -}}
|
||||
{{- $_ := set $ "ObjectValues" (dict "certHolder" $ingressValues) -}}
|
||||
{{- print ("---") | nindent 0 -}}
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
{{/*
|
||||
Renders the additional authForward objects from ingress
|
||||
*/}}
|
||||
{{- define "common.classes.ingress.authForward" -}}
|
||||
{{- $authForwardName := include "common.names.fullname" . -}}
|
||||
{{- $values := .Values -}}
|
||||
{{- if hasKey . "ObjectValues" -}}
|
||||
{{- with .ObjectValues.ingress -}}
|
||||
{{- $values = . -}}
|
||||
{{- end -}}
|
||||
{{ end -}}
|
||||
{{- if hasKey $values "nameSuffix" -}}
|
||||
{{- $authForwardName = printf "%v-%v" $authForwardName $values.nameSuffix -}}
|
||||
{{ end -}}
|
||||
apiVersion: traefik.containo.us/v1alpha1
|
||||
kind: Middleware
|
||||
metadata:
|
||||
name: {{ $authForwardName }}-auth-forward
|
||||
spec:
|
||||
forwardAuth:
|
||||
address: {{ $values.authForwardURL | quote }}
|
||||
tls:
|
||||
insecureSkipVerify: true
|
||||
trustForwardHeader: true
|
||||
authResponseHeaders:
|
||||
- Remote-User
|
||||
- Remote-Groups
|
||||
- Remote-Name
|
||||
- Remote-Email
|
||||
{{- end }}
|
||||
@@ -14,6 +14,7 @@ within the common library.
|
||||
{{- end -}}
|
||||
{{ end -}}
|
||||
|
||||
|
||||
{{- if hasKey $values "nameSuffix" -}}
|
||||
{{- $ingressName = printf "%v-%v" $ingressName $values.nameSuffix -}}
|
||||
{{- if and ( $.Values.services ) ( not $values.servicePort ) }}
|
||||
@@ -52,7 +53,7 @@ metadata:
|
||||
traefik.ingress.kubernetes.io/service.serversscheme: https
|
||||
{{- end }}
|
||||
traefik.ingress.kubernetes.io/router.entrypoints: {{ $values.entrypoint | default "websecure" }}
|
||||
traefik.ingress.kubernetes.io/router.middlewares: traefik-middlewares-chain-public@kubernetescrd{{ if $values.authForwardURL }},{{ $ingressName }}-auth-forward{{ end }}
|
||||
traefik.ingress.kubernetes.io/router.middlewares: traefik-middlewares-chain-public@kubernetescrd{{ if $values.authForwardURL }},{{ $ingressName }}-auth-forward@kubernetescrd{{ end }}
|
||||
{{- with $values.annotations }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
@@ -115,4 +116,26 @@ spec:
|
||||
servicePort: {{ $svcPort }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- if $values.authForwardURL }}
|
||||
|
||||
---
|
||||
|
||||
apiVersion: traefik.containo.us/v1alpha1
|
||||
kind: Middleware
|
||||
metadata:
|
||||
name: {{ $ingressName }}-auth-forward
|
||||
spec:
|
||||
forwardAuth:
|
||||
address: {{ $values.authForwardURL | quote }}
|
||||
tls:
|
||||
insecureSkipVerify: true
|
||||
trustForwardHeader: true
|
||||
authResponseHeaders:
|
||||
- Remote-User
|
||||
- Remote-Groups
|
||||
- Remote-Name
|
||||
- Remote-Email
|
||||
{{- end }}
|
||||
|
||||
{{- end }}
|
||||
|
||||
@@ -81,7 +81,7 @@ spec:
|
||||
middlewares:
|
||||
- name: traefik-middlewares-chain-public@kubernetescrd
|
||||
{{- if $values.authForwardURL }}
|
||||
- name: "{{ $ingressName }}-auth-forward"
|
||||
- name: "{{ $ingressName }}-auth-forward@kubernetescrd"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
@@ -102,4 +102,24 @@ spec:
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- if $values.authForwardURL }}
|
||||
---
|
||||
|
||||
apiVersion: traefik.containo.us/v1alpha1
|
||||
kind: Middleware
|
||||
metadata:
|
||||
name: {{ $ingressName }}-auth-forward
|
||||
spec:
|
||||
forwardAuth:
|
||||
address: {{ $values.authForwardURL | quote }}
|
||||
tls:
|
||||
insecureSkipVerify: true
|
||||
trustForwardHeader: true
|
||||
authResponseHeaders:
|
||||
- Remote-User
|
||||
- Remote-Groups
|
||||
- Remote-Name
|
||||
- Remote-Email
|
||||
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
Reference in New Issue
Block a user