<@U04UQ68083H> I have the following access rule de...
# ory-copilot
c
@chilly-king-10285 I have the following access rule defined
Copy code
{
  "id": "ui:partners:public:pages",
  "description": "Partners public pages",
  "upstream": {
    "url": "<http://ol-bff:3000>",
    "preserve_host": false
  },
  "match": {
    "url": "<{<http://localhost:4455>,<https://mylo.ol.dev.internal.btechlabs.io>}>/partner/<{login,resetPassword,resetPasswordSuccess,forgetPassword,activate,register,cashier/register}{/,}>",
    "methods": [
      "GET",
      "POST"
    ]
  },
  "authenticators": [
    {
      "handler": "bearer_token"
    },
    {
      "handler": "cookie_session"
    }
  ],
  "authorizer": {
    "handler": "remote_json",
    "config": {
      "remote": "<http://mylo-iam-keto-read:4466/relation-tuples/check>",
      "payload": "{\"namespace\":\"RelationshipManager\",\"object\":\"b_labs\",\"relation\":\"createPartner\",\"subject_set.namespace\":\"User\",\"subject_set.object\":\"{{print.Subject}}\",\"subject_set.relation\":\"members\"}"
    }
  },
  "mutators": [
    {
      "handler": "noop"
    }
  ],
  "errors": []
}
The "authorizer" section is giving an error "wrong number of args for print: want 1 got 0", Can you spot the issue with the "remote_json" payload?
c
A message from kapa.ai
The error message "wrong number of args for print: want 1 got 0" suggests that the
print
function in your
remote_json
payload is expecting an argument but isn't receiving one. In your payload:
Copy code
json "payload": "{\"namespace\":\"RelationshipManager\",\"object\":\"b_labs\",\"relation\":\"createPartner\",\"subject_set.namespace\":\"User\",\"subject_set.object\":\"{{print.Subject}}\",\"subject_set.relation\":\"members\"}"
The
print
function is used like
{{print .Subject}}
. This function is used to print the value of the
Subject
field from the
AuthenticationSession
object. If the
Subject
field is not available in the
AuthenticationSession
object or is not being passed correctly, you might encounter this error. Ensure that the
Subject
field is available and correctly passed to the
print
function. If the issue persists, you might want to check the Ory Oathkeeper documentation or seek help from the Ory community. For more details, refer to the [Ory documentation](https://www.ory.sh/docs/oathkeeper/pipeline/authz).