Skip to content

Commit 73b3100

Browse files
authored
Fix oidcClaimsQuery example (#4048)
1 parent 13a38aa commit 73b3100

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

docs/reference/filters.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2060,7 +2060,11 @@ oidcClaimsQuery("<path>:[<query>]", ...)
20602060
The filter is chained after `oauthOidc*` authentication as it parses the ID token that has been saved in the internal `StateBag` for this request. It validates access control of the requested path against the defined query.
20612061
It accepts one or more arguments, that is a path prefix which is granted access to when the query definition evaluates positive.
20622062
It supports exact matches of keys, key-value pairs, introspecting of arrays or exact and wildcard matching of nested structures.
2063-
The query definition can be one or more queries per path, space delimited. The query syntax is [GJSON](https://github.com/tidwall/gjson/blob/master/SYNTAX.md) with a convenience modifier of `@_` which unfolds to `[@this].#("+arg+")`
2063+
The query definition can be one or more queries per path, space delimited. The query syntax is [GJSON](https://github.com/tidwall/gjson/blob/master/SYNTAX.md) with a convenience modifier of `@_` which unfolds to `[@this].#("+arg+")`.
2064+
2065+
!!! note
2066+
In GJSON [comparison operators](https://github.com/tidwall/gjson/blob/master/SYNTAX.md#queries) (`==`, `!=, `%`, etc.)
2067+
are only supported for arrays.
20642068

20652069
Given following example ID token:
20662070

@@ -2087,7 +2091,7 @@ For above ID token following query definitions would also be positive:
20872091
```
20882092
oidcClaimsQuery("/:email")
20892093
oidcClaimsQuery("/another/path:groups.#[%\"CD-*\"]")
2090-
oidcClaimsQuery("/:name%\"*One\"", "/path:groups.#[%\"*-Test-Users\"] groups.#[==\"Purchasing-Department\"]")
2094+
oidcClaimsQuery("/:[name].#(%\"*One\")", "/path:groups.#(%\"*-Test-Users\") groups.#(==\"Purchasing-Department\")")
20912095
```
20922096

20932097
As of now there is no negative/deny rule possible. The first matching path is evaluated against the defined query/queries and if positive, permitted.

0 commit comments

Comments
 (0)