config.handler.yml Maven / Gradle / Ivy
# 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/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