Provide more documentation about Oathkeeper URL matching
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 161
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
Preflight checklist
- I could not find a solution in the existing issues, docs, nor discussions.
- I agree to follow this project's Code of Conduct.
- I have read and am following this repository's Contribution Guidelines.
- I have joined the Ory Community Slack.
- I am signed up to the Ory Security Patch Newsletter.
Ory Network Project
No response
Describe your problem
Hello everyone!
I've been working with Ory for a few months now, integrating it into a project I'm doing. When I started using Oathkeeper I was very confused at first by mainly URL matching - the use of < and > for routes was foreign to me instead of just regular regexes and such.
Recently I noticed that when I use regex groups for routes they seemed to get duplicated. Turns out that when you have a URL matcher in a format such as https://example.org/<(resource1|resource2)> both the () regex group got interpreted and the <> regex as well - turns out that anything you wrap in <> is not just a regex but automatically a group as well (at least from what I observed).
Describe your ideal solution
In my opinion Oathkeeper needs more detailed documentation about regexes - at the very least noting that any <> regex is also a group could prove to be helpful to many people. Another thing that could greatly help in designing Oathkeeper rules would be some kind of regex playground (think regex101.com) that would allow people to use Oathkeeper's regex syntax and get immediate feedback on what URLs match their rules (by providing test strings).
Workarounds or alternatives
This isn't really a bug (at least it doesn't seem like one), just might be useful to note in docs. A workaround to getting duplicate regex groups in places where they overlap could be to use a non-capturing group (?:GROUP). This way when we have overlapping <> and () we only get one regex capture group.
Version
Oathkeeper v0.40.9
Additional Context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing Oathkeeper URL-matching documentation and the examples described in the issue. Document how angle-bracket matchers interact with regex groups and non-capturing groups, then clarify whether the proposed regex playground is part of this documentation task; done means newcomers can understand the matching and capture behavior.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100