Hi Team, I’m trying to have an Oathkeeper Access R...
# talk-oathkeeper
c
Hi Team, I’m trying to have an Oathkeeper Access Rule which matches everything. I tried this (
"url": "<*>"
) but I get a 404 error stating no rule matched the request.
Copy code
[
        {
            "id": "default-passthrough",
            "match": {
                "url": "<*>",
                "methods": [
                    "DELETE",
                    "GET",
                    "HEAD",
                    "PATCH",
                    "POST",
                    "PUT"
                ]
            },
            "upstream": {
                "url": "<http://127.0.0.1:8080/>"
            },
            // Authenticators, Authorizers, Mutators, etc.
        }
    ]
How would you do such a rule?
1
h
Try setting
Copy code
<.*>
I have it working with
Copy code
match:
        url: "https://<.*>.<http://dev.example.com|dev.example.com><.*>"
c
@happy-morning-85531 I used regexp matching (like you it seems) instead of glob pattern matching and now it works. So
<*>
(glob pattern matching) doesn’t work but
<.*>
(regexp matching) does work. cc @swift-chef-97535 Thank you guys!
h
If you want to use glob pattern matching you have to configure it
Copy code
#
access_rules:
  
  ## Matching strategy ##
  #
  # This an optional field describing matching strategy. Currently supported values are 'glob' and 'regexp'.
  #
  # Default value: regexp
  #
  # One of:
  # - glob
  # - regexp
  # 
  # Examples:
  # - glob
  # 
  # Set this value using environment variables on
  # - Linux/macOS:
  #    $ export ACCESS_RULES_MATCHING_STRATEGY=<value>
  # - Windows Command Line (CMD):
  #    > set ACCESS_RULES_MATCHING_STRATEGY=<value>
  #
  matching_strategy: glob
As you see, the default is regexp
c
It was correctly set to
glob
in my config, but still
<*>
wasn’t working
1
s
“url“: “http//:““<.*>/“ I would try some alternatives like the above. Sorry I csnt test it from my phone @steep-lamp-91158 is the regex dude
c
<.*>
works as expected, I ended up with
http<s?>://<.*>
to be a bit more specific
👍 1