fastlifeweb 0.16.1__py3-none-any.whl → 0.16.2__py3-none-any.whl
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.
- fastlife/config/configurator.py +12 -0
- {fastlifeweb-0.16.1.dist-info → fastlifeweb-0.16.2.dist-info}/METADATA +1 -1
- {fastlifeweb-0.16.1.dist-info → fastlifeweb-0.16.2.dist-info}/RECORD +5 -5
- {fastlifeweb-0.16.1.dist-info → fastlifeweb-0.16.2.dist-info}/LICENSE +0 -0
- {fastlifeweb-0.16.1.dist-info → fastlifeweb-0.16.2.dist-info}/WHEEL +0 -0
fastlife/config/configurator.py
CHANGED
@@ -145,6 +145,7 @@ class GenericConfigurator(Generic[TRegistry]):
|
|
145
145
|
str, "type[AbstractSecurityPolicy[Any, TRegistry]]"
|
146
146
|
] = {}
|
147
147
|
|
148
|
+
self._registered_permissions: set[str] = set()
|
148
149
|
self.scanner = venusian.Scanner(fastlife=self)
|
149
150
|
self.include("fastlife.views")
|
150
151
|
self.include("fastlife.middlewares")
|
@@ -153,6 +154,15 @@ class GenericConfigurator(Generic[TRegistry]):
|
|
153
154
|
def _current_router(self) -> Router:
|
154
155
|
return self._routers[self._route_prefix]
|
155
156
|
|
157
|
+
@property
|
158
|
+
def all_registered_permissions(self) -> Sequence[str]:
|
159
|
+
"""
|
160
|
+
Get the list of registered permissions.
|
161
|
+
|
162
|
+
This is usefull for introspection or testing purpose.
|
163
|
+
"""
|
164
|
+
return sorted(self._registered_permissions)
|
165
|
+
|
156
166
|
def build_asgi_app(self) -> FastAPI:
|
157
167
|
"""
|
158
168
|
Build the app after configuration in order to start after beeing configured.
|
@@ -404,6 +414,7 @@ class GenericConfigurator(Generic[TRegistry]):
|
|
404
414
|
"""
|
405
415
|
dependencies: list[DependsType] = []
|
406
416
|
if permission:
|
417
|
+
self._registered_permissions.add(permission)
|
407
418
|
dependencies.append(Depends(check_permission(permission)))
|
408
419
|
|
409
420
|
self._current_router.add_api_route(
|
@@ -465,6 +476,7 @@ class GenericConfigurator(Generic[TRegistry]):
|
|
465
476
|
"""
|
466
477
|
dependencies: list[DependsType] = []
|
467
478
|
if permission:
|
479
|
+
self._registered_permissions.add(permission)
|
468
480
|
dependencies.append(Depends(check_permission(permission)))
|
469
481
|
|
470
482
|
if template:
|
@@ -1666,7 +1666,7 @@ fastlife/components/pydantic_form/Textarea.jinja,sha256=NzfCi5agRUSVcb5RXw0QamM8
|
|
1666
1666
|
fastlife/components/pydantic_form/Union.jinja,sha256=czTska54z9KCZKu-FaycLmOvtH6y6CGUFQ8DHnkjrJk,1461
|
1667
1667
|
fastlife/components/pydantic_form/Widget.jinja,sha256=EXskDqt22D5grpGVwlZA3ndve2Wr_6yQH4qVE9c31Og,397
|
1668
1668
|
fastlife/config/__init__.py,sha256=ThosRIPZ_fpD0exZu-kUC_f8ZNa5KyDlleWMmEHkjEo,448
|
1669
|
-
fastlife/config/configurator.py,sha256
|
1669
|
+
fastlife/config/configurator.py,sha256=-U-se932t95YiIfPD6N-CElWuuqbKP2AKTjJXoajCKE,22385
|
1670
1670
|
fastlife/config/exceptions.py,sha256=2MS2MFgb3mDbtdHEwnC-QYubob3Rl0v8O8y615LY0ds,1180
|
1671
1671
|
fastlife/config/openapiextra.py,sha256=_9rBYeTqB7nVuzvUHMwZU387bTfYFHYLlP05NP0vEDs,513
|
1672
1672
|
fastlife/config/registry.py,sha256=dGcNm7E6WY0x5HZNzo1gBFvGFCWeJj6JFXsJtLax5NU,1347
|
@@ -1707,7 +1707,7 @@ fastlife/testing/__init__.py,sha256=vuqwoNUd3BuIp3fm7nkvmYkIGjIimf5zUGhDkeWrg2s,
|
|
1707
1707
|
fastlife/testing/testclient.py,sha256=BC7lLQ_jc59UmknAKzgRtW9a3cpX_V_QLp9Mg2ScLA8,20546
|
1708
1708
|
fastlife/views/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1709
1709
|
fastlife/views/pydantic_form.py,sha256=ZYOXKudmSqtRvFn5ZY75DOXZVunGXJBKpjh9FJcqu6k,1386
|
1710
|
-
fastlifeweb-0.16.
|
1711
|
-
fastlifeweb-0.16.
|
1712
|
-
fastlifeweb-0.16.
|
1713
|
-
fastlifeweb-0.16.
|
1710
|
+
fastlifeweb-0.16.2.dist-info/LICENSE,sha256=F75xSseSKMwqzFj8rswYU6NWS3VoWOc_gY3fJYf9_LI,1504
|
1711
|
+
fastlifeweb-0.16.2.dist-info/METADATA,sha256=KIJVtDej45kFERanabt_3BzlEywJ274ZpWAHj3BGJm0,3345
|
1712
|
+
fastlifeweb-0.16.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
1713
|
+
fastlifeweb-0.16.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|