File tree Expand file tree Collapse file tree 5 files changed +58
-11
lines changed Expand file tree Collapse file tree 5 files changed +58
-11
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ type: application
1818# This is the chart version. This version number should be incremented each time you make changes
1919# to the chart and its templates, including the app version.
2020# Versions are expected to follow Semantic Versioning (https://semver.org/)
21- version : " 0.2.2 "
21+ version : " 0.3.0 "
2222
2323# This is the version number of the application being deployed. This version number should be
2424# incremented each time you make changes to the application. Versions are not expected to
Original file line number Diff line number Diff line change @@ -155,12 +155,18 @@ function _M.access(conf, ctx)
155155 end
156156
157157 -- Expose user id on $kratos_user_id variable
158+ -- Expose user email on $kratos_user_email variable
158159 if conf .expose_user_id then
159160 core .request .set_header (ctx , " x-user-id" , data .identity .id )
160161 core .response .set_header (" x-user-id" , data .identity .id )
162+ core .request .set_header (ctx , " x-user-email" , data .identity .traits .email )
163+ core .response .set_header (" x-user-email" , data .identity .traits .email )
161164 core .ctx .register_var (" kratos_user_id" , function (ctx )
162165 return data .identity .id
163166 end )
167+ core .ctx .register_var (" kratos_user_email" , function (ctx )
168+ return data .identity .traits .email
169+ end )
164170 end
165171end
166172
Original file line number Diff line number Diff line change 11{{- $apisixPlugins := .Values.apisixPlugins -}}
22{{- $namespace := .Values.hubNamespace -}}
3- {{- $domain:= .Values.domain -}}
3+ {{- $domain := .Values.domain -}}
44{{- $sessionCookie := .Values.sessionCookieName -}}
55{{- with .Values.routes }}
66{{- range . }}
@@ -20,16 +20,12 @@ spec:
2020 websocket : {{ .websocket | default false }}
2121 match :
2222 hosts :
23- - {{ print .subdomain "." $domain | quote }}
23+ - {{ .host | default (printf "%s.%s" .subdomain $domain) | quote }}
2424 paths :
25- {{ .paths | toYaml | nindent 7 }}
25+ {{- .paths | toYaml | nindent 8 }}
2626 methods :
27- {{ .methods | toYaml | nindent 7 }}
27+ {{- .methods | toYaml | nindent 8 }}
2828 plugins :
29- {{- if .cors }}
30- - name : cors
31- enable : true
32- {{- end }}
3329 {{- if .setUserHeader }}
3430 - name : kratos
3531 enable : true
4440 enable : true
4541 config :
4642 regex_uri :
47- {{ .regexUri | toYaml | nindent 9 }}
43+ {{- .regexUri | toYaml | nindent 10 }}
4844 {{- end }}
4945---
5046{{- end }}
Original file line number Diff line number Diff line change 1+ apiVersion : v1
2+ kind : Service
3+ metadata :
4+ name : apisix-gateway-internal
5+ labels :
6+ {{- include "hub-gateway.labels" . | nindent 4 }}
7+ spec :
8+ type : ClusterIP
9+ ports :
10+ - port : 80
11+ targetPort : 9080
12+ protocol : TCP
13+ name : http
14+ selector :
15+ app.kubernetes.io/instance : hub-gateway
16+ app.kubernetes.io/name : apisix
Original file line number Diff line number Diff line change @@ -13,7 +13,34 @@ routes:
1313 methods :
1414 - POST
1515 - OPTIONS
16- cors : true
16+ setUserHeader : true
17+ regexUri :
18+ - " /graphql"
19+ - " /"
20+
21+ - name : api-internal
22+ serviceName : federated-router
23+ servicePort : 80
24+ host : apisix-gateway-internal.ingress-apisix.svc.cluster.local
25+ paths :
26+ - /graphql
27+ methods :
28+ - POST
29+ - OPTIONS
30+ setUserHeader : true
31+ regexUri :
32+ - " /graphql"
33+ - " /"
34+
35+ - name : hub-browser-graphql
36+ serviceName : federated-router
37+ servicePort : 80
38+ subdomain : hub
39+ paths :
40+ - /graphql
41+ methods :
42+ - POST
43+ - OPTIONS
1744 setUserHeader : true
1845 regexUri :
1946 - " /graphql"
@@ -44,6 +71,8 @@ routes:
4471 - /organizations/new
4572 - /projects
4673 - /projects/*
74+ - /treasuries
75+ - /treasuries/*
4776
4877- name : ui-public
4978 subdomain : hub
You can’t perform that action at this time.
0 commit comments