rn-forge-web 0.3.0__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.
- rn_forge_web-0.3.0/LICENSE +21 -0
- rn_forge_web-0.3.0/PKG-INFO +139 -0
- rn_forge_web-0.3.0/README.md +110 -0
- rn_forge_web-0.3.0/pyproject.toml +82 -0
- rn_forge_web-0.3.0/pyproject.toml.orig +81 -0
- rn_forge_web-0.3.0/src/rn_forge/web/__init__.py +367 -0
- rn_forge_web-0.3.0/src/rn_forge/web/asgi.py +147 -0
- rn_forge_web-0.3.0/src/rn_forge/web/auth.py +115 -0
- rn_forge_web-0.3.0/src/rn_forge/web/concurrency.py +251 -0
- rn_forge_web-0.3.0/src/rn_forge/web/conformance/__init__.py +33 -0
- rn_forge_web-0.3.0/src/rn_forge/web/conformance/cases.py +1890 -0
- rn_forge_web-0.3.0/src/rn_forge/web/conformance/types.py +134 -0
- rn_forge_web-0.3.0/src/rn_forge/web/deprecation.py +37 -0
- rn_forge_web-0.3.0/src/rn_forge/web/exceptions.py +386 -0
- rn_forge_web-0.3.0/src/rn_forge/web/health.py +239 -0
- rn_forge_web-0.3.0/src/rn_forge/web/idempotency.py +296 -0
- rn_forge_web-0.3.0/src/rn_forge/web/merge_patch.py +98 -0
- rn_forge_web-0.3.0/src/rn_forge/web/models.py +24 -0
- rn_forge_web-0.3.0/src/rn_forge/web/openapi.py +176 -0
- rn_forge_web-0.3.0/src/rn_forge/web/operations.py +54 -0
- rn_forge_web-0.3.0/src/rn_forge/web/pagination.py +253 -0
- rn_forge_web-0.3.0/src/rn_forge/web/problem.py +593 -0
- rn_forge_web-0.3.0/src/rn_forge/web/py.typed +0 -0
- rn_forge_web-0.3.0/src/rn_forge/web/read_mask.py +121 -0
- rn_forge_web-0.3.0/src/rn_forge/web/security.py +97 -0
- rn_forge_web-0.3.0/src/rn_forge/web/soft_delete.py +31 -0
- rn_forge_web-0.3.0/src/rn_forge/web/tracing.py +53 -0
- rn_forge_web-0.3.0/src/rn_forge/web/transfer.py +408 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Rohit Narayanan
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rn-forge-web
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Framework-agnostic HTTP/API primitives built on rn-forge-commons
|
|
5
|
+
Author: Rohit Narayanan
|
|
6
|
+
Author-email: Rohit Narayanan <rohit.nn@gmail.com>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
15
|
+
Classifier: Typing :: Typed
|
|
16
|
+
Requires-Dist: rn-forge-commons[pydantic]>=0.8.0,<0.9
|
|
17
|
+
Requires-Dist: opentelemetry-api>=1.44
|
|
18
|
+
Requires-Dist: secure>=2.0.1 ; extra == 'security'
|
|
19
|
+
Requires-Dist: assertpy>=1.1 ; extra == 'testing'
|
|
20
|
+
Requires-Dist: pytest>=9.1.1 ; extra == 'testing'
|
|
21
|
+
Requires-Python: >=3.14
|
|
22
|
+
Project-URL: Documentation, https://rn-forge.github.io/pykit/packages/rn-forge-web/latest/
|
|
23
|
+
Project-URL: Source, https://github.com/rn-forge/pykit/tree/main/packages/rn-forge-web
|
|
24
|
+
Project-URL: Changelog, https://github.com/rn-forge/pykit/blob/main/packages/rn-forge-web/CHANGELOG.md
|
|
25
|
+
Project-URL: Issues, https://github.com/rn-forge/pykit/issues
|
|
26
|
+
Provides-Extra: security
|
|
27
|
+
Provides-Extra: testing
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
|
|
30
|
+
# rn-forge-web
|
|
31
|
+
|
|
32
|
+
[Documentation](https://rn-forge.github.io/pykit/packages/rn-forge-web/latest/)
|
|
33
|
+
·
|
|
34
|
+
[Changelog](https://github.com/rn-forge/pykit/blob/main/packages/rn-forge-web/CHANGELOG.md)
|
|
35
|
+
· [Source](https://github.com/rn-forge/pykit/tree/main/packages/rn-forge-web) ·
|
|
36
|
+
[All pykit packages](https://rn-forge.github.io/pykit/)
|
|
37
|
+
|
|
38
|
+
Framework-agnostic HTTP/API primitives, built on `rn-forge-commons`.
|
|
39
|
+
|
|
40
|
+
These are the wire semantics an application *promises its callers* — W3C Trace
|
|
41
|
+
Context propagation, the error body, the precondition contract, the pagination
|
|
42
|
+
envelope, the idempotency contract, the readiness aggregate, the authentication
|
|
43
|
+
contract, the OpenAPI naming rules, and the conformance table the framework
|
|
44
|
+
packages are tested against.
|
|
45
|
+
|
|
46
|
+
Fourteen flat modules, all one kind of mechanism: **inbound** HTTP wire
|
|
47
|
+
semantics.
|
|
48
|
+
|
|
49
|
+
## Where it sits
|
|
50
|
+
|
|
51
|
+
```text
|
|
52
|
+
commons ──► web ──► auth ──► django
|
|
53
|
+
│ └───► fastapi
|
|
54
|
+
└───► sqlalchemy
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
`rn-forge-web` depends on **`rn-forge-commons` and nothing else in the
|
|
58
|
+
workspace**. It never imports `rn_forge.cli` or `rn_forge.tooling` — those are
|
|
59
|
+
the command-line and file-owning layers, and a package that ships into an ASGI
|
|
60
|
+
server has no business reaching either. It never imports a web framework: not
|
|
61
|
+
`django`, not `fastapi`, not `starlette`, not `rest_framework`.
|
|
62
|
+
|
|
63
|
+
`.importlinter` at the repo root carries the `web-is-framework-free` and
|
|
64
|
+
`web-layers` contracts, and `uv run lint-imports` proves them.
|
|
65
|
+
|
|
66
|
+
## Inbound, not outbound
|
|
67
|
+
|
|
68
|
+
The tempting rule is "everything HTTP lives in `rn-forge-web`", and it is wrong.
|
|
69
|
+
A circuit breaker, a retry policy and a token bucket are transport-agnostic: a
|
|
70
|
+
worker retrying a database call, a CLI retrying a blob upload and an LLM adapter
|
|
71
|
+
backing off all need them, and none of them speaks server-side HTTP. Those live
|
|
72
|
+
in `rn_forge.commons.integration.resilience`, so that an Azure Blob or Key Vault
|
|
73
|
+
adapter package can depend on commons alone rather than dragging ASGI middleware
|
|
74
|
+
and cursor codecs into a process that serves no requests.
|
|
75
|
+
|
|
76
|
+
The one concern that runs the other way is `problem_from_body`, which parses an
|
|
77
|
+
*upstream's* `application/problem+json` back into a `ProblemDetail`. It takes a
|
|
78
|
+
parsed mapping and a status — not a response object — precisely so no HTTP
|
|
79
|
+
client library is pulled in either direction.
|
|
80
|
+
|
|
81
|
+
## What stays in a framework package
|
|
82
|
+
|
|
83
|
+
Logic that both framework packages need lives here, as framework-free functions:
|
|
84
|
+
rendering a problem response (`render_problem`), the field-error entry
|
|
85
|
+
(`field_error`), reading the current trace id, parsing an `Authorization`
|
|
86
|
+
header, requiring an idempotency key, the liveness body and the OpenAPI
|
|
87
|
+
problem-response declarations. `rn-forge-django` and `rn-forge-fastapi` keep
|
|
88
|
+
only the code that reads their framework's native shapes (a DRF error tree, a
|
|
89
|
+
pydantic error list, a Starlette exception) and writes their framework's native
|
|
90
|
+
response.
|
|
91
|
+
|
|
92
|
+
## Installation
|
|
93
|
+
|
|
94
|
+
Require the package by version range:
|
|
95
|
+
|
|
96
|
+
```toml
|
|
97
|
+
dependencies = ["rn-forge-web>=0.3,<0.4"]
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Inside this workspace, `[tool.uv.sources]` overrides the requirement with the
|
|
101
|
+
local checkout; that override is for local development only and does not survive
|
|
102
|
+
into a built wheel.
|
|
103
|
+
|
|
104
|
+
## Dependencies and why
|
|
105
|
+
|
|
106
|
+
**`rn-forge-commons`** — `AppException` (every exception here subclasses it, so
|
|
107
|
+
a consumer already catching that catches these), through its `pydantic` extra.
|
|
108
|
+
|
|
109
|
+
**`pydantic`, through that extra** — `models.py` holds `WireModel`, the
|
|
110
|
+
camelCase base, and `ProblemDetail`, `Page[T]`, `CheckResult` and `HealthReport`
|
|
111
|
+
are `WireModel` subclasses. Both framework packages use them directly: FastAPI
|
|
112
|
+
as request and response models, Django for its OpenAPI components and health
|
|
113
|
+
bodies. `rn-forge-django` therefore installs pydantic transitively.
|
|
114
|
+
|
|
115
|
+
**`secure` (2.0.1), behind this package's own `security` extra** — and only for
|
|
116
|
+
`rn_forge.web.security`. It is framework-agnostic (no dependencies of its own)
|
|
117
|
+
and emits the OWASP REST Security Cheat Sheet header preset exactly, so it is
|
|
118
|
+
wrapped rather than hand-rolled. Behind an extra and excluded from the curated
|
|
119
|
+
`__init__.py` so the rest of the package stays dependency-free; import
|
|
120
|
+
`rn_forge.web.security` directly.
|
|
121
|
+
|
|
122
|
+
**`opentelemetry-api`, a base dependency** — and only for
|
|
123
|
+
`rn_forge.web.tracing`. W3C Trace Context is read through OpenTelemetry's
|
|
124
|
+
active-span API, following OpenTelemetry's own library guidance: a library
|
|
125
|
+
depends on the API only, which is a no-op until the application configures the
|
|
126
|
+
SDK. This package never configures a `TracerProvider` or an exporter.
|
|
127
|
+
|
|
128
|
+
**Nothing else beyond those.** The problem shape, ETag preconditions, cursor
|
|
129
|
+
pagination, idempotency and health aggregation are implemented here: the
|
|
130
|
+
maintained libraries for each either depend on a web framework or fix a
|
|
131
|
+
different wire shape.
|
|
132
|
+
|
|
133
|
+
## Documentation
|
|
134
|
+
|
|
135
|
+
`uv run --directory packages/rn-forge-web --group docs mkdocs build --strict`,
|
|
136
|
+
or the combined site from the repo root. `docs/guides/api-conventions.md` is the
|
|
137
|
+
normative wire contract for an application's specification.
|
|
138
|
+
`docs/guides/model-conventions.md` compares implemented ORM building blocks and
|
|
139
|
+
optional application design advice.
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# rn-forge-web
|
|
2
|
+
|
|
3
|
+
[Documentation](https://rn-forge.github.io/pykit/packages/rn-forge-web/latest/)
|
|
4
|
+
·
|
|
5
|
+
[Changelog](https://github.com/rn-forge/pykit/blob/main/packages/rn-forge-web/CHANGELOG.md)
|
|
6
|
+
· [Source](https://github.com/rn-forge/pykit/tree/main/packages/rn-forge-web) ·
|
|
7
|
+
[All pykit packages](https://rn-forge.github.io/pykit/)
|
|
8
|
+
|
|
9
|
+
Framework-agnostic HTTP/API primitives, built on `rn-forge-commons`.
|
|
10
|
+
|
|
11
|
+
These are the wire semantics an application *promises its callers* — W3C Trace
|
|
12
|
+
Context propagation, the error body, the precondition contract, the pagination
|
|
13
|
+
envelope, the idempotency contract, the readiness aggregate, the authentication
|
|
14
|
+
contract, the OpenAPI naming rules, and the conformance table the framework
|
|
15
|
+
packages are tested against.
|
|
16
|
+
|
|
17
|
+
Fourteen flat modules, all one kind of mechanism: **inbound** HTTP wire
|
|
18
|
+
semantics.
|
|
19
|
+
|
|
20
|
+
## Where it sits
|
|
21
|
+
|
|
22
|
+
```text
|
|
23
|
+
commons ──► web ──► auth ──► django
|
|
24
|
+
│ └───► fastapi
|
|
25
|
+
└───► sqlalchemy
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
`rn-forge-web` depends on **`rn-forge-commons` and nothing else in the
|
|
29
|
+
workspace**. It never imports `rn_forge.cli` or `rn_forge.tooling` — those are
|
|
30
|
+
the command-line and file-owning layers, and a package that ships into an ASGI
|
|
31
|
+
server has no business reaching either. It never imports a web framework: not
|
|
32
|
+
`django`, not `fastapi`, not `starlette`, not `rest_framework`.
|
|
33
|
+
|
|
34
|
+
`.importlinter` at the repo root carries the `web-is-framework-free` and
|
|
35
|
+
`web-layers` contracts, and `uv run lint-imports` proves them.
|
|
36
|
+
|
|
37
|
+
## Inbound, not outbound
|
|
38
|
+
|
|
39
|
+
The tempting rule is "everything HTTP lives in `rn-forge-web`", and it is wrong.
|
|
40
|
+
A circuit breaker, a retry policy and a token bucket are transport-agnostic: a
|
|
41
|
+
worker retrying a database call, a CLI retrying a blob upload and an LLM adapter
|
|
42
|
+
backing off all need them, and none of them speaks server-side HTTP. Those live
|
|
43
|
+
in `rn_forge.commons.integration.resilience`, so that an Azure Blob or Key Vault
|
|
44
|
+
adapter package can depend on commons alone rather than dragging ASGI middleware
|
|
45
|
+
and cursor codecs into a process that serves no requests.
|
|
46
|
+
|
|
47
|
+
The one concern that runs the other way is `problem_from_body`, which parses an
|
|
48
|
+
*upstream's* `application/problem+json` back into a `ProblemDetail`. It takes a
|
|
49
|
+
parsed mapping and a status — not a response object — precisely so no HTTP
|
|
50
|
+
client library is pulled in either direction.
|
|
51
|
+
|
|
52
|
+
## What stays in a framework package
|
|
53
|
+
|
|
54
|
+
Logic that both framework packages need lives here, as framework-free functions:
|
|
55
|
+
rendering a problem response (`render_problem`), the field-error entry
|
|
56
|
+
(`field_error`), reading the current trace id, parsing an `Authorization`
|
|
57
|
+
header, requiring an idempotency key, the liveness body and the OpenAPI
|
|
58
|
+
problem-response declarations. `rn-forge-django` and `rn-forge-fastapi` keep
|
|
59
|
+
only the code that reads their framework's native shapes (a DRF error tree, a
|
|
60
|
+
pydantic error list, a Starlette exception) and writes their framework's native
|
|
61
|
+
response.
|
|
62
|
+
|
|
63
|
+
## Installation
|
|
64
|
+
|
|
65
|
+
Require the package by version range:
|
|
66
|
+
|
|
67
|
+
```toml
|
|
68
|
+
dependencies = ["rn-forge-web>=0.3,<0.4"]
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Inside this workspace, `[tool.uv.sources]` overrides the requirement with the
|
|
72
|
+
local checkout; that override is for local development only and does not survive
|
|
73
|
+
into a built wheel.
|
|
74
|
+
|
|
75
|
+
## Dependencies and why
|
|
76
|
+
|
|
77
|
+
**`rn-forge-commons`** — `AppException` (every exception here subclasses it, so
|
|
78
|
+
a consumer already catching that catches these), through its `pydantic` extra.
|
|
79
|
+
|
|
80
|
+
**`pydantic`, through that extra** — `models.py` holds `WireModel`, the
|
|
81
|
+
camelCase base, and `ProblemDetail`, `Page[T]`, `CheckResult` and `HealthReport`
|
|
82
|
+
are `WireModel` subclasses. Both framework packages use them directly: FastAPI
|
|
83
|
+
as request and response models, Django for its OpenAPI components and health
|
|
84
|
+
bodies. `rn-forge-django` therefore installs pydantic transitively.
|
|
85
|
+
|
|
86
|
+
**`secure` (2.0.1), behind this package's own `security` extra** — and only for
|
|
87
|
+
`rn_forge.web.security`. It is framework-agnostic (no dependencies of its own)
|
|
88
|
+
and emits the OWASP REST Security Cheat Sheet header preset exactly, so it is
|
|
89
|
+
wrapped rather than hand-rolled. Behind an extra and excluded from the curated
|
|
90
|
+
`__init__.py` so the rest of the package stays dependency-free; import
|
|
91
|
+
`rn_forge.web.security` directly.
|
|
92
|
+
|
|
93
|
+
**`opentelemetry-api`, a base dependency** — and only for
|
|
94
|
+
`rn_forge.web.tracing`. W3C Trace Context is read through OpenTelemetry's
|
|
95
|
+
active-span API, following OpenTelemetry's own library guidance: a library
|
|
96
|
+
depends on the API only, which is a no-op until the application configures the
|
|
97
|
+
SDK. This package never configures a `TracerProvider` or an exporter.
|
|
98
|
+
|
|
99
|
+
**Nothing else beyond those.** The problem shape, ETag preconditions, cursor
|
|
100
|
+
pagination, idempotency and health aggregation are implemented here: the
|
|
101
|
+
maintained libraries for each either depend on a web framework or fix a
|
|
102
|
+
different wire shape.
|
|
103
|
+
|
|
104
|
+
## Documentation
|
|
105
|
+
|
|
106
|
+
`uv run --directory packages/rn-forge-web --group docs mkdocs build --strict`,
|
|
107
|
+
or the combined site from the repo root. `docs/guides/api-conventions.md` is the
|
|
108
|
+
normative wire contract for an application's specification.
|
|
109
|
+
`docs/guides/model-conventions.md` compares implemented ORM building blocks and
|
|
110
|
+
optional application design advice.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "rn-forge-web"
|
|
3
|
+
version = "0.3.0"
|
|
4
|
+
description = "Framework-agnostic HTTP/API primitives built on rn-forge-commons"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
license-files = ["LICENSE"]
|
|
8
|
+
classifiers = [
|
|
9
|
+
"Development Status :: 3 - Alpha",
|
|
10
|
+
"Intended Audience :: Developers",
|
|
11
|
+
"Operating System :: OS Independent",
|
|
12
|
+
"Programming Language :: Python :: 3",
|
|
13
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
14
|
+
"Programming Language :: Python :: 3.14",
|
|
15
|
+
"Typing :: Typed",
|
|
16
|
+
]
|
|
17
|
+
requires-python = ">=3.14"
|
|
18
|
+
dependencies = [
|
|
19
|
+
"rn-forge-commons[pydantic]>=0.8.0,<0.9",
|
|
20
|
+
"opentelemetry-api>=1.44",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
[[project.authors]]
|
|
24
|
+
name = "Rohit Narayanan"
|
|
25
|
+
email = "rohit.nn@gmail.com"
|
|
26
|
+
|
|
27
|
+
[project.optional-dependencies]
|
|
28
|
+
testing = [
|
|
29
|
+
"assertpy>=1.1",
|
|
30
|
+
"pytest>=9.1.1",
|
|
31
|
+
]
|
|
32
|
+
security = ["secure>=2.0.1"]
|
|
33
|
+
|
|
34
|
+
[project.urls]
|
|
35
|
+
Documentation = "https://rn-forge.github.io/pykit/packages/rn-forge-web/latest/"
|
|
36
|
+
Source = "https://github.com/rn-forge/pykit/tree/main/packages/rn-forge-web"
|
|
37
|
+
Changelog = "https://github.com/rn-forge/pykit/blob/main/packages/rn-forge-web/CHANGELOG.md"
|
|
38
|
+
Issues = "https://github.com/rn-forge/pykit/issues"
|
|
39
|
+
|
|
40
|
+
[build-system]
|
|
41
|
+
requires = ["uv_build>=0.11.28,<0.12.0"]
|
|
42
|
+
build-backend = "uv_build"
|
|
43
|
+
|
|
44
|
+
[tool.uv.build-backend]
|
|
45
|
+
module-name = "rn_forge.web"
|
|
46
|
+
|
|
47
|
+
[tool.uv.sources.rn-forge-auth]
|
|
48
|
+
workspace = true
|
|
49
|
+
|
|
50
|
+
[tool.uv.sources.rn-forge-commons]
|
|
51
|
+
workspace = true
|
|
52
|
+
|
|
53
|
+
[tool.uv.sources.rn-forge-web]
|
|
54
|
+
workspace = true
|
|
55
|
+
|
|
56
|
+
[tool.pytest.ini_options]
|
|
57
|
+
addopts = "-ra --import-mode=importlib"
|
|
58
|
+
asyncio_mode = "auto"
|
|
59
|
+
markers = ["unit: fast isolated tests"]
|
|
60
|
+
|
|
61
|
+
[dependency-groups]
|
|
62
|
+
dev = [
|
|
63
|
+
"assertpy>=1.1",
|
|
64
|
+
"opentelemetry-instrumentation-asgi>=0.65b0",
|
|
65
|
+
"opentelemetry-sdk>=1.44",
|
|
66
|
+
"pyright>=1.1.411",
|
|
67
|
+
"pytest>=9.1.1",
|
|
68
|
+
"pytest-asyncio>=1.3.0",
|
|
69
|
+
"pytest-cov>=7.1.0",
|
|
70
|
+
"pytest-randomly>=4.1.0",
|
|
71
|
+
"rn-forge-auth>=0.1.0,<0.2",
|
|
72
|
+
"rn-forge-web[security]",
|
|
73
|
+
"ruff>=0.15.21",
|
|
74
|
+
]
|
|
75
|
+
docs = [
|
|
76
|
+
"mkdocs>=1.6.1",
|
|
77
|
+
"mkdocs-material>=9.7.6",
|
|
78
|
+
"mkdocstrings[python]>=1.0.6",
|
|
79
|
+
"opentelemetry-instrumentation-asgi>=0.65b0",
|
|
80
|
+
"rn-forge-auth>=0.1.0,<0.2",
|
|
81
|
+
"rn-forge-web[security]",
|
|
82
|
+
]
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "rn-forge-web"
|
|
3
|
+
version = "0.3.0"
|
|
4
|
+
description = "Framework-agnostic HTTP/API primitives built on rn-forge-commons"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
authors = [{ name = "Rohit Narayanan", email = "rohit.nn@gmail.com" }]
|
|
7
|
+
license = "MIT"
|
|
8
|
+
license-files = ["LICENSE"]
|
|
9
|
+
classifiers = [
|
|
10
|
+
"Development Status :: 3 - Alpha",
|
|
11
|
+
"Intended Audience :: Developers",
|
|
12
|
+
"Operating System :: OS Independent",
|
|
13
|
+
"Programming Language :: Python :: 3",
|
|
14
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
15
|
+
"Programming Language :: Python :: 3.14",
|
|
16
|
+
"Typing :: Typed",
|
|
17
|
+
]
|
|
18
|
+
requires-python = ">=3.14"
|
|
19
|
+
# Internal requirements are version ranges (ADR-0004).
|
|
20
|
+
#
|
|
21
|
+
# Beyond commons (with its `pydantic` extra, for the wire models),
|
|
22
|
+
# `opentelemetry-api`, following OpenTelemetry's own library guidance (a no-op
|
|
23
|
+
# until the application configures the SDK). See "Dependencies and why" in README.md.
|
|
24
|
+
dependencies = [
|
|
25
|
+
"rn-forge-commons[pydantic]>=0.8.0,<0.9",
|
|
26
|
+
"opentelemetry-api>=1.44",
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
[project.optional-dependencies]
|
|
30
|
+
testing = ["assertpy>=1.1", "pytest>=9.1.1"]
|
|
31
|
+
# `rn_forge.web.security` only. `secure` is framework-agnostic (no dependencies
|
|
32
|
+
# of its own) and emits the OWASP header preset directly, so it is wrapped
|
|
33
|
+
# rather than hand-rolled.
|
|
34
|
+
security = ["secure>=2.0.1"]
|
|
35
|
+
|
|
36
|
+
[project.urls]
|
|
37
|
+
Documentation = "https://rn-forge.github.io/pykit/packages/rn-forge-web/latest/"
|
|
38
|
+
Source = "https://github.com/rn-forge/pykit/tree/main/packages/rn-forge-web"
|
|
39
|
+
Changelog = "https://github.com/rn-forge/pykit/blob/main/packages/rn-forge-web/CHANGELOG.md"
|
|
40
|
+
Issues = "https://github.com/rn-forge/pykit/issues"
|
|
41
|
+
|
|
42
|
+
[build-system]
|
|
43
|
+
requires = ["uv_build>=0.11.28,<0.12.0"]
|
|
44
|
+
build-backend = "uv_build"
|
|
45
|
+
|
|
46
|
+
[tool.uv.build-backend]
|
|
47
|
+
module-name = "rn_forge.web"
|
|
48
|
+
|
|
49
|
+
[tool.uv.sources]
|
|
50
|
+
rn-forge-auth = { workspace = true }
|
|
51
|
+
rn-forge-commons = { workspace = true }
|
|
52
|
+
rn-forge-web = { workspace = true }
|
|
53
|
+
|
|
54
|
+
[tool.pytest.ini_options]
|
|
55
|
+
addopts = "-ra --import-mode=importlib"
|
|
56
|
+
asyncio_mode = "auto"
|
|
57
|
+
markers = ["unit: fast isolated tests"]
|
|
58
|
+
|
|
59
|
+
[dependency-groups]
|
|
60
|
+
dev = [
|
|
61
|
+
"assertpy>=1.1",
|
|
62
|
+
"opentelemetry-instrumentation-asgi>=0.65b0",
|
|
63
|
+
"opentelemetry-sdk>=1.44",
|
|
64
|
+
"pyright>=1.1.411",
|
|
65
|
+
"pytest>=9.1.1",
|
|
66
|
+
"pytest-asyncio>=1.3.0",
|
|
67
|
+
"pytest-cov>=7.1.0",
|
|
68
|
+
"pytest-randomly>=4.1.0",
|
|
69
|
+
# The guide examples, which the tests run, import rn-forge-auth.
|
|
70
|
+
"rn-forge-auth>=0.1.0,<0.2",
|
|
71
|
+
"rn-forge-web[security]",
|
|
72
|
+
"ruff>=0.15.21",
|
|
73
|
+
]
|
|
74
|
+
docs = [
|
|
75
|
+
"mkdocs>=1.6.1",
|
|
76
|
+
"mkdocs-material>=9.7.6",
|
|
77
|
+
"mkdocstrings[python]>=1.0.6",
|
|
78
|
+
"opentelemetry-instrumentation-asgi>=0.65b0",
|
|
79
|
+
"rn-forge-auth>=0.1.0,<0.2",
|
|
80
|
+
"rn-forge-web[security]",
|
|
81
|
+
]
|