Policy path isn't being recognized

I’m trying to set up a new policy. I have a single api called “myapi”. I then create a policy that uses myapi and tries to set the path based permission to /endpoint/subpoint/(.)/something/(.). I then create a catalogue item and set the policy to this.

If I go to /endpoint/subpoint/foo/something/bar then they get access. But if I go to /endpoint2/blah they also get access. So it seems it’s ignoring my path all together. Am I missing something?

If requests are getting through regardless then the regex parser is erroring ( it will tell you so if you check the logs), if it were working all paths would be blocked.

Have you checked if your regex is valid? Running that rx through regexr.com tell me that the slashes need escaping.

It turned out to be a combination of 2 things.

  1. I had my regex wrong. I didn’t need to escape the slash, but I needed to switch the asterisk and the period. You couldn’t see the asterisk in my post because markdown munched it.
  2. I had to add a method. Although it doesn’t say it’s required in the form. It apparently is.

Thank you for the help

1 Like