rn-forge-web 0.3.0__tar.gz → 0.3.2__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 → rn_forge_web-0.3.2}/PKG-INFO +27 -20
- {rn_forge_web-0.3.0 → rn_forge_web-0.3.2}/README.md +24 -17
- {rn_forge_web-0.3.0 → rn_forge_web-0.3.2}/pyproject.toml +15 -7
- {rn_forge_web-0.3.0 → rn_forge_web-0.3.2}/pyproject.toml.orig +38 -30
- rn_forge_web-0.3.2/src/rn_forge/web/conformance/_pagination.py +380 -0
- rn_forge_web-0.3.2/src/rn_forge/web/conformance/_platform.py +299 -0
- rn_forge_web-0.3.2/src/rn_forge/web/conformance/_problem.py +174 -0
- rn_forge_web-0.3.2/src/rn_forge/web/conformance/_shared.py +59 -0
- rn_forge_web-0.3.2/src/rn_forge/web/conformance/_transfer.py +572 -0
- rn_forge_web-0.3.2/src/rn_forge/web/conformance/_writes.py +480 -0
- rn_forge_web-0.3.2/src/rn_forge/web/conformance/cases.py +61 -0
- {rn_forge_web-0.3.0 → rn_forge_web-0.3.2}/src/rn_forge/web/health.py +53 -17
- {rn_forge_web-0.3.0 → rn_forge_web-0.3.2}/src/rn_forge/web/problem.py +59 -0
- rn_forge_web-0.3.0/src/rn_forge/web/conformance/cases.py +0 -1890
- {rn_forge_web-0.3.0 → rn_forge_web-0.3.2}/LICENSE +0 -0
- {rn_forge_web-0.3.0 → rn_forge_web-0.3.2}/src/rn_forge/web/__init__.py +0 -0
- {rn_forge_web-0.3.0 → rn_forge_web-0.3.2}/src/rn_forge/web/asgi.py +0 -0
- {rn_forge_web-0.3.0 → rn_forge_web-0.3.2}/src/rn_forge/web/auth.py +0 -0
- {rn_forge_web-0.3.0 → rn_forge_web-0.3.2}/src/rn_forge/web/concurrency.py +0 -0
- {rn_forge_web-0.3.0 → rn_forge_web-0.3.2}/src/rn_forge/web/conformance/__init__.py +0 -0
- {rn_forge_web-0.3.0 → rn_forge_web-0.3.2}/src/rn_forge/web/conformance/types.py +0 -0
- {rn_forge_web-0.3.0 → rn_forge_web-0.3.2}/src/rn_forge/web/deprecation.py +0 -0
- {rn_forge_web-0.3.0 → rn_forge_web-0.3.2}/src/rn_forge/web/exceptions.py +0 -0
- {rn_forge_web-0.3.0 → rn_forge_web-0.3.2}/src/rn_forge/web/idempotency.py +0 -0
- {rn_forge_web-0.3.0 → rn_forge_web-0.3.2}/src/rn_forge/web/merge_patch.py +0 -0
- {rn_forge_web-0.3.0 → rn_forge_web-0.3.2}/src/rn_forge/web/models.py +0 -0
- {rn_forge_web-0.3.0 → rn_forge_web-0.3.2}/src/rn_forge/web/openapi.py +0 -0
- {rn_forge_web-0.3.0 → rn_forge_web-0.3.2}/src/rn_forge/web/operations.py +0 -0
- {rn_forge_web-0.3.0 → rn_forge_web-0.3.2}/src/rn_forge/web/pagination.py +0 -0
- {rn_forge_web-0.3.0 → rn_forge_web-0.3.2}/src/rn_forge/web/py.typed +0 -0
- {rn_forge_web-0.3.0 → rn_forge_web-0.3.2}/src/rn_forge/web/read_mask.py +0 -0
- {rn_forge_web-0.3.0 → rn_forge_web-0.3.2}/src/rn_forge/web/security.py +0 -0
- {rn_forge_web-0.3.0 → rn_forge_web-0.3.2}/src/rn_forge/web/soft_delete.py +0 -0
- {rn_forge_web-0.3.0 → rn_forge_web-0.3.2}/src/rn_forge/web/tracing.py +0 -0
- {rn_forge_web-0.3.0 → rn_forge_web-0.3.2}/src/rn_forge/web/transfer.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rn-forge-web
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: Framework-agnostic HTTP/API primitives built on rn-forge-commons
|
|
5
5
|
Author: Rohit Narayanan
|
|
6
6
|
Author-email: Rohit Narayanan <rohit.nn@gmail.com>
|
|
@@ -13,10 +13,10 @@ Classifier: Programming Language :: Python :: 3
|
|
|
13
13
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.14
|
|
15
15
|
Classifier: Typing :: Typed
|
|
16
|
-
Requires-Dist: rn-forge-commons[pydantic]>=0.8.0,<0.
|
|
16
|
+
Requires-Dist: rn-forge-commons[pydantic]>=0.8.0,<0.11
|
|
17
17
|
Requires-Dist: opentelemetry-api>=1.44
|
|
18
18
|
Requires-Dist: secure>=2.0.1 ; extra == 'security'
|
|
19
|
-
Requires-Dist: assertpy>=
|
|
19
|
+
Requires-Dist: assertpy>=2.35 ; extra == 'testing'
|
|
20
20
|
Requires-Dist: pytest>=9.1.1 ; extra == 'testing'
|
|
21
21
|
Requires-Python: >=3.14
|
|
22
22
|
Project-URL: Documentation, https://rn-forge.github.io/pykit/packages/rn-forge-web/latest/
|
|
@@ -43,25 +43,16 @@ envelope, the idempotency contract, the readiness aggregate, the authentication
|
|
|
43
43
|
contract, the OpenAPI naming rules, and the conformance table the framework
|
|
44
44
|
packages are tested against.
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
semantics.
|
|
46
|
+
Flat modules, all one kind of mechanism: **inbound** HTTP wire semantics.
|
|
48
47
|
|
|
49
48
|
## Where it sits
|
|
50
49
|
|
|
51
|
-
```text
|
|
52
|
-
commons ──► web ──► auth ──► django
|
|
53
|
-
│ └───► fastapi
|
|
54
|
-
└───► sqlalchemy
|
|
55
|
-
```
|
|
56
|
-
|
|
57
50
|
`rn-forge-web` depends on **`rn-forge-commons` and nothing else in the
|
|
58
51
|
workspace**. It never imports `rn_forge.cli` or `rn_forge.tooling` — those are
|
|
59
52
|
the command-line and file-owning layers, and a package that ships into an ASGI
|
|
60
53
|
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.
|
|
54
|
+
`django`, not `fastapi`, not `starlette`, not `rest_framework`. `task lint`
|
|
55
|
+
proves them.
|
|
65
56
|
|
|
66
57
|
## Inbound, not outbound
|
|
67
58
|
|
|
@@ -97,9 +88,26 @@ Require the package by version range:
|
|
|
97
88
|
dependencies = ["rn-forge-web>=0.3,<0.4"]
|
|
98
89
|
```
|
|
99
90
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
91
|
+
Its dependencies are `rn-forge-commons[pydantic]` and `opentelemetry-api`. The
|
|
92
|
+
`security` extra adds `secure`, for `rn_forge.web.security`; the `testing` extra
|
|
93
|
+
adds `assertpy` and `pytest`.
|
|
94
|
+
|
|
95
|
+
## Minimum example
|
|
96
|
+
|
|
97
|
+
```python
|
|
98
|
+
from rn_forge.web import default_registry, render_problem
|
|
99
|
+
|
|
100
|
+
registry = default_registry()
|
|
101
|
+
rendered = render_problem(registry, exc, instance="/orders/1")
|
|
102
|
+
# rendered.status, rendered.body, rendered.headers: application/problem+json
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Errors
|
|
106
|
+
|
|
107
|
+
Every exception here is an `AppException` and renders as an RFC 9457
|
|
108
|
+
`application/problem+json` body: `AuthenticationFailed` 401, `PermissionDenied`
|
|
109
|
+
403, `VersionConflict` 412, `PreconditionRequired` 428. A 5xx carries a fixed
|
|
110
|
+
generic detail, never `str(exc)`.
|
|
103
111
|
|
|
104
112
|
## Dependencies and why
|
|
105
113
|
|
|
@@ -132,8 +140,7 @@ different wire shape.
|
|
|
132
140
|
|
|
133
141
|
## Documentation
|
|
134
142
|
|
|
135
|
-
`
|
|
136
|
-
or the combined site from the repo root. `docs/guides/api-conventions.md` is the
|
|
143
|
+
`task docs:build` builds every site. `docs/guides/api-conventions.md` is the
|
|
137
144
|
normative wire contract for an application's specification.
|
|
138
145
|
`docs/guides/model-conventions.md` compares implemented ORM building blocks and
|
|
139
146
|
optional application design advice.
|
|
@@ -14,25 +14,16 @@ envelope, the idempotency contract, the readiness aggregate, the authentication
|
|
|
14
14
|
contract, the OpenAPI naming rules, and the conformance table the framework
|
|
15
15
|
packages are tested against.
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
semantics.
|
|
17
|
+
Flat modules, all one kind of mechanism: **inbound** HTTP wire semantics.
|
|
19
18
|
|
|
20
19
|
## Where it sits
|
|
21
20
|
|
|
22
|
-
```text
|
|
23
|
-
commons ──► web ──► auth ──► django
|
|
24
|
-
│ └───► fastapi
|
|
25
|
-
└───► sqlalchemy
|
|
26
|
-
```
|
|
27
|
-
|
|
28
21
|
`rn-forge-web` depends on **`rn-forge-commons` and nothing else in the
|
|
29
22
|
workspace**. It never imports `rn_forge.cli` or `rn_forge.tooling` — those are
|
|
30
23
|
the command-line and file-owning layers, and a package that ships into an ASGI
|
|
31
24
|
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.
|
|
25
|
+
`django`, not `fastapi`, not `starlette`, not `rest_framework`. `task lint`
|
|
26
|
+
proves them.
|
|
36
27
|
|
|
37
28
|
## Inbound, not outbound
|
|
38
29
|
|
|
@@ -68,9 +59,26 @@ Require the package by version range:
|
|
|
68
59
|
dependencies = ["rn-forge-web>=0.3,<0.4"]
|
|
69
60
|
```
|
|
70
61
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
62
|
+
Its dependencies are `rn-forge-commons[pydantic]` and `opentelemetry-api`. The
|
|
63
|
+
`security` extra adds `secure`, for `rn_forge.web.security`; the `testing` extra
|
|
64
|
+
adds `assertpy` and `pytest`.
|
|
65
|
+
|
|
66
|
+
## Minimum example
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
from rn_forge.web import default_registry, render_problem
|
|
70
|
+
|
|
71
|
+
registry = default_registry()
|
|
72
|
+
rendered = render_problem(registry, exc, instance="/orders/1")
|
|
73
|
+
# rendered.status, rendered.body, rendered.headers: application/problem+json
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Errors
|
|
77
|
+
|
|
78
|
+
Every exception here is an `AppException` and renders as an RFC 9457
|
|
79
|
+
`application/problem+json` body: `AuthenticationFailed` 401, `PermissionDenied`
|
|
80
|
+
403, `VersionConflict` 412, `PreconditionRequired` 428. A 5xx carries a fixed
|
|
81
|
+
generic detail, never `str(exc)`.
|
|
74
82
|
|
|
75
83
|
## Dependencies and why
|
|
76
84
|
|
|
@@ -103,8 +111,7 @@ different wire shape.
|
|
|
103
111
|
|
|
104
112
|
## Documentation
|
|
105
113
|
|
|
106
|
-
`
|
|
107
|
-
or the combined site from the repo root. `docs/guides/api-conventions.md` is the
|
|
114
|
+
`task docs:build` builds every site. `docs/guides/api-conventions.md` is the
|
|
108
115
|
normative wire contract for an application's specification.
|
|
109
116
|
`docs/guides/model-conventions.md` compares implemented ORM building blocks and
|
|
110
117
|
optional application design advice.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "rn-forge-web"
|
|
3
|
-
version = "0.3.
|
|
3
|
+
version = "0.3.2"
|
|
4
4
|
description = "Framework-agnostic HTTP/API primitives built on rn-forge-commons"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = "MIT"
|
|
@@ -16,7 +16,7 @@ classifiers = [
|
|
|
16
16
|
]
|
|
17
17
|
requires-python = ">=3.14"
|
|
18
18
|
dependencies = [
|
|
19
|
-
"rn-forge-commons[pydantic]>=0.8.0,<0.
|
|
19
|
+
"rn-forge-commons[pydantic]>=0.8.0,<0.11",
|
|
20
20
|
"opentelemetry-api>=1.44",
|
|
21
21
|
]
|
|
22
22
|
|
|
@@ -26,7 +26,7 @@ email = "rohit.nn@gmail.com"
|
|
|
26
26
|
|
|
27
27
|
[project.optional-dependencies]
|
|
28
28
|
testing = [
|
|
29
|
-
"assertpy>=
|
|
29
|
+
"assertpy>=2.35",
|
|
30
30
|
"pytest>=9.1.1",
|
|
31
31
|
]
|
|
32
32
|
security = ["secure>=2.0.1"]
|
|
@@ -38,11 +38,19 @@ Changelog = "https://github.com/rn-forge/pykit/blob/main/packages/rn-forge-web/C
|
|
|
38
38
|
Issues = "https://github.com/rn-forge/pykit/issues"
|
|
39
39
|
|
|
40
40
|
[build-system]
|
|
41
|
-
requires = ["uv_build>=0.
|
|
41
|
+
requires = ["uv_build>=0.13.7,<0.14.0"]
|
|
42
42
|
build-backend = "uv_build"
|
|
43
43
|
|
|
44
|
+
[tool.pyright]
|
|
45
|
+
typeCheckingMode = "strict"
|
|
46
|
+
reportMissingTypeStubs = false
|
|
47
|
+
reportUnnecessaryTypeIgnoreComment = "error"
|
|
48
|
+
venv = ".venv"
|
|
49
|
+
venvPath = "../.."
|
|
50
|
+
|
|
44
51
|
[tool.uv.build-backend]
|
|
45
52
|
module-name = "rn_forge.web"
|
|
53
|
+
source-exclude = ["**/.DS_Store"]
|
|
46
54
|
|
|
47
55
|
[tool.uv.sources.rn-forge-auth]
|
|
48
56
|
workspace = true
|
|
@@ -60,7 +68,7 @@ markers = ["unit: fast isolated tests"]
|
|
|
60
68
|
|
|
61
69
|
[dependency-groups]
|
|
62
70
|
dev = [
|
|
63
|
-
"assertpy>=
|
|
71
|
+
"assertpy>=2.35",
|
|
64
72
|
"opentelemetry-instrumentation-asgi>=0.65b0",
|
|
65
73
|
"opentelemetry-sdk>=1.44",
|
|
66
74
|
"pyright>=1.1.411",
|
|
@@ -68,7 +76,7 @@ dev = [
|
|
|
68
76
|
"pytest-asyncio>=1.3.0",
|
|
69
77
|
"pytest-cov>=7.1.0",
|
|
70
78
|
"pytest-randomly>=4.1.0",
|
|
71
|
-
"rn-forge-auth>=0.1.0,<0.
|
|
79
|
+
"rn-forge-auth>=0.1.0,<0.3",
|
|
72
80
|
"rn-forge-web[security]",
|
|
73
81
|
"ruff>=0.15.21",
|
|
74
82
|
]
|
|
@@ -77,6 +85,6 @@ docs = [
|
|
|
77
85
|
"mkdocs-material>=9.7.6",
|
|
78
86
|
"mkdocstrings[python]>=1.0.6",
|
|
79
87
|
"opentelemetry-instrumentation-asgi>=0.65b0",
|
|
80
|
-
"rn-forge-auth>=0.1.0,<0.
|
|
88
|
+
"rn-forge-auth>=0.1.0,<0.3",
|
|
81
89
|
"rn-forge-web[security]",
|
|
82
90
|
]
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "rn-forge-web"
|
|
3
|
-
version = "0.3.
|
|
3
|
+
version = "0.3.2"
|
|
4
4
|
description = "Framework-agnostic HTTP/API primitives built on rn-forge-commons"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [{ name = "Rohit Narayanan", email = "rohit.nn@gmail.com" }]
|
|
7
7
|
license = "MIT"
|
|
8
8
|
license-files = ["LICENSE"]
|
|
9
9
|
classifiers = [
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
17
|
]
|
|
18
18
|
requires-python = ">=3.14"
|
|
19
19
|
# Internal requirements are version ranges (ADR-0004).
|
|
@@ -22,12 +22,12 @@ requires-python = ">=3.14"
|
|
|
22
22
|
# `opentelemetry-api`, following OpenTelemetry's own library guidance (a no-op
|
|
23
23
|
# until the application configures the SDK). See "Dependencies and why" in README.md.
|
|
24
24
|
dependencies = [
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
"rn-forge-commons[pydantic]>=0.8.0,<0.11",
|
|
26
|
+
"opentelemetry-api>=1.44",
|
|
27
27
|
]
|
|
28
28
|
|
|
29
29
|
[project.optional-dependencies]
|
|
30
|
-
testing = ["assertpy>=
|
|
30
|
+
testing = ["assertpy>=2.35", "pytest>=9.1.1"]
|
|
31
31
|
# `rn_forge.web.security` only. `secure` is framework-agnostic (no dependencies
|
|
32
32
|
# of its own) and emits the OWASP header preset directly, so it is wrapped
|
|
33
33
|
# rather than hand-rolled.
|
|
@@ -40,11 +40,19 @@ Changelog = "https://github.com/rn-forge/pykit/blob/main/packages/rn-forge-web/C
|
|
|
40
40
|
Issues = "https://github.com/rn-forge/pykit/issues"
|
|
41
41
|
|
|
42
42
|
[build-system]
|
|
43
|
-
requires = ["uv_build>=0.
|
|
43
|
+
requires = ["uv_build>=0.13.7,<0.14.0"]
|
|
44
44
|
build-backend = "uv_build"
|
|
45
45
|
|
|
46
|
+
[tool.pyright]
|
|
47
|
+
typeCheckingMode = "strict"
|
|
48
|
+
reportMissingTypeStubs = false
|
|
49
|
+
reportUnnecessaryTypeIgnoreComment = "error"
|
|
50
|
+
venv = ".venv"
|
|
51
|
+
venvPath = "../.."
|
|
52
|
+
|
|
46
53
|
[tool.uv.build-backend]
|
|
47
54
|
module-name = "rn_forge.web"
|
|
55
|
+
source-exclude = ["**/.DS_Store"]
|
|
48
56
|
|
|
49
57
|
[tool.uv.sources]
|
|
50
58
|
rn-forge-auth = { workspace = true }
|
|
@@ -58,24 +66,24 @@ markers = ["unit: fast isolated tests"]
|
|
|
58
66
|
|
|
59
67
|
[dependency-groups]
|
|
60
68
|
dev = [
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
"assertpy>=2.35",
|
|
70
|
+
"opentelemetry-instrumentation-asgi>=0.65b0",
|
|
71
|
+
"opentelemetry-sdk>=1.44",
|
|
72
|
+
"pyright>=1.1.411",
|
|
73
|
+
"pytest>=9.1.1",
|
|
74
|
+
"pytest-asyncio>=1.3.0",
|
|
75
|
+
"pytest-cov>=7.1.0",
|
|
76
|
+
"pytest-randomly>=4.1.0",
|
|
77
|
+
# The guide examples, which the tests run, import rn-forge-auth.
|
|
78
|
+
"rn-forge-auth>=0.1.0,<0.3",
|
|
79
|
+
"rn-forge-web[security]",
|
|
80
|
+
"ruff>=0.15.21",
|
|
73
81
|
]
|
|
74
82
|
docs = [
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
83
|
+
"mkdocs>=1.6.1",
|
|
84
|
+
"mkdocs-material>=9.7.6",
|
|
85
|
+
"mkdocstrings[python]>=1.0.6",
|
|
86
|
+
"opentelemetry-instrumentation-asgi>=0.65b0",
|
|
87
|
+
"rn-forge-auth>=0.1.0,<0.3",
|
|
88
|
+
"rn-forge-web[security]",
|
|
81
89
|
]
|