File tree Expand file tree Collapse file tree 4 files changed +24
-10
lines changed
charts/jwt-nginx-ext-auth Expand file tree Collapse file tree 4 files changed +24
-10
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ type: application
1515# This is the chart version. This version number should be incremented each time you make changes
1616# to the chart and its templates, including the app version.
1717# Versions are expected to follow Semantic Versioning (https://semver.org/)
18- version : 0.0.1
18+ version : 0.0.2
1919
2020# This is the version number of the application being deployed. This version number should be
2121# incremented each time you make changes to the application. Versions are not expected to
Original file line number Diff line number Diff line change 3232 {{- toYaml .Values.podSecurityContext | nindent 8 }}
3333 containers :
3434 - name : {{ .Chart.Name }}
35+ env :
36+ - name : OIDC_DISCOVERY_URL
37+ value : {{ .Values.oidcConfig.discoveryUrl }}
38+ - name : JWKS_URI
39+ value : {{ .Values.oidcConfig.jwksUri }}
40+ - name : JWT_ISSUER
41+ value : {{ .Values.oidcConfig.jwtIssuer }}
42+ - name : JWT_AUDIENCE
43+ value : {{ .Values.oidcConfig.jwtAudience }}
44+ - name : JWT_HEADER
45+ value : {{ .Values.oidcConfig.jwtHeader }}
46+ - name : PORT
47+ value : " {{ .Values.service.port }}"
3548 securityContext :
3649 {{- toYaml .Values.securityContext | nindent 12 }}
3750 image : " {{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
4053 - name : http
4154 containerPort : {{ .Values.service.port }}
4255 protocol : TCP
43- livenessProbe :
44- httpGet :
45- path : /
46- port : http
47- readinessProbe :
48- httpGet :
49- path : /
50- port : http
5156 resources :
5257 {{- toYaml .Values.resources | nindent 12 }}
5358 {{- with .Values.volumeMounts }}
Original file line number Diff line number Diff line change @@ -14,6 +14,13 @@ imagePullSecrets: []
1414nameOverride : " "
1515fullnameOverride : " "
1616
17+ oidcConfig :
18+ discoveryUri : " "
19+ jwksUri : " "
20+ jwtIssuer : " "
21+ jwtAudience : " "
22+ jwtHeader : " authorization"
23+
1724serviceAccount :
1825 # Specifies whether a service account should be created
1926 create : true
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ if (process.env.OIDC_DISCOVERY_URI) {
1212 jwks_uri : string ;
1313 issuer : string ;
1414 } ;
15+ console . log ( "Discovered JWKS_URI" , discoveryJson . jwks_uri ) ;
16+ console . log ( "Discovered issuer" , discoveryJson . issuer ) ;
1517 process . env . JWKS_URI = discoveryJson . jwks_uri ;
1618 process . env . JWT_ISSUER = discoveryJson . issuer ;
1719}
@@ -31,7 +33,7 @@ fastify.get<{
3133 authorization : string ;
3234 } ;
3335} > ( "/" , async ( request , reply ) => {
34- const header = process . env . JWT_HEADER ?? "authorization" ;
36+ const header = ( process . env . JWT_HEADER ?? "authorization" ) . toLowerCase ( ) ;
3537 if ( ! request . headers [ header ] ) {
3638 reply . status ( 401 ) . send ( { error : "Unauthorized" } ) ;
3739 return ;
You can’t perform that action at this time.
0 commit comments