keycloak-nodejs-admin-client icon indicating copy to clipboard operation
keycloak-nodejs-admin-client copied to clipboard

PolicyRepresentation missing roles and groups

Open d-vo opened this issue 4 years ago • 1 comments

Describe the bug

From the current admin console, it is possible to implement role-based policies with the following requests being issued:

{type: "role", logic: "POSITIVE", decisionStrategy: "UNANIMOUS", name: "Test policy",…} decisionStrategy: "UNANIMOUS" logic: "POSITIVE" name: "Test policy" roles: [{id: "dcd91634-b0d2-4656-b68b-a00acc1060fx"}] 0: {id: "dcd91634-b0d2-4656-b68b-a00acc1060fx"} type: "role"

However, the PolicyRepresentation does not specify the field "roles". Based on this API implementation, I can only create user policies. I think it should be straightforward to add the missing fields there and support group and role-based policies.

https://github.com/keycloak/keycloak-nodejs-admin-client/blob/main/src/defs/policyRepresentation.ts

Version

16.0.0

Expected behavior

I should be able to use API to create group and role-based policies.

Actual behavior

I can only create user-based policies due to missing "roles" (and probably "groups") field.

How to Reproduce?

No response

Anything else?

No response

d-vo avatar Dec 19 '21 20:12 d-vo

I see no problem adding this, @d-vo could you link to the appropriate model in the API docs or the source of Keycloak?

jonkoops avatar Dec 23 '21 11:12 jonkoops