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

DocFix: Replace http_status with status_code #6729

Conversation

preet-dev
Copy link

Why the changes in this PR are needed?

In the envoy primer doc there are 2 different field names for the optional status_code to be sent when the request is rejected. In the example policy with additional controls it is status_code while in output document it is mentioned as http_status. The former is the correct one.

What are the changes in this PR?

Document change in the envoy policy primer doc to fix the field name for status code to be sent when request is rejected.

Copy link

netlify bot commented May 2, 2024

Deploy Preview for openpolicyagent ready!

Name Link
🔨 Latest commit 9a2de48
🔍 Latest deploy log https://app.netlify.com/sites/openpolicyagent/deploys/6634d9ea3cad310007a06ce0
😎 Deploy Preview https://deploy-preview-6729--openpolicyagent.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Signed-off-by: Manpreet Singh <manpreet.singh@appdynamics.com>
@preet-dev preet-dev force-pushed the fix-envoy-primer-doc-statuscode-field branch from 6c0b8c5 to 1b5171d Compare May 2, 2024 06:25
@johanfylling
Copy link
Contributor

Thank you for your contribution @preet-dev! 😃
Would you mind linking to the relevant envoy documentation specifying status_code as the correct field?

@preet-dev
Copy link
Author

@johanfylling On this section of the doc (https://www.openpolicyagent.org/docs/latest/envoy-primer/#example-policy-with-additional-controls) it is mentioned as status_code which is correct. However, right below that, in the output document section (https://www.openpolicyagent.org/docs/latest/envoy-primer/#output-document) it is mentioned as http_status.

I actually ended up trying with http_status but that did not work so a more thorough read of the page revealed the right answer for me.

@ashutosh-narkar
Copy link
Member

@preet-dev thanks for looking into this. If you notice the result object in https://www.openpolicyagent.org/docs/latest/envoy-primer/#output-document, it mentions that a key called http_status is expected in the policy decision. status_code is just used as a variable name in the example policy but the policy decision object should have a key called http_status. Here is relevant code for reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants