opentdf / platform

Persistent data centric security that extends owner control wherever data travels
BSD 3-Clause Clear License
19 stars 11 forks source link

fix: properly set casbin authz policy #1776

Open strantalis opened 5 days ago

strantalis commented 5 days ago

Proposed Changes

When calling the SetPolicy function it was overwrittng what ever was defined within the yaml configuration. This pr addresses this by changing the current functionality to overwrite the default policy while still allowing the policy in configuration to take precedence.

The pull request also introduces two new fields UsernameClaim and GroupsClaim aligning more with openid based claim names and not keycloak realm roles. The authz policy will pull the username and list of groups and run them through the casbin enforce function now. A user can now scope a policy to a username.

p, strantalis, policy.attributes.*, read, allow

Checklist

Testing Instructions