Skip to content

Forwarded user role assignments GET request has user filter array collapsed to single value #299

@Laukei

Description

@Laukei

Hello! 👋 I've discovered what looks like an issue with forwarding on requests to the facts router, where it collapses the input user filtering to a single value. It may affect other filters - I've only tested user though. The result of this is that a request for users user_1 and user_2 filters to only return user_2.

From the code I can see that when I send a request to the PDP which it hasn't explicitly got a local implementation for, it forwards it on to the cloud with a log it's doing this.

For the functionality I am building, I am requesting the detailed list role assignments with a user filter that contains several IDs. The request to the PDP looks like:

GET https://pdp:7000/v2/facts/proj_id/env_id/role_assignments?page=1&per_page=2&tenant=tenant_id&user=user_1&user=user_2

I then see a log in the PDP output:

Forwarding facts request: GET https://api.permit.io/v2/facts/proj_id/env_id/role_assignments?page=1&per_page=2&tenant=tenant_id&user=user_2

It looks like the PDP forwards to the cloud API with only the last value as the user filter. I believe from some limited testing with FastAPI that this is because unless FastAPI is told to expect an array for a particular value, it only uses the last defined value.

In the immediate term I can modify my request to speak directly to the Permit cloud API, but it would be useful to fix this in the PDP.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions