Skip to content

Commit 463b233

Browse files
committed
Add support for enabling and disabling endpoints from the api gateway
Signed-off-by: sdimitrov9 <[email protected]>
1 parent 9f71508 commit 463b233

File tree

2 files changed

+103
-28
lines changed

2 files changed

+103
-28
lines changed

charts/hedera-mirror-rest-java/values.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,27 @@ gateway:
7171
kind: "{{ .Values.gateway.target.kind }}"
7272
name: "{{ include \"hedera-mirror-rest-java.fullname\" $ }}"
7373
port: 80
74-
matches:
74+
matches: |
75+
{{- if true }}
7576
- path:
7677
type: RegularExpression # GKE does not yet support RegularExpression type
7778
value: '/api/v1/accounts/(\d+\.){0,2}(\d+|(0x)?[A-Fa-f0-9]{40}|(?:[A-Z2-7]{8})*(?:[A-Z2-7]{2}|[A-Z2-7]{4,5}|[A-Z2-7]{7,8}))/allowances/nfts'
79+
{{- end }}
80+
{{- if true }}
7881
- path:
7982
type: RegularExpression
8083
value: '/api/v1/accounts/(\d+\.){0,2}(\d+|(0x)?[A-Fa-f0-9]{40}|(?:[A-Z2-7]{8})*(?:[A-Z2-7]{2}|[A-Z2-7]{4,5}|[A-Z2-7]{7,8}))/airdrops/outstanding'
84+
{{- end }}
85+
{{- if true }}
8186
- path:
8287
type: RegularExpression
8388
value: '/api/v1/accounts/(\d+\.){0,2}(\d+|(0x)?[A-Fa-f0-9]{40}|(?:[A-Z2-7]{8})*(?:[A-Z2-7]{2}|[A-Z2-7]{4,5}|[A-Z2-7]{7,8}))/airdrops/pending'
89+
{{- end }}
90+
{{- if true }}
8491
- path:
8592
type: RegularExpression
8693
value: '/api/v1/topics/(\d+\.){0,2}\d+$'
94+
{{- end }}
8795
target:
8896
group: ""
8997
kind: Service

charts/hedera-mirror-rest/values.yaml

Lines changed: 94 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -71,127 +71,196 @@ gateway:
7171
kind: "{{ .Values.gateway.target.kind }}"
7272
name: "{{ include \"hedera-mirror-rest.fullname\" $ }}"
7373
port: 80
74-
matches:
75-
# Account Endpoints
74+
matches: |
75+
# Airdrops
76+
{{- if false }}
7677
- path:
7778
type: RegularExpression
7879
value: '/api/v1/accounts/(\d+\.){0,2}(\d+|(0x)?[A-Fa-f0-9]{40}|(?:[A-Z2-7]{8})*(?:[A-Z2-7]{2}|[A-Z2-7]{4,5}|[A-Z2-7]{7,8}))/airdrops/outstanding$'
80+
{{- end }}
81+
{{- if false }}
7982
- path:
8083
type: RegularExpression
8184
value: '/api/v1/accounts/(\d+\.){0,2}(\d+|(0x)?[A-Fa-f0-9]{40}|(?:[A-Z2-7]{8})*(?:[A-Z2-7]{2}|[A-Z2-7]{4,5}|[A-Z2-7]{7,8}))/airdrops/pending'
85+
{{- end }}
86+
{{- if true }}
87+
# Accounts
8288
- path:
8389
type: RegularExpression
8490
value: '/api/v1/accounts/(\d+\.){0,2}(\d+|(0x)?[A-Fa-f0-9]{40}|(?:[A-Z2-7]{8})*(?:[A-Z2-7]{2}|[A-Z2-7]{4,5}|[A-Z2-7]{7,8}))/allowances/crypto'
91+
{{- end }}
92+
{{- if true }}
8593
- path:
8694
type: RegularExpression
8795
value: '/api/v1/accounts/(\d+\.){0,2}(\d+|(0x)?[A-Fa-f0-9]{40}|(?:[A-Z2-7]{8})*(?:[A-Z2-7]{2}|[A-Z2-7]{4,5}|[A-Z2-7]{7,8}))/allowances/tokens'
96+
{{- end }}
97+
{{- if false }}
8898
- path:
8999
type: RegularExpression
90100
value: '/api/v1/accounts/(\d+\.){0,2}(\d+|(0x)?[A-Fa-f0-9]{40}|(?:[A-Z2-7]{8})*(?:[A-Z2-7]{2}|[A-Z2-7]{4,5}|[A-Z2-7]{7,8}))/allowances/nfts'
101+
{{- end }}
102+
{{- if true }}
91103
- path:
92104
type: RegularExpression
93105
value: '/api/v1/accounts/(\d+\.){0,2}(\d+|(0x)?[A-Fa-f0-9]{40}|(?:[A-Z2-7]{8})*(?:[A-Z2-7]{2}|[A-Z2-7]{4,5}|[A-Z2-7]{7,8}))/nfts'
106+
{{- end }}
107+
{{- if true }}
94108
- path:
95109
type: RegularExpression
96110
value: '/api/v1/accounts/(\d+\.){0,2}(\d+|(0x)?[A-Fa-f0-9]{40}|(?:[A-Z2-7]{8})*(?:[A-Z2-7]{2}|[A-Z2-7]{4,5}|[A-Z2-7]{7,8}))/rewards'
111+
{{- end }}
112+
{{- if true }}
97113
- path:
98114
type: RegularExpression
99115
value: '/api/v1/accounts/(\d+\.){0,2}(\d+|(0x)?[A-Fa-f0-9]{40}|(?:[A-Z2-7]{8})*(?:[A-Z2-7]{2}|[A-Z2-7]{4,5}|[A-Z2-7]{7,8}))/tokens'
100-
# Balances Endpoint
116+
{{- end }}
117+
# Balances
118+
{{- if true }}
101119
- path:
102120
type: PathPrefix
103121
value: /api/v1/balances
104-
# Block Endpoints
122+
{{- end }}
123+
# Blocks
124+
{{- if true }}
105125
- path:
106126
type: RegularExpression
107127
value: '/api/v1/blocks/((0x)?[0-9a-fA-F]+|\d+)$'
128+
{{- end }}
129+
{{- if true }}
108130
- path:
109131
type: PathPrefix
110132
value: /api/v1/blocks
111-
# Contract Endpoints
133+
{{- end }}
134+
# Contracts
135+
{{- if true }}
112136
- path:
113137
type: RegularExpression
114138
value: '/api/v1/contracts/results/[0-9a-zA-Z.-]+/actions$'
139+
{{- end }}
140+
{{- if true }}
115141
- path:
116142
type: RegularExpression
117143
value: '/api/v1/contracts/(\d+\.){0,2}(\d+|(0x)?[A-Fa-f0-9]{40}|(?:[A-Z2-7]{8})*(?:[A-Z2-7]{2}|[A-Z2-7]{4,5}|[A-Z2-7]{7,8}))/results/logs$'
144+
{{- end }}
145+
{{- if true }}
118146
- path:
119147
type: RegularExpression
120148
value: '/api/v1/contracts/(\d+\.){0,2}(\d+|(0x)?[A-Fa-f0-9]{40}|(?:[A-Z2-7]{8})*(?:[A-Z2-7]{2}|[A-Z2-7]{4,5}|[A-Z2-7]{7,8}))/results/\d{10}\.\d{9}$'
149+
{{- end }}
150+
{{- if true }}
121151
- path:
122152
type: RegularExpression
123153
value: '/api/v1/contracts/(\d+\.){0,2}(\d+|(0x)?[A-Fa-f0-9]{40}|(?:[A-Z2-7]{8})*(?:[A-Z2-7]{2}|[A-Z2-7]{4,5}|[A-Z2-7]{7,8}))/results$'
154+
{{- end }}
155+
{{- if true }}
124156
- path:
125157
type: RegularExpression
126158
value: '/api/v1/contracts/(\d+\.){0,2}(\d+|(0x)?[A-Fa-f0-9]{40}|(?:[A-Z2-7]{8})*(?:[A-Z2-7]{2}|[A-Z2-7]{4,5}|[A-Z2-7]{7,8}))/state$'
159+
{{- end }}
160+
{{- if true }}
127161
- path:
128162
type: RegularExpression
129163
value: '/api/v1/contracts/(\d+\.){0,2}(\d+|(0x)?[A-Fa-f0-9]{40}|(?:[A-Z2-7]{8})*(?:[A-Z2-7]{2}|[A-Z2-7]{4,5}|[A-Z2-7]{7,8}))$'
164+
{{- end }}
165+
{{- if true }}
130166
- path:
131167
type: RegularExpression
132168
value: '/api/v1/contracts/results/[0-9a-zA-Z.-]+$'
169+
{{- end }}
170+
{{- if true }}
133171
- path:
134172
type: PathPrefix
135173
value: /api/v1/contracts/results/logs
174+
{{- end }}
175+
{{- if true }}
136176
- path:
137177
type: PathPrefix
138178
value: /api/v1/contracts/results
179+
{{- end }}
180+
{{- if true }}
139181
- path:
140182
type: PathPrefix
141183
value: /api/v1/contracts
142-
# Message Endpoints
143-
- path:
144-
type: RegularExpression
145-
value: '/api/v1/messages/\d{10}\.\d{9}$'
146-
# Network Endpoints
184+
{{- end }}
185+
# Network
186+
{{- if true }}
147187
- path:
148188
type: PathPrefix
149189
value: /api/v1/network/exchangerate
190+
{{- end }}
191+
{{- if true }}
150192
- path:
151193
type: PathPrefix
152194
value: /api/v1/network/fees
195+
{{- end }}
196+
{{- if true }}
153197
- path:
154198
type: PathPrefix
155199
value: /api/v1/network/nodes
200+
{{- end }}
201+
{{- if true }}
156202
- path:
157203
type: PathPrefix
158204
value: /api/v1/network/stake
205+
{{- end }}
206+
{{- if true }}
159207
- path:
160208
type: PathPrefix
161209
value: /api/v1/network/supply
162-
# Schedule Endpoints
210+
{{- end }}
211+
# Schedules
212+
{{- if true }}
163213
- path:
164214
type: RegularExpression
165215
value: '/api/v1/schedules/\d+\.\d+\.\d+$'
216+
{{- end }}
217+
{{- if true }}
166218
- path:
167219
type: PathPrefix
168220
value: /api/v1/schedules
169-
# Token Endpoints
221+
{{- end }}
222+
# Tokens
223+
{{- if true }}
170224
- path:
171225
type: RegularExpression
172226
value: '/api/v1/tokens/(\d+\.\d+\.\d+|(0x)?[A-Fa-f0-9]{40})/nfts/\d+/transactions$'
227+
{{- end }}
228+
{{- if true }}
173229
- path:
174230
type: RegularExpression
175231
value: '/api/v1/tokens/(\d+\.\d+\.\d+|(0x)?[A-Fa-f0-9]{40})/nfts/\d+$'
232+
{{- end }}
233+
{{- if true }}
176234
- path:
177235
type: RegularExpression
178236
value: '/api/v1/tokens/(\d+\.\d+\.\d+|(0x)?[A-Fa-f0-9]{40})/nfts$'
237+
{{- end }}
238+
{{- if true }}
179239
- path:
180240
type: RegularExpression
181241
value: '/api/v1/tokens/(\d+\.\d+\.\d+|(0x)?[A-Fa-f0-9]{40})/balances$'
242+
{{- end }}
243+
{{- if true }}
182244
- path:
183245
type: RegularExpression
184246
value: '/api/v1/tokens/(\d+\.\d+\.\d+|(0x)?[A-Fa-f0-9]{40})$'
247+
{{- end }}
248+
{{- if true }}
185249
- path:
186250
type: PathPrefix
187251
value: /api/v1/tokens
188-
# Topic Message Endpoints
252+
{{- end }}
253+
# Topics
254+
{{- if true }}
189255
- path:
190256
type: RegularExpression
191257
value: '/api/v1/topics/\d+\.\d+\.\d+/messages/\d+$'
258+
{{- end }}
259+
{{- if true }}
192260
- path:
193261
type: RegularExpression
194262
value: '/api/v1/topics/\d+\.\d+\.\d+/messages$'
263+
{{- end }}
195264
target:
196265
group: ""
197266
kind: Service
@@ -235,15 +304,16 @@ ingress:
235304
hosts:
236305
- host: ""
237306
paths:
238-
# Account Endpoints
307+
# Airdrops
239308
- path: '/api/v1/accounts/(\d+\.){0,2}(\d+|(0x)?[A-Fa-f0-9]{40}|(?:[A-Z2-7]{8})*(?:[A-Z2-7]{2}|[A-Z2-7]{4,5}|[A-Z2-7]{7,8}))/airdrops/outstanding$'
240-
enabled: true
309+
enabled: false
241310
- path: '/api/v1/accounts/(\d+\.){0,2}(\d+|(0x)?[A-Fa-f0-9]{40}|(?:[A-Z2-7]{8})*(?:[A-Z2-7]{2}|[A-Z2-7]{4,5}|[A-Z2-7]{7,8}))/airdrops/pending'
242-
enabled: true
311+
enabled: false
312+
# Accounts
243313
- path: '/api/v1/accounts/(\d+\.){0,2}(\d+|(0x)?[A-Fa-f0-9]{40}|(?:[A-Z2-7]{8})*(?:[A-Z2-7]{2}|[A-Z2-7]{4,5}|[A-Z2-7]{7,8}))/allowances/crypto'
244314
enabled: true
245315
- path: '/api/v1/accounts/(\d+\.){0,2}(\d+|(0x)?[A-Fa-f0-9]{40}|(?:[A-Z2-7]{8})*(?:[A-Z2-7]{2}|[A-Z2-7]{4,5}|[A-Z2-7]{7,8}))/allowances/nfts'
246-
enabled: true
316+
enabled: false
247317
- path: '/api/v1/accounts/(\d+\.){0,2}(\d+|(0x)?[A-Fa-f0-9]{40}|(?:[A-Z2-7]{8})*(?:[A-Z2-7]{2}|[A-Z2-7]{4,5}|[A-Z2-7]{7,8}))/allowances/tokens'
248318
enabled: true
249319
- path: '/api/v1/accounts/(\d+\.){0,2}(\d+|(0x)?[A-Fa-f0-9]{40}|(?:[A-Z2-7]{8})*(?:[A-Z2-7]{2}|[A-Z2-7]{4,5}|[A-Z2-7]{7,8}))/nfts'
@@ -252,15 +322,15 @@ ingress:
252322
enabled: true
253323
- path: '/api/v1/accounts/(\d+\.){0,2}(\d+|(0x)?[A-Fa-f0-9]{40}|(?:[A-Z2-7]{8})*(?:[A-Z2-7]{2}|[A-Z2-7]{4,5}|[A-Z2-7]{7,8}))/tokens'
254324
enabled: true
255-
# Balances Endpoint
325+
# Balances
256326
- path: /api/v1/balances
257327
enabled: true
258-
# Block Endpoints
328+
# Blocks
259329
- path: '/api/v1/blocks/((0x)?[0-9a-fA-F]+|\d+)$'
260330
enabled: true
261331
- path: /api/v1/blocks
262332
enabled: true
263-
# Contract Endpoints
333+
# Contracts
264334
- path: '/api/v1/contracts/results/[0-9a-zA-Z.-]+/actions$'
265335
enabled: true
266336
- path: '/api/v1/contracts/(\d+\.){0,2}(\d+|(0x)?[A-Fa-f0-9]{40}|(?:[A-Z2-7]{8})*(?:[A-Z2-7]{2}|[A-Z2-7]{4,5}|[A-Z2-7]{7,8}))/results/logs$'
@@ -281,10 +351,7 @@ ingress:
281351
enabled: true
282352
- path: /api/v1/contracts
283353
enabled: true
284-
# Message Endpoints
285-
- path: '/api/v1/messages/\d{10}\.\d{9}$'
286-
enabled: true
287-
# Network Endpoints
354+
# Network
288355
- path: /api/v1/network/exchangerate
289356
enabled: true
290357
- path: /api/v1/network/fees
@@ -295,12 +362,12 @@ ingress:
295362
enabled: true
296363
- path: /api/v1/network/supply
297364
enabled: true
298-
# Schedule Endpoints
365+
# Schedules
299366
- path: '/api/v1/schedules/\d+\.\d+\.\d+$'
300367
enabled: true
301368
- path: /api/v1/schedules
302369
enabled: true
303-
# Token Endpoints
370+
# Tokens
304371
- path: '/api/v1/tokens/(\d+\.\d+\.\d+|(0x)?[A-Fa-f0-9]{40})/nfts/\d+/transactions$'
305372
enabled: true
306373
- path: '/api/v1/tokens/(\d+\.\d+\.\d+|(0x)?[A-Fa-f0-9]{40})/nfts/\d+$'
@@ -313,7 +380,7 @@ ingress:
313380
enabled: true
314381
- path: /api/v1/tokens
315382
enabled: true
316-
# Topic Message Endpoints
383+
# Topics
317384
- path: '/api/v1/topics/\d+\.\d+\.\d+/messages/\d+$'
318385
enabled: true
319386
- path: '/api/v1/topics/\d+\.\d+\.\d+/messages$'

0 commit comments

Comments
 (0)