Skip to content
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

[FT-2788]fix opa documents undefined return #4211

Merged
merged 3 commits into from
Aug 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions app/_hub/kong-inc/opa/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,18 @@ params:
default: false
description: |
If set to true, the Kong Gateway Consumer object in use for the current request (if any) is included as input to OPA.
- name: include_body_in_opa_input
required: false
datatype: boolean
default: false
description: |
If set to true, the current requests' request body is included as input to OPA.
- name: include_parsed_json_body_in_opa_input
required: false
datatype: boolean
default: false
description: |
If set to true and the `Content-Type` header of the current request is `application/json`, the request body will be JSON decoded and the decoded struct is included as input to OPA.
---

## Usage
Expand All @@ -95,7 +107,9 @@ Create an `example.rego` file with the following content:
```rego
package example

default allow = false
default allowBoolean = false
default allowDetailed = false


allowBoolean {
header_present
Expand Down Expand Up @@ -140,7 +154,7 @@ curl -XPUT localhost:8181/v1/policies/example --data-binary @example.rego
The above command uses OPA's default port 8181. It could be different for your
setup.

### Set up Kong Gateway
### Set up {{site.base_gateway}}

Set up a Route and Service in {{site.base_gateway}} and then enable the plugin:

Expand Down