MatchContext.RegexpCaptureGroups empty with glob Match strategy behavior ? #933
Answered
by
gen1us2k
jeanmichelcraye
asked this question in
Q&A
-
May be I missed something in my rule config but I need to retreive element of the request to forward it to KETO authorizer but... using here under rule with glob : - id: allow-test
upstream:
url: http://host.docker.internal:8080/
preserve_host: true
match:
url: http://localhost:4455/<{*,*/*}>
methods:
- GET
authenticators:
- handler: noop
authorizer:
handler: allow
mutators:
- handler: header
config:
headers:
X-Groups: "{{ printIndex .MatchContext.RegexpCaptureGroups 0 }}"
`
----- Request Start ----->
Method: GET
Path: /foo/bar
Headers:
X-Groups:
X-Header: map[Accept:[*/*] User-Agent:[curl/7.77.0]]
X-Method: GET
X-Url: http://localhost:4455/foo/bar
<----- Request End ----- |
Beta Was this translation helpful? Give feedback.
Answered by
gen1us2k
Mar 8, 2022
Replies: 1 comment 1 reply
-
Yes. You're right. Oathkeeper does not support using .MatchContext.RegexpCaptureGroups using glob matching strategy. oathkeeper/rule/engine_glob.go Line 35 in 69ad28f
Consider using regexp matching strategy |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
vinckr
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes. You're right. Oathkeeper does not support using .MatchContext.RegexpCaptureGroups using glob matching strategy.
oathkeeper/rule/engine_glob.go
Line 35 in 69ad28f
Consider using regexp matching strategy