Search code examples
optimizationwso2xacmlpdp

Wso2 bulk PDP query


Is there some option in wso2 PDP for making a single request for a sum of resources?

I think that having something like that can really improve the performance instead of asking the PDP every time. It would be great if I could make a single request and get all the access rights for a single user.


Solution

  • So i found that there is an endpoint /entitled-attribs. You can find it in the docs .

    So the description says Get entitled attributes for a given set of parameters.

    You can post other parameters as well but by posting something like :

    {
        "subjectName":"somename"
    }
    

    you can get a response of the resources and the actions that the user can do :

    {
    "entitledResultSetDTO": {
        "entitledAttributesDTOs": [
            {
                "resourceName": "SomeResource_Name",
                "action": "some_action_on_the_resource",
                "environment": null,
                "allActions": false,
                "allResources": false,
                "attributeDTOs": []
            },
            {
                "resourceName": "SomeOtherResource_Name",
                "action": "some_other_action_on_the_resource",
                "environment": null,
                "allActions": false,
                "allResources": false,
                "attributeDTOs": []
            }
        ],
        "advanceResult": false,
        "message": null,
        "messageType": null
    }
    

    And from here on we can just parse this response depending on our needs.