django-cfg 1.4.74__py3-none-any.whl → 1.4.75__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.
Potentially problematic release.
This version of django-cfg might be problematic. Click here for more details.
- django_cfg/__init__.py +1 -1
- django_cfg/apps/api/health/drf_views.py +27 -0
- django_cfg/core/generation/integration_generators/api.py +6 -0
- django_cfg/middleware/authentication.py +27 -0
- django_cfg/pyproject.toml +1 -1
- {django_cfg-1.4.74.dist-info → django_cfg-1.4.75.dist-info}/METADATA +1 -1
- {django_cfg-1.4.74.dist-info → django_cfg-1.4.75.dist-info}/RECORD +10 -10
- {django_cfg-1.4.74.dist-info → django_cfg-1.4.75.dist-info}/WHEEL +0 -0
- {django_cfg-1.4.74.dist-info → django_cfg-1.4.75.dist-info}/entry_points.txt +0 -0
- {django_cfg-1.4.74.dist-info → django_cfg-1.4.75.dist-info}/licenses/LICENSE +0 -0
django_cfg/__init__.py
CHANGED
|
@@ -111,6 +111,9 @@ class DRFHealthCheckView(APIView):
|
|
|
111
111
|
"quick_health": request.build_absolute_uri(reverse('django_cfg_drf_quick_health')),
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
+
# Add OpenAPI schema links
|
|
115
|
+
health_data["links"]["openapi_schemas"] = self._get_openapi_schema_links(request)
|
|
116
|
+
|
|
114
117
|
# Return appropriate HTTP status
|
|
115
118
|
http_status = status.HTTP_200_OK
|
|
116
119
|
if health_data["status"] == "unhealthy":
|
|
@@ -200,6 +203,30 @@ class DRFHealthCheckView(APIView):
|
|
|
200
203
|
"error": str(e)
|
|
201
204
|
}
|
|
202
205
|
|
|
206
|
+
def _get_openapi_schema_links(self, request) -> Dict[str, str]:
|
|
207
|
+
"""Get OpenAPI schema links for all configured groups."""
|
|
208
|
+
try:
|
|
209
|
+
from django_cfg.modules.django_client.core import get_openapi_service
|
|
210
|
+
|
|
211
|
+
service = get_openapi_service()
|
|
212
|
+
|
|
213
|
+
if not service.config or not service.is_enabled():
|
|
214
|
+
return {}
|
|
215
|
+
|
|
216
|
+
schema_links = {}
|
|
217
|
+
for group_name in service.get_group_names():
|
|
218
|
+
try:
|
|
219
|
+
schema_url_name = f'openapi-schema-{group_name}'
|
|
220
|
+
schema_links[group_name] = request.build_absolute_uri(reverse(schema_url_name))
|
|
221
|
+
except Exception:
|
|
222
|
+
# Skip if URL name doesn't exist
|
|
223
|
+
continue
|
|
224
|
+
|
|
225
|
+
return schema_links
|
|
226
|
+
|
|
227
|
+
except Exception:
|
|
228
|
+
return {}
|
|
229
|
+
|
|
203
230
|
def _check_system_resources(self) -> Dict[str, Any]:
|
|
204
231
|
"""Check system resource usage."""
|
|
205
232
|
try:
|
|
@@ -219,6 +219,12 @@ class APIFrameworksGenerator:
|
|
|
219
219
|
Returns:
|
|
220
220
|
Dictionary with Spectacular settings
|
|
221
221
|
"""
|
|
222
|
+
# Import authentication extension to register it with drf-spectacular
|
|
223
|
+
try:
|
|
224
|
+
from django_cfg.middleware import authentication # noqa: F401
|
|
225
|
+
except ImportError:
|
|
226
|
+
pass
|
|
227
|
+
|
|
222
228
|
# Check if Spectacular settings exist (from OpenAPI Client or elsewhere)
|
|
223
229
|
if not hasattr(self, '_has_spectacular_settings'):
|
|
224
230
|
return {}
|
|
@@ -16,6 +16,33 @@ logger = logging.getLogger(__name__)
|
|
|
16
16
|
User = get_user_model()
|
|
17
17
|
|
|
18
18
|
|
|
19
|
+
# Register OpenAPI extension for drf-spectacular
|
|
20
|
+
try:
|
|
21
|
+
from drf_spectacular.extensions import OpenApiAuthenticationExtension
|
|
22
|
+
|
|
23
|
+
class JWTAuthenticationWithLastLoginScheme(OpenApiAuthenticationExtension):
|
|
24
|
+
"""
|
|
25
|
+
OpenAPI authentication scheme for JWTAuthenticationWithLastLogin.
|
|
26
|
+
|
|
27
|
+
Registers the authentication scheme with drf-spectacular so it appears
|
|
28
|
+
correctly in the generated OpenAPI schema.
|
|
29
|
+
"""
|
|
30
|
+
target_class = 'django_cfg.middleware.authentication.JWTAuthenticationWithLastLogin'
|
|
31
|
+
name = 'jwtAuth'
|
|
32
|
+
|
|
33
|
+
def get_security_definition(self, auto_schema):
|
|
34
|
+
"""Return JWT Bearer token security definition."""
|
|
35
|
+
return {
|
|
36
|
+
'type': 'http',
|
|
37
|
+
'scheme': 'bearer',
|
|
38
|
+
'bearerFormat': 'JWT',
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
except ImportError:
|
|
42
|
+
# drf-spectacular not installed, skip extension registration
|
|
43
|
+
pass
|
|
44
|
+
|
|
45
|
+
|
|
19
46
|
class JWTAuthenticationWithLastLogin(JWTAuthentication):
|
|
20
47
|
"""
|
|
21
48
|
JWT Authentication that updates last_login on successful authentication.
|
django_cfg/pyproject.toml
CHANGED
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "django-cfg"
|
|
7
|
-
version = "1.4.
|
|
7
|
+
version = "1.4.75"
|
|
8
8
|
description = "Django AI framework with built-in agents, type-safe Pydantic v2 configuration, and 8 enterprise apps. Replace settings.py, validate at startup, 90% less code. Production-ready AI workflows for Django."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
keywords = [ "django", "configuration", "pydantic", "settings", "type-safety", "pydantic-settings", "django-environ", "startup-validation", "ide-autocomplete", "ai-agents", "enterprise-django", "django-settings", "type-safe-config",]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: django-cfg
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.75
|
|
4
4
|
Summary: Django AI framework with built-in agents, type-safe Pydantic v2 configuration, and 8 enterprise apps. Replace settings.py, validate at startup, 90% less code. Production-ready AI workflows for Django.
|
|
5
5
|
Project-URL: Homepage, https://djangocfg.com
|
|
6
6
|
Project-URL: Documentation, https://djangocfg.com
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
django_cfg/README.md,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
django_cfg/__init__.py,sha256=
|
|
2
|
+
django_cfg/__init__.py,sha256=S1h1KwyZdE0iuWBEfVIhzPf3N8noHSKlzkrn6IwOo5k,1620
|
|
3
3
|
django_cfg/apps.py,sha256=72m3uuvyqGiLx6gOfE-BD3P61jddCCERuBOYpxTX518,1605
|
|
4
4
|
django_cfg/config.py,sha256=y4Z3rnYsHBE0TehpwAIPaxr---mkvyKrZGGsNwYso74,1398
|
|
5
5
|
django_cfg/apps/__init__.py,sha256=JtDmEYt1OcleWM2ZaeX0LKDnRQzPOavfaXBWG4ECB5Q,26
|
|
@@ -120,7 +120,7 @@ django_cfg/apps/api/endpoints/urls_list/__init__.py,sha256=aspLNziW0Ys4v-Bbf0lu_
|
|
|
120
120
|
django_cfg/apps/api/endpoints/urls_list/serializers.py,sha256=hhtAM-PkskoJI9JLF7VKMczkJIaz2IkRMAI3r9Lyoks,1955
|
|
121
121
|
django_cfg/apps/api/endpoints/urls_list/views.py,sha256=Z3ULXsv1Vl8m0kpL6JxTTainMD1ZQIAVOX-3FOWjqKQ,7502
|
|
122
122
|
django_cfg/apps/api/health/__init__.py,sha256=ypFUiCo0I9VJpaZ_KqEPPX3-ma_MhRm5U1XYWahUaFI,93
|
|
123
|
-
django_cfg/apps/api/health/drf_views.py,sha256=
|
|
123
|
+
django_cfg/apps/api/health/drf_views.py,sha256=oaKaF5ZPR_lCMH_GyKcNOHX5blbW6nbE8VgpPQS27vA,10237
|
|
124
124
|
django_cfg/apps/api/health/serializers.py,sha256=JuFgWBRsycXsAZjZST33QO5li1z3S19l4xsLJ-ahWP8,1381
|
|
125
125
|
django_cfg/apps/api/health/urls.py,sha256=eCTzgB4rv_H2W0NrixPO6qsh0pT2oUePrYAT5D35QIY,550
|
|
126
126
|
django_cfg/apps/api/health/views.py,sha256=65oA6O3gaz2ECY2SiXlT3n4JpORt0nDufa_10um0nRw,8194
|
|
@@ -555,7 +555,7 @@ django_cfg/core/generation/data_generators/__init__.py,sha256=O7cmt_k34hWRgrdaAz
|
|
|
555
555
|
django_cfg/core/generation/data_generators/cache.py,sha256=bdcbnaDarl_8UQ18gk7bIKrQ9PDZOhpDAVjCEgYVeUU,3840
|
|
556
556
|
django_cfg/core/generation/data_generators/database.py,sha256=mYR2mBvqWU93YP9XUUVlcZaQJtSNeAQ7Dk4Vj6Tu95k,3481
|
|
557
557
|
django_cfg/core/generation/integration_generators/__init__.py,sha256=-H4xlNAp_3yytmAnh7HuGJCloLL7C_WWlEJw3KZt4VY,599
|
|
558
|
-
django_cfg/core/generation/integration_generators/api.py,sha256=
|
|
558
|
+
django_cfg/core/generation/integration_generators/api.py,sha256=X9J7TNG7VX0Yc1An_6Ld50sN6IpJSSNZalfSRjkgbok,10916
|
|
559
559
|
django_cfg/core/generation/integration_generators/sessions.py,sha256=GbRC72Gny4dzj7oTIrbuhYyvhCQBoWI-0GxB8ZHTrEU,1644
|
|
560
560
|
django_cfg/core/generation/integration_generators/tailwind.py,sha256=YgiV5c-l0DDJnMKx6mWcUtH5zyMdewAJXjLDwmHrSuc,1208
|
|
561
561
|
django_cfg/core/generation/integration_generators/tasks.py,sha256=B-oeneUUdvjiE6N5MVC98imptlj4dkAxeoxfv50sbkM,2514
|
|
@@ -615,7 +615,7 @@ django_cfg/management/commands/validate_openapi.py,sha256=CdcoMhtxQhjTL6nCifAYkn
|
|
|
615
615
|
django_cfg/middleware/README.md,sha256=M-SvjLUygS6t_flzG4mcKSCSzU1xAVGvm9Lr3Qbsvn8,13089
|
|
616
616
|
django_cfg/middleware/__init__.py,sha256=EVah9AYIWT3R8inTqPY20oB4xb-KejhwqngM1Z4UrD8,465
|
|
617
617
|
django_cfg/middleware/admin_notifications.py,sha256=EVoXjSLaDz4r-lL5hy6V9sC1BpNF0rKsa-s6L31foRQ,6856
|
|
618
|
-
django_cfg/middleware/authentication.py,sha256=
|
|
618
|
+
django_cfg/middleware/authentication.py,sha256=1deekm3lyAMJ2pK7Usd5q1FtUN1aDq_CGJuZrJuHZtE,6139
|
|
619
619
|
django_cfg/middleware/pagination.py,sha256=xnaFH1olDH_m4ecwpTTUyFWV6jKoF6IxJvagSZSJR0E,8603
|
|
620
620
|
django_cfg/middleware/public_endpoints.py,sha256=p-VCjeu0k7B4OuQIe2OVUx7Onh9gsM2HweWcYNxEaRA,6775
|
|
621
621
|
django_cfg/middleware/user_activity.py,sha256=bgftHXXeGBS-jCa8mLzTx4Gcz2fHTaQz_nbRCR5Yqio,5980
|
|
@@ -1116,9 +1116,9 @@ django_cfg/utils/version_check.py,sha256=WO51J2m2e-wVqWCRwbultEwu3q1lQasV67Mw2aa
|
|
|
1116
1116
|
django_cfg/CHANGELOG.md,sha256=jtT3EprqEJkqSUh7IraP73vQ8PmKUMdRtznQsEnqDZk,2052
|
|
1117
1117
|
django_cfg/CONTRIBUTING.md,sha256=DU2kyQ6PU0Z24ob7O_OqKWEYHcZmJDgzw-lQCmu6uBg,3041
|
|
1118
1118
|
django_cfg/LICENSE,sha256=xHuytiUkSZCRG3N11nk1X6q1_EGQtv6aL5O9cqNRhKE,1071
|
|
1119
|
-
django_cfg/pyproject.toml,sha256=
|
|
1120
|
-
django_cfg-1.4.
|
|
1121
|
-
django_cfg-1.4.
|
|
1122
|
-
django_cfg-1.4.
|
|
1123
|
-
django_cfg-1.4.
|
|
1124
|
-
django_cfg-1.4.
|
|
1119
|
+
django_cfg/pyproject.toml,sha256=iIkejWhKhUWuv1BSqIJP0sgY6dG6mHgeV3r9Mo2dqr4,8164
|
|
1120
|
+
django_cfg-1.4.75.dist-info/METADATA,sha256=aUDyk3MZpCZSjSumnm5F-3-IvNOfe_EzCUhvdLCrPhA,22624
|
|
1121
|
+
django_cfg-1.4.75.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
1122
|
+
django_cfg-1.4.75.dist-info/entry_points.txt,sha256=Ucmde4Z2wEzgb4AggxxZ0zaYDb9HpyE5blM3uJ0_VNg,56
|
|
1123
|
+
django_cfg-1.4.75.dist-info/licenses/LICENSE,sha256=xHuytiUkSZCRG3N11nk1X6q1_EGQtv6aL5O9cqNRhKE,1071
|
|
1124
|
+
django_cfg-1.4.75.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|