Does anyone have an example of how oathkeeper can ...
# ory-selfhosting
f
Does anyone have an example of how oathkeeper can extract Ids from paths like "/api/v1/tenant/{tenantId}". I want to use Ory as my permission system but I would need to have this ability as I have a bunch of routes and I need to extract ids from urls
Copy code
- id: "api:tenant:get"
  upstream:
    preserve_host: true
    url: "<http://app-api:80>"
  match:
    url: "<http://127.0.0.1:8080/api/v1/tenant/{tenantId}>"
    methods:
      - GET
  authenticators:
    - handler: cookie_session
  mutators:
    - handler: header
  authorizer:
    handler: remote_json
    config:
      remote: <http://keto:4466/check>
      payload: |
        {
          "subject_id": "{{ print .Subject }}",
          "relation": "read",
          "namespace": "tenant",
          "object": "<TENANTID GOES HERE>"
        }
Ah ok looks like its all with Regex!! match: url: "http://127.0.0.1:8080/api/v1/tenant/<([^/]+)>" {{ printIndex .MatchContext.RegexpCaptureGroups 0 }}
🙌 1