Replies: 1 comment
-
|
Hello @jjhwan-h you are right decision logic relies exclusively on HTTP status codes (200/403). some questions on this proposal:
assumptions to validate
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Background
We use the remote_json authorizer to delegate authorization decisions to an external authorization service.
Some authorization services always return 200 OK with a JSON body (e.g., {"result": true|false}) and do not signal allow/deny via status codes.
Current behavior
remote_json determines the decision solely from the upstream HTTP status code.
200 OK → allow
403 Forbidden → deny
Therefore, with services that follow the “200 + body value” pattern, direct integration is difficult without a middle adapter.
Request
Please add an option to derive allow/deny from a specific field in the response body.
Example: Using JSONPath/template, allow if $.result == true, otherwise deny
Optionally, allow mapping extra fields like reason/headers to control error messages/headers.
Example (reference) — External auth service(e.g. OPA) that only changes the body, not the status code
Allow response:
Deny response:
Beta Was this translation helpful? Give feedback.
All reactions