Skip to content

Commit

Permalink
fix: adapter interface stub
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-clan committed Jan 6, 2024
1 parent b3266be commit 920e0ee
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,4 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.idea/
1 change: 1 addition & 0 deletions casbin_async_redis_adapter/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .adapter import CasbinRule, Adapter
8 changes: 5 additions & 3 deletions casbin_async_redis_adapter/adapter.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from casbin import persist
import redis.asyncio as redis
import json

import redis.asyncio as redis
from casbin import persist
from casbin.persist.adapters.asyncio import AsyncAdapter


class CasbinRule:
"""
Expand Down Expand Up @@ -39,7 +41,7 @@ def __repr__(self):
return '<CasbinRule :"{}">'.format(str(self))


class Adapter(persist.Adapter):
class Adapter(AsyncAdapter):
"""the interface for Casbin adapters."""

def __init__(
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
casbin>=1.23.0
redis>=5.0.0
casbin>=1.34.0
redis>=5.0.0
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from setuptools import setup, find_packages, __version__
from os import path

from setuptools import setup, find_packages

desc_file = "README.md"

with open(desc_file, "r") as fh:
Expand Down

0 comments on commit 920e0ee

Please sign in to comment.