oathkeeper icon indicating copy to clipboard operation
oathkeeper copied to clipboard

Support working with query string and JSON body

Open renom opened this issue 2 years ago • 6 comments

Preflight checklist

Describe your problem

Support working with query string and JSON body

Describe your ideal solution

  1. Mutating and hydrating query string and JSON body (e.g. adding/replacing/removing a query string parameter or a JSON body path)
  2. Extracting data from query string and JSON body for keto_engine_acp_ory (e.g. data from a query string parameter or a JSON body path)
  3. Support autherizer rules for query string parameters and JSON body paths (e.g. allowing or disallowing specific values)

Workarounds or alternatives

Version

Additional Context

No response

renom avatar May 18 '22 07:05 renom

Any updates on that? It seems like #843 is related to this. We are more interesting in query params right now, will a PR will be accepted here?

omerlh avatar Sep 18 '22 06:09 omerlh

I found a workaround for query params:

{{ .MatchContext.URL.Query.Get \"a\" }}

No code change is requires in oathkeeper to support it, just the power of Go templates 💪

omerlh avatar Sep 20 '22 06:09 omerlh

I found a workaround for query params:

{{ .MatchContext.URL.Query.Get \"a\" }}

No code change is requires in oathkeeper to support it, just the power of Go templates muscle

Like this idea: @omerlh Did you find any issues with this at scale?

ViswanathB avatar Nov 08 '22 21:11 ViswanathB

Nope, this working pretty well for us

omerlh avatar Nov 09 '22 05:11 omerlh

Have you had a chance to get the way how to extract some values from original request body?

denysandriyanov avatar Sep 15 '23 14:09 denysandriyanov

If you use the remote authorizer the full request body is sent to this service so you can use the request body for authZ. We built a small service that handle authZ so it also handles this part.

omerlh avatar Sep 18 '23 04:09 omerlh