-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: supprot OPA plugin complex response #5779
Conversation
53d5b57
to
4954a7d
Compare
SummaryThe OPA plugin is enhanced in this PR to support overriding the status code, request header and request body in case of a failed check.
DescriptionA response containing the following can be sent to APISIX in the OPA policy. {
"result": {
"allow": false,
"status_code": 302,
"headers": {
"Location": "http://example.com/auth"
},
"reason": {
"test": "test"
}
}
} The status code, response header, and reason are all optional respectively, and the reason can be a string or object, and the plugin will automatically JSON encode according to the data type. |
ping @shuaijinchao PTAL thanks |
2574bbb
to
d3d1b39
Compare
👏 |
What this PR does / why we need it:
Enhance OPA plug-in functionality to support overwriting of status codes, response headers, and response bodies when validation is rejected.
stage 2 of #5714
Pre-submission checklist: