-
Notifications
You must be signed in to change notification settings - Fork 5
/
portal-all-in-one-rt.yaml
93 lines (93 loc) · 2.36 KB
/
portal-all-in-one-rt.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
apiVersion: networking.gloo.solo.io/v2
kind: RouteTable
metadata:
name: portal-frontend
namespace: gloo-mesh-gateways
spec:
hosts:
- "developer.example.com"
virtualGateways:
- name: istio-ingressgateway
namespace: gloo-mesh-gateways
defaultDestination:
port:
number: 8080
ref:
name: gloo-mesh-portal-server
namespace: gloo-mesh
cluster: gg-demo-single
http:
- name: portal-frontend-auth
forwardTo:
destinations:
- port:
number: 4000
ref:
name: portal-frontend
namespace: gloo-mesh-addons
cluster: gg-demo-single
labels:
oauth: "true" # apply ext auth policy
route: portal-api
matchers:
- uri:
prefix: /portal-server/v1/login
- forwardTo:
pathRewrite: /v1
name: authn-api-and-usage-plans
labels:
oauth: "true" # apply ext auth policy
route: portal-api
matchers:
- uri:
prefix: /portal-server/v1
headers:
- name: Cookie
value: ".*?id_token=.*" # match characters before id_token= and after id_token= zero to unlimited times
regex: true
- forwardTo:
pathRewrite: /v1/me
name: authn-me
labels:
oauth: "true" # apply ext auth policy
route: portal-api
matchers:
- uri:
prefix: /portal-server/v1/me
- forwardTo:
pathRewrite: /v1/api-keys
name: authn-api-keys
labels:
oauth: "true" # apply ext auth policy
route: portal-api
matchers:
- uri:
prefix: /portal-server/v1/api-keys
- forwardTo:
pathRewrite: /v1/apis
name: no-auth-apis
labels:
route: portal-api
matchers:
- uri:
prefix: /portal-server/v1/apis
- forwardTo:
pathRewrite: /v1/usage-plans
name: no-auth-usage-plans
labels:
route: portal-api
matchers:
- uri:
prefix: /portal-server/v1/usage-plans
- name: portal-frontend-no-auth
forwardTo:
destinations:
- port:
number: 4000
ref:
name: portal-frontend
namespace: gloo-mesh-addons
cluster: gg-demo-single
matchers:
- uri:
prefix: /