django-bolt 0.1.0__cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.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-bolt might be problematic. Click here for more details.
- django_bolt/__init__.py +147 -0
- django_bolt/_core.abi3.so +0 -0
- django_bolt/admin/__init__.py +25 -0
- django_bolt/admin/admin_detection.py +179 -0
- django_bolt/admin/asgi_bridge.py +267 -0
- django_bolt/admin/routes.py +91 -0
- django_bolt/admin/static.py +155 -0
- django_bolt/admin/static_routes.py +111 -0
- django_bolt/api.py +1011 -0
- django_bolt/apps.py +7 -0
- django_bolt/async_collector.py +228 -0
- django_bolt/auth/README.md +464 -0
- django_bolt/auth/REVOCATION_EXAMPLE.md +391 -0
- django_bolt/auth/__init__.py +84 -0
- django_bolt/auth/backends.py +236 -0
- django_bolt/auth/guards.py +224 -0
- django_bolt/auth/jwt_utils.py +212 -0
- django_bolt/auth/revocation.py +286 -0
- django_bolt/auth/token.py +335 -0
- django_bolt/binding.py +363 -0
- django_bolt/bootstrap.py +77 -0
- django_bolt/cli.py +133 -0
- django_bolt/compression.py +104 -0
- django_bolt/decorators.py +159 -0
- django_bolt/dependencies.py +128 -0
- django_bolt/error_handlers.py +305 -0
- django_bolt/exceptions.py +294 -0
- django_bolt/health.py +129 -0
- django_bolt/logging/__init__.py +6 -0
- django_bolt/logging/config.py +357 -0
- django_bolt/logging/middleware.py +296 -0
- django_bolt/management/__init__.py +1 -0
- django_bolt/management/commands/__init__.py +0 -0
- django_bolt/management/commands/runbolt.py +427 -0
- django_bolt/middleware/__init__.py +32 -0
- django_bolt/middleware/compiler.py +131 -0
- django_bolt/middleware/middleware.py +247 -0
- django_bolt/openapi/__init__.py +23 -0
- django_bolt/openapi/config.py +196 -0
- django_bolt/openapi/plugins.py +439 -0
- django_bolt/openapi/routes.py +152 -0
- django_bolt/openapi/schema_generator.py +581 -0
- django_bolt/openapi/spec/__init__.py +68 -0
- django_bolt/openapi/spec/base.py +74 -0
- django_bolt/openapi/spec/callback.py +24 -0
- django_bolt/openapi/spec/components.py +72 -0
- django_bolt/openapi/spec/contact.py +21 -0
- django_bolt/openapi/spec/discriminator.py +25 -0
- django_bolt/openapi/spec/encoding.py +67 -0
- django_bolt/openapi/spec/enums.py +41 -0
- django_bolt/openapi/spec/example.py +36 -0
- django_bolt/openapi/spec/external_documentation.py +21 -0
- django_bolt/openapi/spec/header.py +132 -0
- django_bolt/openapi/spec/info.py +50 -0
- django_bolt/openapi/spec/license.py +28 -0
- django_bolt/openapi/spec/link.py +66 -0
- django_bolt/openapi/spec/media_type.py +51 -0
- django_bolt/openapi/spec/oauth_flow.py +36 -0
- django_bolt/openapi/spec/oauth_flows.py +28 -0
- django_bolt/openapi/spec/open_api.py +87 -0
- django_bolt/openapi/spec/operation.py +105 -0
- django_bolt/openapi/spec/parameter.py +147 -0
- django_bolt/openapi/spec/path_item.py +78 -0
- django_bolt/openapi/spec/paths.py +27 -0
- django_bolt/openapi/spec/reference.py +38 -0
- django_bolt/openapi/spec/request_body.py +38 -0
- django_bolt/openapi/spec/response.py +48 -0
- django_bolt/openapi/spec/responses.py +44 -0
- django_bolt/openapi/spec/schema.py +678 -0
- django_bolt/openapi/spec/security_requirement.py +28 -0
- django_bolt/openapi/spec/security_scheme.py +69 -0
- django_bolt/openapi/spec/server.py +34 -0
- django_bolt/openapi/spec/server_variable.py +32 -0
- django_bolt/openapi/spec/tag.py +32 -0
- django_bolt/openapi/spec/xml.py +44 -0
- django_bolt/pagination.py +669 -0
- django_bolt/param_functions.py +49 -0
- django_bolt/params.py +337 -0
- django_bolt/request_parsing.py +128 -0
- django_bolt/responses.py +214 -0
- django_bolt/router.py +48 -0
- django_bolt/serialization.py +193 -0
- django_bolt/status_codes.py +321 -0
- django_bolt/testing/__init__.py +10 -0
- django_bolt/testing/client.py +274 -0
- django_bolt/testing/helpers.py +93 -0
- django_bolt/tests/__init__.py +0 -0
- django_bolt/tests/admin_tests/__init__.py +1 -0
- django_bolt/tests/admin_tests/conftest.py +6 -0
- django_bolt/tests/admin_tests/test_admin_with_django.py +278 -0
- django_bolt/tests/admin_tests/urls.py +9 -0
- django_bolt/tests/cbv/__init__.py +0 -0
- django_bolt/tests/cbv/test_class_views.py +570 -0
- django_bolt/tests/cbv/test_class_views_django_orm.py +703 -0
- django_bolt/tests/cbv/test_class_views_features.py +1173 -0
- django_bolt/tests/cbv/test_class_views_with_client.py +622 -0
- django_bolt/tests/conftest.py +165 -0
- django_bolt/tests/test_action_decorator.py +399 -0
- django_bolt/tests/test_auth_secret_key.py +83 -0
- django_bolt/tests/test_decorator_syntax.py +159 -0
- django_bolt/tests/test_error_handling.py +481 -0
- django_bolt/tests/test_file_response.py +192 -0
- django_bolt/tests/test_global_cors.py +172 -0
- django_bolt/tests/test_guards_auth.py +441 -0
- django_bolt/tests/test_guards_integration.py +303 -0
- django_bolt/tests/test_health.py +283 -0
- django_bolt/tests/test_integration_validation.py +400 -0
- django_bolt/tests/test_json_validation.py +536 -0
- django_bolt/tests/test_jwt_auth.py +327 -0
- django_bolt/tests/test_jwt_token.py +458 -0
- django_bolt/tests/test_logging.py +837 -0
- django_bolt/tests/test_logging_merge.py +419 -0
- django_bolt/tests/test_middleware.py +492 -0
- django_bolt/tests/test_middleware_server.py +230 -0
- django_bolt/tests/test_model_viewset.py +323 -0
- django_bolt/tests/test_models.py +24 -0
- django_bolt/tests/test_pagination.py +1258 -0
- django_bolt/tests/test_parameter_validation.py +178 -0
- django_bolt/tests/test_syntax.py +626 -0
- django_bolt/tests/test_testing_utilities.py +163 -0
- django_bolt/tests/test_testing_utilities_simple.py +123 -0
- django_bolt/tests/test_viewset_unified.py +346 -0
- django_bolt/typing.py +273 -0
- django_bolt/views.py +1110 -0
- django_bolt-0.1.0.dist-info/METADATA +629 -0
- django_bolt-0.1.0.dist-info/RECORD +128 -0
- django_bolt-0.1.0.dist-info/WHEEL +4 -0
- django_bolt-0.1.0.dist-info/entry_points.txt +2 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from typing import TYPE_CHECKING
|
|
5
|
+
|
|
6
|
+
from .base import BaseSchemaObject
|
|
7
|
+
|
|
8
|
+
if TYPE_CHECKING:
|
|
9
|
+
from .header import OpenAPIHeader
|
|
10
|
+
from .link import Link
|
|
11
|
+
from .media_type import OpenAPIMediaType
|
|
12
|
+
from .reference import Reference
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
__all__ = ("OpenAPIResponse",)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@dataclass
|
|
19
|
+
class OpenAPIResponse(BaseSchemaObject):
|
|
20
|
+
"""Describes a single response from an API Operation, including design-time, static ``links`` to operations based on
|
|
21
|
+
the response.
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
description: str
|
|
25
|
+
"""**REQUIRED**. A short description of the response.
|
|
26
|
+
`CommonMark syntax <https://spec.commonmark.org/>`_ MAY be used for rich text representation.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
headers: dict[str, OpenAPIHeader | Reference] | None = None
|
|
30
|
+
"""Maps a header name to its definition.
|
|
31
|
+
`RFC7230 <https://tools.ietf.org/html/rfc7230#page-22>`_ states header names are case insensitive.
|
|
32
|
+
If a response header is defined with the name ``Content-Type``, it SHALL be ignored.
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
content: dict[str, OpenAPIMediaType] | None = None
|
|
36
|
+
"""A map containing descriptions of potential response payloads. The key is a media type or
|
|
37
|
+
`media type range <https://tools.ietf.org/html/rfc7231#appendix-D>`_ and the value describes it.
|
|
38
|
+
|
|
39
|
+
For responses that match multiple keys, only the most specific key is applicable. e.g. ``text/plain`` overrides
|
|
40
|
+
``text/*``
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
links: dict[str, Link | Reference] | None = None
|
|
44
|
+
"""A map of operations links that can be followed from the response.
|
|
45
|
+
|
|
46
|
+
The key of the map is a short name for the link, following the naming constraints of the names for
|
|
47
|
+
`Component Objects <https://spec.openapis.org/oas/v3.1.0#componentsObject>`_.
|
|
48
|
+
"""
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING, Union
|
|
4
|
+
|
|
5
|
+
if TYPE_CHECKING:
|
|
6
|
+
from .reference import Reference
|
|
7
|
+
from .response import OpenAPIResponse
|
|
8
|
+
|
|
9
|
+
Responses = dict[str, Union["OpenAPIResponse", "Reference"]]
|
|
10
|
+
"""A container for the expected responses of an operation. The container maps a
|
|
11
|
+
HTTP response code to the expected response.
|
|
12
|
+
|
|
13
|
+
The documentation is not necessarily expected to cover all possible HTTP response codes because they may not be known in
|
|
14
|
+
advance. However, documentation is expected to cover a successful operation response and any known errors.
|
|
15
|
+
|
|
16
|
+
The ``default`` MAY be used as a default response object for all HTTP codes hat are not covered individually by the
|
|
17
|
+
specification.
|
|
18
|
+
|
|
19
|
+
The ``Responses Object`` MUST contain at least one response code, and it SHOULD be the response for a successful
|
|
20
|
+
operation call.
|
|
21
|
+
|
|
22
|
+
Fixed Fields
|
|
23
|
+
|
|
24
|
+
default: ``Optional[Union[Response, Reference]]``
|
|
25
|
+
|
|
26
|
+
The documentation of responses other than the ones declared for specific HTTP response codes. Use this field to cover
|
|
27
|
+
undeclared responses. A `Reference Object <https://spec.openapis.org/oas/v3.1.0#referenceObject>`_ can link to a
|
|
28
|
+
response that the `OpenAPI Object's components/responses <https://spec.openapis.org/oas/v3.1.0#componentsResponses>`_
|
|
29
|
+
section defines.
|
|
30
|
+
|
|
31
|
+
Patterned Fields
|
|
32
|
+
{httpStatusCode}: ``Optional[Union[Response, Reference]]``
|
|
33
|
+
|
|
34
|
+
Any `HTTP status code <https://spec.openapis.org/oas/v3.1.0#httpCodes>`_ can be used as the property name, but only one
|
|
35
|
+
property per code, to describe the expected response for that HTTP status code.
|
|
36
|
+
|
|
37
|
+
A `Reference Object <https://spec.openapis.org/oas/v3.1.0#referenceObject>`_ can link to a response that is defined in
|
|
38
|
+
the `OpenAPI Object's components/responses <https://spec.openapis.org/oas/v3.1.0#componentsResponses>`_ section. This
|
|
39
|
+
field MUST be enclosed in quotation marks (for example, ``200``) for compatibility between JSON and YAML. To define a
|
|
40
|
+
range of response codes, this field MAY contain the uppercase wildcard character ``X``. For example, ``2XX`` represents
|
|
41
|
+
all response codes between ``[200-299]``. Only the following range definitions are allowed: ``1XX``, ``2XX``, ``3XX``,
|
|
42
|
+
``4XX``, and ``5XX``. If a response is defined using an explicit code, the explicit code definition takes precedence
|
|
43
|
+
over the range definition for that code.
|
|
44
|
+
"""
|