Skip to content

Commit

Permalink
feat: update dependency to use pycasbin Async API (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
BustDot authored Aug 7, 2023
1 parent 0d5d6d0 commit bee7581
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
SQLAlchemy>=1.4.0
asynccasbin
casbin>=1.23.0
2 changes: 2 additions & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
aiosqlite
greenlet
3 changes: 1 addition & 2 deletions tests/test_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async def get_enforcer():
s.add(CasbinRule(ptype="g", v0="alice", v1="data2_admin"))
await s.commit()

e = casbin.Enforcer(get_fixture("rbac_model.conf"), adapter)
e = casbin.AsyncEnforcer(get_fixture("rbac_model.conf"), adapter)
await e.load_policy()
return e

Expand Down Expand Up @@ -371,7 +371,6 @@ async def test_update_policies(self):
self.assertFalse(e.enforce("data2_admin", "data2", "write"))
self.assertTrue(e.enforce("data2_admin", "data_test", "write"))

@unittest.skip('update_filtered_policies not supported by asynccasbin')
async def test_update_filtered_policies(self):
e = await get_enforcer()

Expand Down

0 comments on commit bee7581

Please sign in to comment.