fasthtml-auth 0.1.0__tar.gz → 0.1.1__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.
Files changed (23) hide show
  1. {fasthtml_auth-0.1.0 → fasthtml_auth-0.1.1}/CHANGELOG.md +10 -1
  2. {fasthtml_auth-0.1.0/fasthtml_auth.egg-info → fasthtml_auth-0.1.1}/PKG-INFO +1 -1
  3. {fasthtml_auth-0.1.0 → fasthtml_auth-0.1.1}/fasthtml_auth/__init__.py +1 -1
  4. {fasthtml_auth-0.1.0 → fasthtml_auth-0.1.1}/fasthtml_auth/middleware.py +8 -1
  5. {fasthtml_auth-0.1.0 → fasthtml_auth-0.1.1/fasthtml_auth.egg-info}/PKG-INFO +1 -1
  6. {fasthtml_auth-0.1.0 → fasthtml_auth-0.1.1}/pyproject.toml +1 -1
  7. {fasthtml_auth-0.1.0 → fasthtml_auth-0.1.1}/LICENSE +0 -0
  8. {fasthtml_auth-0.1.0 → fasthtml_auth-0.1.1}/MANIFEST.in +0 -0
  9. {fasthtml_auth-0.1.0 → fasthtml_auth-0.1.1}/README.md +0 -0
  10. {fasthtml_auth-0.1.0 → fasthtml_auth-0.1.1}/examples/basic_app.py +0 -0
  11. {fasthtml_auth-0.1.0 → fasthtml_auth-0.1.1}/fasthtml_auth/database.py +0 -0
  12. {fasthtml_auth-0.1.0 → fasthtml_auth-0.1.1}/fasthtml_auth/forms.py +0 -0
  13. {fasthtml_auth-0.1.0 → fasthtml_auth-0.1.1}/fasthtml_auth/init.py +0 -0
  14. {fasthtml_auth-0.1.0 → fasthtml_auth-0.1.1}/fasthtml_auth/manager.py +0 -0
  15. {fasthtml_auth-0.1.0 → fasthtml_auth-0.1.1}/fasthtml_auth/models.py +0 -0
  16. {fasthtml_auth-0.1.0 → fasthtml_auth-0.1.1}/fasthtml_auth/repository.py +0 -0
  17. {fasthtml_auth-0.1.0 → fasthtml_auth-0.1.1}/fasthtml_auth/routes.py +0 -0
  18. {fasthtml_auth-0.1.0 → fasthtml_auth-0.1.1}/fasthtml_auth/utils.py +0 -0
  19. {fasthtml_auth-0.1.0 → fasthtml_auth-0.1.1}/fasthtml_auth.egg-info/SOURCES.txt +0 -0
  20. {fasthtml_auth-0.1.0 → fasthtml_auth-0.1.1}/fasthtml_auth.egg-info/dependency_links.txt +0 -0
  21. {fasthtml_auth-0.1.0 → fasthtml_auth-0.1.1}/fasthtml_auth.egg-info/requires.txt +0 -0
  22. {fasthtml_auth-0.1.0 → fasthtml_auth-0.1.1}/fasthtml_auth.egg-info/top_level.txt +0 -0
  23. {fasthtml_auth-0.1.0 → fasthtml_auth-0.1.1}/setup.cfg +0 -0
@@ -5,7 +5,16 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [0.1.0] - 2024-09-03
8
+ ## [0.1.1] - 2025-09-09
9
+
10
+ ### Fixed
11
+ - Fixed `require_role` decorator to work with functions that don't accept *args, **kwargs
12
+ - Added automatic parameter inspection to handle both single-parameter and multi-parameter route functions
13
+
14
+ ### Changed
15
+ - Improved decorator compatibility with different FastHTML route function signatures
16
+
17
+ ## [0.1.0] - 2025-09-03
9
18
 
10
19
  ### Added
11
20
  - Initial release of FastHTML-Auth
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fasthtml-auth
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: Complete authentication system for FastHTML applications with beautiful UI, role-based access control, and session management
5
5
  Author-email: John Richmond <confusedjohn46@gmail.com>
6
6
  Maintainer-email: John Richmond <confusedjohn46@gmail.com>
@@ -5,7 +5,7 @@ Provides user authentication, session management, role-based access control,
5
5
  and beautiful UI components out of the box.
6
6
  """
7
7
 
8
- __version__ = "0.1.0"
8
+ __version__ = "0.1.1"
9
9
  __author__ = "John Richmond"
10
10
  __email__ = "confusedjohn46@gmail.com"
11
11
 
@@ -1,4 +1,5 @@
1
1
  from fasthtml.common import *
2
+ import inspect
2
3
  from typing import Optional, List
3
4
 
4
5
  class AuthBeforeware:
@@ -98,7 +99,13 @@ class AuthBeforeware:
98
99
  user = req.scope.get('user')
99
100
  if not user or user.role not in allowed_roles:
100
101
  return Response("Forbidden", status_code=403)
101
- return func(req, *args, **kwargs)
102
+
103
+ # Check if function accepts extra args
104
+ sig = inspect.signature(func)
105
+ if len(sig.parameters) == 1: # Only takes req
106
+ return func(req)
107
+ else:
108
+ return func(req, *args, **kwargs)
102
109
  return wrapper
103
110
  return decorator
104
111
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fasthtml-auth
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: Complete authentication system for FastHTML applications with beautiful UI, role-based access control, and session management
5
5
  Author-email: John Richmond <confusedjohn46@gmail.com>
6
6
  Maintainer-email: John Richmond <confusedjohn46@gmail.com>
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "fasthtml-auth"
7
- version = "0.1.0"
7
+ version = "0.1.1"
8
8
  description = "Complete authentication system for FastHTML applications with beautiful UI, role-based access control, and session management"
9
9
  readme = "README.md"
10
10
  license = {file = "LICENSE"}
File without changes
File without changes
File without changes
File without changes