ory / ory/docs

Provide more documentation about Oathkeeper URL matching

Open
#2,395 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feat
Dominant language
TypeScript
Stars
161
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

Preflight checklist
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.