abs-auth-rbac-core 0.1.15__tar.gz → 0.1.16__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of abs-auth-rbac-core might be problematic. Click here for more details.
- {abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/PKG-INFO +1 -1
- {abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/rbac/service.py +6 -7
- {abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/pyproject.toml +1 -1
- {abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/README.md +0 -0
- {abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/__init__.py +0 -0
- {abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/auth/__init__.py +0 -0
- {abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/auth/auth_functions.py +0 -0
- {abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/auth/jwt_functions.py +0 -0
- {abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/auth/middleware.py +0 -0
- {abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/models/__init__.py +0 -0
- {abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/models/base_model.py +0 -0
- {abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/models/gov_casbin_rule.py +0 -0
- {abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/models/permissions.py +0 -0
- {abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/models/rbac_model.py +0 -0
- {abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/models/role_permission.py +0 -0
- {abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/models/roles.py +0 -0
- {abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/models/seeder/permission_seeder.py +0 -0
- {abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/models/user.py +0 -0
- {abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/models/user_permission.py +0 -0
- {abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/models/user_role.py +0 -0
- {abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/rbac/__init__.py +0 -0
- {abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/rbac/decorator.py +0 -0
- {abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/rbac/policy.conf +0 -0
- {abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/schema/__init__.py +0 -0
- {abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/schema/permission.py +0 -0
- {abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/util/__init__.py +0 -0
- {abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/util/permission_constants.py +0 -0
|
@@ -15,7 +15,9 @@ from ..models import (
|
|
|
15
15
|
Permission,
|
|
16
16
|
UserPermission
|
|
17
17
|
)
|
|
18
|
+
from abs_utils.logger import setup_logger
|
|
18
19
|
|
|
20
|
+
logger = setup_logger(__name__)
|
|
19
21
|
from abs_exception_core.exceptions import (
|
|
20
22
|
DuplicatedError,
|
|
21
23
|
NotFoundError,
|
|
@@ -82,7 +84,6 @@ class RBACService:
|
|
|
82
84
|
|
|
83
85
|
# Test Redis connection
|
|
84
86
|
redis_client.ping()
|
|
85
|
-
print(f"✅ Redis connection established to {redis_config.host}:{redis_config.port}")
|
|
86
87
|
|
|
87
88
|
# Create Watcher and Options
|
|
88
89
|
test_option = WatcherOptions()
|
|
@@ -97,14 +98,12 @@ class RBACService:
|
|
|
97
98
|
self.enforcer.set_watcher(watcher)
|
|
98
99
|
self.watcher = watcher
|
|
99
100
|
self.enforcer.save_policy()
|
|
100
|
-
print(f"✅ Casbin Redis watcher initialized on channel: {redis_config.channel}")
|
|
101
101
|
|
|
102
102
|
except Exception as e:
|
|
103
|
-
|
|
104
|
-
print("⚠️ Casbin will work without Redis watcher (no real-time policy updates)")
|
|
103
|
+
logger.error(f"Failed to initialize Redis watcher: {e}")
|
|
105
104
|
self.watcher = None
|
|
106
105
|
else:
|
|
107
|
-
|
|
106
|
+
logger.info("Redis watcher not configured - Casbin will work without real-time policy updates")
|
|
108
107
|
|
|
109
108
|
def add_policy(self,role:str,resource:str,action:str,module:str):
|
|
110
109
|
"""
|
|
@@ -214,7 +213,7 @@ class RBACService:
|
|
|
214
213
|
self.revoke_user_permissions(user_uuid,list(remove_permissions))
|
|
215
214
|
if add_permissions:
|
|
216
215
|
self.attach_permissions_to_user(user_uuid,list(add_permissions))
|
|
217
|
-
return
|
|
216
|
+
return self.get_user_permissions(user_uuid)
|
|
218
217
|
|
|
219
218
|
def attach_permissions_to_user(self, user_uuid: str, permission_uuids: List[str]):
|
|
220
219
|
with self.db() as session:
|
|
@@ -234,7 +233,7 @@ class RBACService:
|
|
|
234
233
|
if added_policies:
|
|
235
234
|
self.enforcer.save_policy()
|
|
236
235
|
self.enforcer.load_policy()
|
|
237
|
-
return
|
|
236
|
+
return self.get_user_permissions(user_uuid)
|
|
238
237
|
|
|
239
238
|
|
|
240
239
|
def revoke_user_permissions(self, user_uuid: str, permission_uuids: List[str]):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/auth/auth_functions.py
RENAMED
|
File without changes
|
{abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/auth/jwt_functions.py
RENAMED
|
File without changes
|
{abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/auth/middleware.py
RENAMED
|
File without changes
|
{abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/models/__init__.py
RENAMED
|
File without changes
|
{abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/models/base_model.py
RENAMED
|
File without changes
|
{abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/models/gov_casbin_rule.py
RENAMED
|
File without changes
|
{abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/models/permissions.py
RENAMED
|
File without changes
|
{abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/models/rbac_model.py
RENAMED
|
File without changes
|
{abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/models/role_permission.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/models/user_permission.py
RENAMED
|
File without changes
|
{abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/models/user_role.py
RENAMED
|
File without changes
|
|
File without changes
|
{abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/rbac/decorator.py
RENAMED
|
File without changes
|
|
File without changes
|
{abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/schema/__init__.py
RENAMED
|
File without changes
|
{abs_auth_rbac_core-0.1.15 → abs_auth_rbac_core-0.1.16}/abs_auth_rbac_core/schema/permission.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|