brief-needle-89506
07/08/2024, 7:16 PMchilly-king-10285
07/08/2024, 7:16 PMchilly-king-10285
07/08/2024, 7:16 PMketo_engine_acp_ory
access rule example. In the "match" section of the rule, a regular expression is used to match the URL of the object. Here is the example: json { "id": "some-id", "upstream": { "url": "<http://my-backend-service>" }, "match": { "url": "<http://my-app/api/users/<[0-9]+>/<[a-zA-Z]+>>", "methods": [ "GET" ] }, "authenticators": [ { "handler": "anonymous" } ], "authorizer": { "handler": "keto_engine_acp_ory", "config": { "required_action": "my:action:$1", "required_resource": "my:resource:$2:foo:$1", "subject": "{{ .Extra.email }}", "flavor": "exact" } }, "mutators": [ { "handler": "noop" } ] }
In this example, the "url" in the "match" section is a regular expression that matches URLs of the form <http://my-app/api/users/<[0-9]+>/<[a-zA-Z]+>>
. This means it will match any URL that starts with <http://my-app/api/users/>
, followed by one or more digits, a slash, and one or more letters. You can modify this regular expression to match the specific pattern you need for your object. [Source](https://www.ory.sh/docs/oathkeeper/pipeline/authz#keto_engine_acp_ory-access-rule-example)brief-needle-89506
07/08/2024, 7:18 PMchilly-king-10285
07/08/2024, 7:18 PMchilly-king-10285
07/08/2024, 7:19 PM