1
1
{{- $v := .Values }}
2
+ {{- $k := $v.charts.keycloak | default dict }}
2
3
{{- if or (eq $v.teamId "admin") ($v.otomi.isMultitenant) }}
3
4
{{- $ := . }}
4
5
{{- range $s := $v.services }}
79
80
set :
80
81
X-Forwarded-Proto : https
81
82
---
82
- {{- if and $v.hasKeycloak (not (hasKey $s "isPublic")) (hasKey $s "authz") }}
83
+ {{- if and (not (hasKey $s "isPublic")) (hasKey $s "authz") }}
84
+ # grrr
83
85
{{- $workload := ($s.authz.workload | toYaml | replace "__TEAM" $v.teamId) }}
84
86
apiVersion : security.istio.io/v1beta1
85
87
kind : RequestAuthentication
@@ -90,12 +92,19 @@ spec:
90
92
selector :
91
93
matchLabels : {{ $workload | nindent 6 }}
92
94
jwtRules :
95
+ {{- if $k.enabled }}
93
96
- issuer : https://keycloak.{{ $v.cluster.domain }}/realms/master
94
97
jwksUri : https://keycloak.{{ $v.cluster.domain }}/realms/master/protocol/openid-connect/certs
95
- forwardOriginalToken : {{ $s.authz.forwardOriginalToken | default false }}
96
98
audiences :
97
- - otomi
99
+ - {{ $k.idp.clientID }}
100
+ {{- else }}
101
+ - issuer : {{ $v.oidc.issuer }}
102
+ # jwksUri: {{ $v.oidc.jwksUri }}
103
+ {{- end }}
104
+ forwardOriginalToken : {{ $s.authz.forwardOriginalToken | default false }}
98
105
---
106
+ {{- if $k.enabled }}
107
+ {{- $principal := printf "https://keycloak.%s/realms/master/*" $v.cluster.domain }}
99
108
apiVersion : security.istio.io/v1beta1
100
109
kind : AuthorizationPolicy
101
110
metadata :
@@ -110,7 +119,7 @@ spec:
110
119
# {}
111
120
from :
112
121
- source :
113
- requestPrincipals : ['https://keycloak. {{ $v.cluster.domain }}/realms/master/*' ]
122
+ requestPrincipals : [{{ $principal }}]
114
123
{{- if not $s.isShared }}
115
124
when :
116
125
- key : request.auth.claims[groups]
@@ -130,10 +139,11 @@ spec:
130
139
{{- end }}
131
140
- from :
132
141
- source :
133
- notRequestPrincipals : ['https://keycloak. {{ $v.cluster.domain }}/realms/master/*' ]
142
+ notRequestPrincipals : [{{ $principal }}]
134
143
---
135
144
{{- end }}
136
145
{{- end }}
137
146
{{- end }}
138
147
{{- end }}
139
148
{{- end }}
149
+ {{- end }}
0 commit comments