Skip to content

gravitee-io/gravitee-policy-interrupt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Interrupt policy

Gravitee.io License Releases CircleCI

Phase

onRequest onResponse onRequestContent onResponseContent

X

X

X

X

Description

Interrupt policy can be used to break the entire request processing in case of a condition (to define on the policy. By default, if no policy condition is defined, the policy will always break request processing).

Breaking the request processing means that no more policy will be executed and no endpoint will be called by the gateway.

By default, the policy will return a response payload to the consumer which is containing the message (see the configuration section).

If you want to override this standard response from the policy, you can define an errorKey which will be then be used to define a Response Template.

Compatibility matrix

Plugin version APIM version AM Version

1.x

3.10.x to 4.5.x

3.10.x to 4.10.x

2.x

4.6.x to latest

4.6.x to latest

Configuration

Property Required Description Type Default

statusCode

-

The HTTP status code of the interruption response

integer

500

errorKey

X

The error Key to use for defining a Response Template

string

-

message

X

Default response template

string

-

variables

-

The variables for Response Template purpose

List of variables

-

Examples

"policy-interrupt": {
    "statusCode": 503,
    "errorKey": "MY_CUSTOM_KEY",
    "message": "You got a problem, sir !",
    "variables": [{
        "name": "custom-variable",
        "value": "{#request.headers['origin']}"
    }]
}

Errors

Default error

Code Message

500

Request processing broken

About

Gravitee Policy - Interrupt

Topics

Resources

License

Contributing

Stars

0 stars

Watchers

16 watching

Forks

Packages

 
 
 

Contributors

Languages