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

feat: opa plugins, add the ability to set headers #9704

Closed
chusov opened this issue Jun 20, 2023 · 6 comments · Fixed by #9710
Closed

feat: opa plugins, add the ability to set headers #9704

chusov opened this issue Jun 20, 2023 · 6 comments · Fixed by #9710
Assignees
Labels
discuss wait for update wait for the author's response in this issue/PR

Comments

@chusov
Copy link

chusov commented Jun 20, 2023

Description

opa plugin can set headers if the policy response is false - https://apisix.apache.org/docs/apisix/plugins/opa/#using-custom-response
I would like to be able to set headers for a request if the policy response is true.
Use cases - to send to the backend the status of the policy, the policy name, fields from the JWT token.
The changes are not so big, so I can prepare a MR

@Revolyssup
Copy link
Contributor

@lingsamuel Please assign it to me.

@chusov
Copy link
Author

chusov commented Jun 22, 2023

@Revolyssup
opa can also return:

response_headers_to_add (optional): an object mapping a string header name to a string header value
request_headers_to_remove (optional): is an array of string header names

https://www.openpolicyagent.org/docs/latest/envoy-primer/#output-document

@Revolyssup
Copy link
Contributor

@Revolyssup opa can also return:

response_headers_to_add (optional): an object mapping a string header name to a string header value request_headers_to_remove (optional): is an array of string header names

https://www.openpolicyagent.org/docs/latest/envoy-primer/#output-document

Is this part of your use case?

@chusov
Copy link
Author

chusov commented Jun 22, 2023

Is this part of your use case?

not really) sorry

@lingsamuel lingsamuel moved this to 📋 Backlog in Apache APISIX backlog Jun 26, 2023
@lingsamuel lingsamuel moved this from 📋 Backlog to 👀 In review in Apache APISIX backlog Jun 26, 2023
@Sn0rt
Copy link
Contributor

Sn0rt commented Jul 10, 2023

@Revolyssup pls help me to inspect how the OPA server works. and which HTTP header is must pass to the OPA server

@moonming moonming moved this from 👀 In review to 🏗 In progress in Apache APISIX backlog Jul 13, 2023
@moonming moonming added the wait for update wait for the author's response in this issue/PR label Jul 13, 2023
@Revolyssup
Copy link
Contributor

@chusov Will you take a look at this PR to see if it fits your use case? #9710

@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Apache APISIX backlog Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss wait for update wait for the author's response in this issue/PR
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants