Skip to content

Commit

Permalink
fix regex
Browse files Browse the repository at this point in the history
  • Loading branch information
mstingl committed Nov 4, 2023
1 parent 008e5bc commit d0bfb46
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion djfapi/security/jwt.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ async def __call__(self, request: Request, scopes: SecurityScopes) -> Optional[A


class JWTTokenDjangoPermissions(JWTToken):
DJANGO_PERMISSION_REGEX = r"^(?P<service>[_\w]+)\.(?P<action>\w+)_(?P<resource>\w+)(_(?P<selector>.*))?$"
DJANGO_PERMISSION_REGEX = (
r"^(?P<service>[_\w]+)\.(?P<action>[^a-zA-Z0-9]+)_(?P<resource>[^a-zA-Z0-9]+)(_(?P<selector>.*))?$"
)
DJANGO_PERMISSION_ACTION_TO_CRUD = {
'add': 'create',
'view': 'read',
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = djfapi
version = 0.0.72b2
version = 0.0.72b3
author = Manuel Stingl
author_email = opensource@voltane.eu
description = Utilities for use with FastAPI and django
Expand Down

0 comments on commit d0bfb46

Please sign in to comment.