Federation data and actor keys (phase 1, step 1)
- federation_settings (per user; off, followers-only, not discoverable by default) and federation_keys (RSA-2048; NULL user = instance actor), on the federation migration branch - Private keys encrypted at rest with Fernet, keyed by HKDF-SHA256 from FEDERATION_KEY_SECRET (now required, 32+ chars, never printed) - Keys are created when a user first enables sharing and never regenerated; sharing.shared_user() treats unknown and non-sharing users identically - One flask-smorest Api per app (get_api(app)), so apps with and without federation never share an OpenAPI spec - Test fixtures for a second, federation-enabled app on the same DB 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
00ad8e9e6d
commit
98c65547f3
12 files changed
+513
-5
No files matched your search
@@ -29,11 +29,16 @@ class ScrobblerApi(Api):
|
||||
return response
|
||||
|
||||
|
||||
api = ScrobblerApi()
|
||||
def get_api(app: Flask) -> ScrobblerApi:
|
||||
"""This app's Api (for registering blueprints and documenting paths)."""
|
||||
return app.extensions["scrobbler_api"]
|
||||
|
||||
|
||||
def init_app(app: Flask) -> None:
|
||||
api.init_app(app)
|
||||
# One Api per app: its OpenAPI spec is per app too, so apps with different
|
||||
# optional modules enabled (e.g. in tests) never share a spec.
|
||||
api = ScrobblerApi(app)
|
||||
app.extensions["scrobbler_api"] = api
|
||||
api.spec.components.security_scheme(
|
||||
"bearerAuth",
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user