casbin / jcasbin

An authorization library that supports access control models like ACL, RBAC, ABAC in Java
https://casbin.org
Apache License 2.0
2.4k stars 464 forks source link

[bug] || replaced with comma in policy fields #430

Closed tpsb closed 1 month ago

tpsb commented 1 month ago

The project I'm working on stores groovy code in one of the policy fields and some of the policies happen to use || operator. Recent versions of jcasbin after loading policies end up with the operator replaced with a comma - this modification breaks the function we have in place which expects to evaluate the value of the field a groovy code and reports Script.groovy: 1: Unexpected input: ',' @ line 1...

The bug was introduced by PR #408 which was an attempt to fix issue #407. The real cause of issue #407, however, was in casbin/jdbc-adapter which didn't escape policy field values read in from the database before parsing the data as a CSV line - this was fixed by PR #74 which ended up in publicly available release of jdbc-adapter version 2.10.0.

Issue #407 does not require changes introduced by PR #408 and as those changes bring in a separate bug (at least in some cases), I'd like to ask for PR #408 be reverted and a new version be released.

casbin-bot commented 1 month ago

@tangyang9464 @imp2002

github-actions[bot] commented 1 month ago

:tada: This issue has been resolved in version 1.68.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: