-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathkong.yaml
215 lines (189 loc) · 4.41 KB
/
kong.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
#*********************************************************************
# Copyright (c) Intel Corporation 2018-2019
# SPDX-License-Identifier: Apache-2.0
#*********************************************************************
# Metadata fields start with an underscore (_)
# Fields that do not start with an underscore represent Kong entities and attributes
# _format_version is mandatory,
# it specifies the minimum version of Kong that supports the format
_format_version: "2.1"
# _transform is optional, defaulting to true.
# It specifies whether schema transformations should be applied when importing this file
# as a rule of thumb, leave this setting to true if you are importing credentials
# with plain passwords, which need to be encrypted/hashed before storing on the database.
# On the other hand, if you are reimporting a database with passwords already encrypted/hashed,
# set it to false.
_transform: true
# Each Kong entity (core entity or custom entity introduced by a plugin)
# can be listed in the top-level as an array of objects:
services:
- name: mps-rest
host: mpsrouter
port: 8003
tags:
- mps
routes:
- name: mps-route
strip_path: true
paths:
- /mps
- name: device-power-state-route
strip_path: true
paths:
- /device/power/state/(?<id>[a-fA-F0-9\-]+)
- name: device-power-action-route
strip_path: true
paths:
- /device/power/action/(?<id>[a-fA-F0-9\-]+)
- name: mps-redirection
host: mps
port: 3000
path: /relay
tags:
- mps
routes:
- name: mps-redirection-route
strip_path: true
paths:
- /mps/ws/relay
- name: mps-rest-v2
host: mps
port: 3000
path: /api/v1/authorize
tags:
- mps
routes:
- name: mps-login-route
strip_path: true
paths:
- /mps/login/api/v1/authorize
- name: rps-rest
host: rps
port: 8081
tags:
- rps
routes:
- name: rps-route
strip_path: true
paths:
- /rps
- name: rps-ws
host: rps
port: 8080
tags:
- rps
routes:
- name: rps-activate-route
strip_path: true
paths:
- /activate
- name: rps-deactivate-route
strip_path: true
paths:
- /deactivate
- name: rps-maintenance-route
strip_path: true
paths:
- /maintenance
# uncomment to use with enterprise assistant
# - name: rps-ea
# host: rps
# port: 8082
# tags:
# - rps
# routes:
# - name: rps-ea-route
# strip_path: true
# paths:
# - /ea
- name: vault-api
host: vault
port: 8200
tags:
- vault
routes:
- name: vault-route
strip_path: true
paths:
- /vault
- name: mosquitto-ws
host: mosquitto
port: 9001
tags:
- mosquitto
routes:
- name: mosquitto-route
strip_path: true
paths:
- /mosquitto
- name: web
host: webui
port: 80
tags:
- web
routes:
- name: web-route
paths:
- /
plugins:
- name: cors
- name: jwt
route: rps-route
config:
claims_to_verify:
- exp
- name: jwt
service: mps-rest
config:
claims_to_verify:
- exp
- name: request-transformer
route: device-power-state-route
config:
replace:
uri: "/api/v1/amt/power/state/$(uri_captures['id'])"
- name: request-transformer
route: device-power-action-route
config:
replace:
uri: "/api/v1/amt/power/action/$(uri_captures['id'])"
consumers:
- username: admin
jwt_secrets:
- consumer: admin
key: 9EmRJTbIiIb4bIeSsmgcWIjrR6HyETqc #sample key
secret:
# routes:
# - name: another-route
# # Relationships can also be specified between top-level entities,
# # either by name or by id
# service: example-service
# hosts: ["hello.com"]
# consumers:
# - username: example-user
# # Custom entities from plugin can also be specified
# # If they specify a foreign-key relationshp, they can also be nested
# keyauth_credentials:
# - key: my-key
# plugins:
# - name: rate-limiting
# _comment: "these are default rate-limits for user example-user"
# config:
# policy: local
# second: 5
# hour: 10000
# When an entity has multiple foreign-key relationships
# (e.g. a plugin matching on both consumer and service)
# it must be specified as a top-level entity, and not through
# nesting.
# plugins:
# - name: rate-limiting
# consumer: example-user
# service: another-service
# _comment: "example-user is extra limited when using another-service"
# config:
# hour: 2
# # tags are for your organization only and have no meaning for Kong:
# tags:
# - extra_limits
# - my_tag