Sharing settings API, public profiles and ActivityPub docs (phase 1, step 4)
CI / validate-monitoring (push) Successful in 7s
CI / lint (push) Successful in 12s
CI / test (push) Successful in 1m5s
CI / images (push) Skipped
CI / assets (push) Skipped
CI / python-package (push) Skipped
CI / notify (push) Successful in 5s
CI / validate-monitoring (push) Successful in 7s
CI / lint (push) Successful in 12s
CI / test (push) Successful in 1m5s
CI / images (push) Skipped
CI / assets (push) Skipped
CI / python-package (push) Skipped
CI / notify (push) Successful in 5s
- /api/v1/federation/settings (GET, PATCH): sharing on/off, visibility (followers-only default), follow approval, discoverable/indexable, display name and bio, plus the read-only handle and URLs - /api/v1/federation/profiles/<name>: public profile for the UI page, only for users sharing - ActivityPub endpoints documented under an ActivityPub tag - docs/openapi.json is now exported with every optional module on (python -m scrobbler.openapi.export); the drift test and route checks cover both a federation-off and a federation-on app - Boundary: federation may use scrobbler.api.get_api to register its blueprint; the checker proves other scrobbler.api modules stay off limits Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MK52BGoJbPhZ1vSFuKcGUW
This commit is contained in:
1 parent
ce39e8f865
commit
0b10469514
11 files changed
+1175
-11
No files matched your search
@@ -36,6 +36,7 @@ FRAMEWORKS = (
|
||||
)
|
||||
CORE_PUBLIC_SURFACE = (
|
||||
"scrobbler.__version__",
|
||||
"scrobbler.api.get_api",
|
||||
"scrobbler.events",
|
||||
"scrobbler.extensions",
|
||||
"scrobbler.worker",
|
||||
@@ -85,7 +86,8 @@ def violations(module: str, imports: set[str]) -> list[str]:
|
||||
problems.append(f"{module} (protocol) imports {name}")
|
||||
elif within(module, FEDERATION):
|
||||
for name in imports:
|
||||
if not within(name, "scrobbler") or name == "scrobbler":
|
||||
# The packages themselves (for their public names listed above) are fine.
|
||||
if not within(name, "scrobbler") or name in ("scrobbler", "scrobbler.api"):
|
||||
continue
|
||||
if within(name, FEDERATION) or any(within(name, ok) for ok in CORE_PUBLIC_SURFACE):
|
||||
continue
|
||||
@@ -126,6 +128,7 @@ def test_federation_package_is_checked():
|
||||
(PROTOCOL + ".vocab", "from ..config import FederationConfig", "imports"),
|
||||
(FEDERATION + ".inbox", "from scrobbler.models import User", "core internals"),
|
||||
(FEDERATION + ".inbox", "from scrobbler import metrics", "core internals"),
|
||||
(FEDERATION + ".api", "from scrobbler.api import apps", "core internals"),
|
||||
],
|
||||
)
|
||||
def test_the_checker_catches_violations(module, source, expected):
|
||||
@@ -143,6 +146,7 @@ def test_the_checker_catches_violations(module, source, expected):
|
||||
"from scrobbler.services import stats\nfrom scrobbler import events",
|
||||
),
|
||||
(FEDERATION + ".inbox", "from .protocol import vocab\nfrom flask import Blueprint"),
|
||||
(FEDERATION, "from scrobbler.api import get_api"),
|
||||
(PROTOCOL + ".signatures.rfc9421", "from ..vocab import note\nimport hashlib"),
|
||||
],
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user