-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhandler.yml
178 lines (159 loc) · 4.71 KB
/
handler.yml
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
# Handler middleware chain configuration
---
enabled: true
# Configuration for the LightHttpHandler. The handler is the base class for all middleware, server and health handlers
# set the Status Object in the AUDIT_INFO, for auditing purposes
# default, if not set:false
auditOnError: ${handler.auditOnError:false}
# set the StackTrace in the AUDIT_INFO, for auditing purposes
# default, if not set:false
auditStackTrace: ${handler.auditStackTrace:false}
# Base Path of the API endpoints
basePath: ${handler.basePath:/}
#------------------------------------------------------------------------------
# Support individual handler chains for each separate endpoint. It allows framework
# handlers like health check, server info to bypass majority of the middleware handlers
# and allows mixing multiple frameworks like OpenAPI and GraphQL in the same instance.
#
# handlers -- list of handlers to be used across chains in this microservice
# including the routing handlers for ALL endpoints
# -- format: fully qualified handler class name@optional:given name
# chains -- allows forming of [1..N] chains, which could be wholly or
# used to form handler chains for each endpoint
# ex.: default chain below, reused partially across multiple endpoints
# paths -- list all the paths to be used for routing within the microservice
# ---- path: the URI for the endpoint (ex.: path: '/v1/pets')
# ---- method: the operation in use (ex.: 'post')
# ---- exec: handlers to be executed -- this element forms the list and
# the order of execution for the handlers
#
# IMPORTANT NOTES:
# - to avoid executing a handler, it has to be removed/commented out in the chain
# or change the enabled:boolean to false for a middleware handler configuration.
# - all handlers, routing handler included, are to be listed in the execution chain
# - for consistency, give a name to each handler; it is easier to refer to a name
# vs a fully qualified class name and is more elegant
# - you can list in chains the fully qualified handler class names, and avoid using the
# handlers element altogether
#------------------------------------------------------------------------------
handlers: ${handler.handlers:}
chains:
default: ${handler.chains.default:}
admin:
- exception
- correlation
- specification
- security
- body
- validator
paths:
- path: '/*'
method: 'GET'
exec:
- default
- path: '/*'
method: 'POST'
exec:
- default
- path: '/*'
method: 'PUT'
exec:
- default
- path: '/*'
method: 'DELETE'
exec:
- default
- path: '/*'
method: 'PATCH'
exec:
- default
- path: '/*'
method: 'OPTIONS'
exec:
- default
# In most case, the /server/info endpoint shouldn't be exposed. If it is, then it must be protected by OAuth 2.0
- path: '/adm/server/info'
method: 'get'
exec:
- admin
- info
# the health endpoint for the proxy itself without security, this for both Kubernetes liveness and readiness.
- path: '/health'
method: 'get'
exec:
- exception
- health
# the health check endpoint called from control plane with security and it will invoke backend optionally.
- path: '/adm/health/${server.serviceId}'
method: 'get'
exec:
- admin
- health
- path: '/adm/logger'
method: 'get'
exec:
- admin
- getLogger
- path: '/adm/logger'
method: 'post'
exec:
- admin
- postLogger
- path: '/adm/logger/content'
method: 'GET'
exec:
- admin
- getLogContents
- path: '/adm/modules'
method: 'get'
exec:
- admin
- modules
- path: '/adm/modules'
method: 'post'
exec:
- admin
- configReload
- path: '/adm/shutdown'
method: 'delete'
exec:
- admin
- shutdown
- path: '/adm/cache/{name}'
method: 'get'
exec:
- admin
- cache
- path: '/adm/chaosmonkey'
method: 'get'
exec:
# enable security once we have this endpoint in the spec with a proper scope.
- admin
- chaosget
- path: '/adm/chaosmonkey/{assault}'
method: 'post'
exec:
# enable security once we have this endpoint in the spec with a proper scope.
- admin
- chaospost
- path: ${handler.oauthTokenPath:/oauth/token}
method: 'post'
exec:
- body
- oauth
- path: ${handler.oauthTokenPath:/oauth/token}
method: 'get'
exec:
- getOauth
- path: '/spec.yaml'
method: 'get'
exec:
- spec
- path: '/specui.html'
method: 'get'
exec:
- swaggerui
- path: '/favicon.ico'
method: 'get'
exec:
- favicon