Skip to content

Commit 1040eee

Browse files
Brutus5000Sheikah45
authored andcommitted
Allow CORS login from localhost
1 parent 1b6d582 commit 1040eee

6 files changed

Lines changed: 67 additions & 0 deletions

File tree

apps/faf-user-service/templates/ingress.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
{{- if .Values.cors.enabled }}
2+
apiVersion: traefik.io/v1alpha1
3+
kind: Middleware
4+
metadata:
5+
name: faf-user-service-cors
6+
spec:
7+
headers:
8+
accessControlAllowMethods:
9+
- "GET"
10+
- "POST"
11+
- "OPTIONS"
12+
accessControlAllowHeaders:
13+
- "Content-Type"
14+
- "Authorization"
15+
- "X-HMAC"
16+
accessControlAllowOriginListRegex:
17+
{{- toYaml .Values.cors.allowOriginListRegex | nindent 6 }}
18+
accessControlAllowCredentials: true
19+
accessControlMaxAge: 600
20+
addVaryHeader: true
21+
---
22+
{{- end }}
123
apiVersion: traefik.io/v1alpha1
224
kind: IngressRoute
325
metadata:
@@ -11,3 +33,7 @@ spec:
1133
services:
1234
- name: faf-user-service
1335
port: 8080
36+
{{- if .Values.cors.enabled }}
37+
middlewares:
38+
- name: faf-user-service-cors
39+
{{- end }}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
cors:
2+
enabled: true
3+
allowOriginListRegex:
4+
- "^https?://localhost(:[0-9]+)?$"
5+
- "^https?://127\\.0\\.0\\.1(:[0-9]+)?$"

apps/faf-user-service/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
infisical-secret:
22
name: faf-user-service
3+
cors:
4+
enabled: false
5+
allowOriginListRegex: []

apps/ory-hydra/templates/ingress.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
{{- if .Values.cors.enabled }}
2+
apiVersion: traefik.io/v1alpha1
3+
kind: Middleware
4+
metadata:
5+
name: ory-hydra-cors
6+
spec:
7+
headers:
8+
accessControlAllowMethods:
9+
- "GET"
10+
- "POST"
11+
- "OPTIONS"
12+
accessControlAllowHeaders:
13+
- "Content-Type"
14+
- "Authorization"
15+
- "X-HMAC"
16+
accessControlAllowOriginListRegex:
17+
{{- toYaml .Values.cors.allowOriginListRegex | nindent 6 }}
18+
accessControlMaxAge: 600
19+
addVaryHeader: true
20+
---
21+
{{- end }}
122
apiVersion: traefik.io/v1alpha1
223
kind: IngressRoute
324
metadata:
@@ -11,3 +32,7 @@ spec:
1132
services:
1233
- name: ory-hydra
1334
port: 4444
35+
{{- if .Values.cors.enabled }}
36+
middlewares:
37+
- name: ory-hydra-cors
38+
{{- end }}

apps/ory-hydra/values-test.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
cors:
2+
enabled: true
3+
allowOriginListRegex:
4+
- "^https?://localhost(:[0-9]+)?$"
5+
- "^https?://127\\.0\\.0\\.1(:[0-9]+)?$"

apps/ory-hydra/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ image:
33
tag: "v25.4.0"
44
infisical-secret:
55
name: ory-hydra
6+
cors:
7+
enabled: false
8+
allowOriginListRegex: []
69
clients:
710
- name: "FAF Client"
811
id: "2e8808cf-5889-469b-b2c3-01f0cc58c4af"

0 commit comments

Comments
 (0)