hedron-explorer 0.2.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.
- hedron_explorer-0.2.0/.gitignore +20 -0
- hedron_explorer-0.2.0/CHANGELOG.md +20 -0
- hedron_explorer-0.2.0/LICENSE +21 -0
- hedron_explorer-0.2.0/PKG-INFO +47 -0
- hedron_explorer-0.2.0/README.md +18 -0
- hedron_explorer-0.2.0/pyproject.toml +59 -0
- hedron_explorer-0.2.0/src/hedron_explorer/__init__.py +9 -0
- hedron_explorer-0.2.0/src/hedron_explorer/py.typed +0 -0
- hedron_explorer-0.2.0/src/hedron_explorer/router.py +93 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `hedron-explorer` are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
|
|
7
|
+
with the Hedron coordinated release train (`0.N.0` for phase `0.N`).
|
|
8
|
+
|
|
9
|
+
## [0.2.0] - 2026-08-03
|
|
10
|
+
|
|
11
|
+
Initial Explorer preview for the FastAPI MVP.
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- Development-only router for routes, components, previews, HTMX inference, and
|
|
16
|
+
security findings.
|
|
17
|
+
- Production absence by default with redacted metadata views.
|
|
18
|
+
- Shared registry identity with `hedron` routing and OpenAPI.
|
|
19
|
+
|
|
20
|
+
[0.2.0]: https://github.com/eddiethedean/hedron/commits/main
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Odos Matthews
|
|
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,47 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: hedron-explorer
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Development Component Explorer preview for Hedron
|
|
5
|
+
Project-URL: Homepage, https://github.com/eddiethedean/hedron
|
|
6
|
+
Project-URL: Repository, https://github.com/eddiethedean/hedron
|
|
7
|
+
Project-URL: Issues, https://github.com/eddiethedean/hedron/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/eddiethedean/hedron/blob/main/packages/hedron-explorer/CHANGELOG.md
|
|
9
|
+
Project-URL: Documentation, https://github.com/eddiethedean/hedron/tree/main/docs
|
|
10
|
+
Author-email: Odos Matthews <odosmatthews@gmail.com>
|
|
11
|
+
Maintainer-email: Odos Matthews <odosmatthews@gmail.com>
|
|
12
|
+
License-Expression: MIT
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Keywords: components,development,explorer,hedron
|
|
15
|
+
Classifier: Development Status :: 3 - Alpha
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
+
Classifier: Programming Language :: Python
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
25
|
+
Classifier: Typing :: Typed
|
|
26
|
+
Requires-Python: <3.15,>=3.11
|
|
27
|
+
Requires-Dist: hedron==0.2.0
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
|
|
30
|
+
# hedron-explorer
|
|
31
|
+
|
|
32
|
+
Development Component Explorer preview for Hedron (`0.2.0`).
|
|
33
|
+
|
|
34
|
+
Provides registry-backed inspection of routes, components, HTMX inference, and
|
|
35
|
+
security findings. Installed through `hedron[dev]`; not required in production.
|
|
36
|
+
|
|
37
|
+
## Install
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
pip install "hedron[dev]"
|
|
41
|
+
# or
|
|
42
|
+
uv add hedron --extra dev
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## License
|
|
46
|
+
|
|
47
|
+
MIT. See [LICENSE](LICENSE).
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# hedron-explorer
|
|
2
|
+
|
|
3
|
+
Development Component Explorer preview for Hedron (`0.2.0`).
|
|
4
|
+
|
|
5
|
+
Provides registry-backed inspection of routes, components, HTMX inference, and
|
|
6
|
+
security findings. Installed through `hedron[dev]`; not required in production.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
pip install "hedron[dev]"
|
|
12
|
+
# or
|
|
13
|
+
uv add hedron --extra dev
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## License
|
|
17
|
+
|
|
18
|
+
MIT. See [LICENSE](LICENSE).
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "hedron-explorer"
|
|
3
|
+
version = "0.2.0"
|
|
4
|
+
description = "Development Component Explorer preview for Hedron"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.11,<3.15"
|
|
7
|
+
license = "MIT"
|
|
8
|
+
license-files = ["LICENSE"]
|
|
9
|
+
authors = [
|
|
10
|
+
{ name = "Odos Matthews", email = "odosmatthews@gmail.com" },
|
|
11
|
+
]
|
|
12
|
+
maintainers = [
|
|
13
|
+
{ name = "Odos Matthews", email = "odosmatthews@gmail.com" },
|
|
14
|
+
]
|
|
15
|
+
keywords = [
|
|
16
|
+
"components",
|
|
17
|
+
"development",
|
|
18
|
+
"explorer",
|
|
19
|
+
"hedron",
|
|
20
|
+
]
|
|
21
|
+
classifiers = [
|
|
22
|
+
"Development Status :: 3 - Alpha",
|
|
23
|
+
"Intended Audience :: Developers",
|
|
24
|
+
"License :: OSI Approved :: MIT License",
|
|
25
|
+
"Programming Language :: Python",
|
|
26
|
+
"Programming Language :: Python :: 3",
|
|
27
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
28
|
+
"Programming Language :: Python :: 3.11",
|
|
29
|
+
"Programming Language :: Python :: 3.12",
|
|
30
|
+
"Programming Language :: Python :: 3.13",
|
|
31
|
+
"Programming Language :: Python :: 3.14",
|
|
32
|
+
"Typing :: Typed",
|
|
33
|
+
]
|
|
34
|
+
dependencies = [
|
|
35
|
+
"hedron==0.2.0",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
[project.urls]
|
|
39
|
+
Homepage = "https://github.com/eddiethedean/hedron"
|
|
40
|
+
Repository = "https://github.com/eddiethedean/hedron"
|
|
41
|
+
Issues = "https://github.com/eddiethedean/hedron/issues"
|
|
42
|
+
Changelog = "https://github.com/eddiethedean/hedron/blob/main/packages/hedron-explorer/CHANGELOG.md"
|
|
43
|
+
Documentation = "https://github.com/eddiethedean/hedron/tree/main/docs"
|
|
44
|
+
|
|
45
|
+
[build-system]
|
|
46
|
+
requires = ["hatchling"]
|
|
47
|
+
build-backend = "hatchling.build"
|
|
48
|
+
|
|
49
|
+
[tool.hatch.build.targets.wheel]
|
|
50
|
+
packages = ["src/hedron_explorer"]
|
|
51
|
+
|
|
52
|
+
[tool.hatch.build.targets.sdist]
|
|
53
|
+
only-include = [
|
|
54
|
+
"src/hedron_explorer",
|
|
55
|
+
"README.md",
|
|
56
|
+
"CHANGELOG.md",
|
|
57
|
+
"LICENSE",
|
|
58
|
+
"pyproject.toml",
|
|
59
|
+
]
|
|
File without changes
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"""Explorer preview router (development only)."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import html as html_lib
|
|
6
|
+
from typing import Any
|
|
7
|
+
|
|
8
|
+
from fastapi import APIRouter
|
|
9
|
+
from fastapi.responses import HTMLResponse
|
|
10
|
+
|
|
11
|
+
from hedron_core.registry import get_registry
|
|
12
|
+
|
|
13
|
+
__all__ = ["explorer_router"]
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def explorer_router() -> APIRouter:
|
|
17
|
+
router = APIRouter(tags=["hedron-explorer"])
|
|
18
|
+
|
|
19
|
+
@router.get("/", response_class=HTMLResponse, include_in_schema=False)
|
|
20
|
+
async def index() -> str:
|
|
21
|
+
registry = get_registry()
|
|
22
|
+
routes = list(registry.routes())
|
|
23
|
+
components = list(registry.components())
|
|
24
|
+
findings = [
|
|
25
|
+
"Explorer is development-only by default",
|
|
26
|
+
"Secrets and absolute paths are redacted from this view",
|
|
27
|
+
"Internal component resources default to include_in_schema=False",
|
|
28
|
+
"Unsafe cookie-authenticated actions require CSRF validation",
|
|
29
|
+
]
|
|
30
|
+
route_rows = "".join(
|
|
31
|
+
f"<tr><td>{html_lib.escape(r.kind)}</td>"
|
|
32
|
+
f"<td>{html_lib.escape(r.name)}</td>"
|
|
33
|
+
f"<td><code>{html_lib.escape(r.path)}</code></td>"
|
|
34
|
+
f"<td>{html_lib.escape(','.join(r.methods))}</td>"
|
|
35
|
+
f"<td>{html_lib.escape(str(dict(r.htmx_inference)))}</td></tr>"
|
|
36
|
+
for r in routes
|
|
37
|
+
)
|
|
38
|
+
component_rows = "".join(
|
|
39
|
+
f"<tr><td>{html_lib.escape(c.name)}</td>"
|
|
40
|
+
f"<td><code>{html_lib.escape(c.logical_id)}</code></td>"
|
|
41
|
+
f"<td>{html_lib.escape(c.distribution)}</td></tr>"
|
|
42
|
+
for c in components[:100]
|
|
43
|
+
)
|
|
44
|
+
finding_items = "".join(f"<li>{html_lib.escape(item)}</li>" for item in findings)
|
|
45
|
+
return f"""<!DOCTYPE html>
|
|
46
|
+
<html lang="en">
|
|
47
|
+
<head><meta charset="utf-8"><title>Hedron Explorer</title></head>
|
|
48
|
+
<body>
|
|
49
|
+
<h1>Hedron Explorer</h1>
|
|
50
|
+
<p>Registry-backed preview for routes, components, HTMX inference, and security findings.</p>
|
|
51
|
+
<h2>Routes</h2>
|
|
52
|
+
<table border="1" cellpadding="6">
|
|
53
|
+
<thead>
|
|
54
|
+
<tr><th>Kind</th><th>Name</th><th>Path</th><th>Methods</th><th>HTMX</th></tr>
|
|
55
|
+
</thead>
|
|
56
|
+
<tbody>{route_rows or "<tr><td colspan='5'>No routes registered</td></tr>"}</tbody>
|
|
57
|
+
</table>
|
|
58
|
+
<h2>Components</h2>
|
|
59
|
+
<table border="1" cellpadding="6">
|
|
60
|
+
<thead><tr><th>Name</th><th>Logical ID</th><th>Distribution</th></tr></thead>
|
|
61
|
+
<tbody>{component_rows or "<tr><td colspan='3'>No components</td></tr>"}</tbody>
|
|
62
|
+
</table>
|
|
63
|
+
<h2>Security findings</h2>
|
|
64
|
+
<ul>{finding_items}</ul>
|
|
65
|
+
</body>
|
|
66
|
+
</html>"""
|
|
67
|
+
|
|
68
|
+
@router.get("/api/routes", include_in_schema=False)
|
|
69
|
+
async def api_routes() -> list[dict[str, Any]]:
|
|
70
|
+
return [
|
|
71
|
+
{
|
|
72
|
+
"kind": r.kind,
|
|
73
|
+
"name": r.name,
|
|
74
|
+
"path": r.path,
|
|
75
|
+
"methods": list(r.methods),
|
|
76
|
+
"operation_id": r.operation_id,
|
|
77
|
+
"htmx_inference": dict(r.htmx_inference),
|
|
78
|
+
}
|
|
79
|
+
for r in get_registry().routes()
|
|
80
|
+
]
|
|
81
|
+
|
|
82
|
+
@router.get("/api/security", include_in_schema=False)
|
|
83
|
+
async def api_security() -> dict[str, Any]:
|
|
84
|
+
return {
|
|
85
|
+
"findings": [
|
|
86
|
+
"Explorer routes absent in production by default",
|
|
87
|
+
"CSRF required for unsafe cookie-authenticated actions",
|
|
88
|
+
"Authenticated fragments use private, no-store caching",
|
|
89
|
+
],
|
|
90
|
+
"redacted": True,
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return router
|