Skip to content

Provide more documentation about Oathkeeper URL matching #2395

@shestakov-dev

Description

@shestakov-dev

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    featNew feature or request.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions