Rename Castle Accounting extension to Libra

Full identifier rename: module path lnbits.extensions.castle →
lnbits.extensions.libra, DB ext_castle → ext_libra, URL prefix
/castle/ → /libra/, manifest id castle → libra, fava ledger slug
default castle-ledger → libra-ledger, Beancount source metadata
castle-api → libra-api and link prefixes castle-{entry,tx}- →
libra-{entry,tx}-, column castle_wallet_id → libra_wallet_id, all
Python/JS/HTML identifiers (castle_ext, CastleSettings,
castle_reference, castleWalletConfigured, etc.).

Display name "Castle Accounting" → "Libra" (the scales/balance
metaphor — fits double-entry bookkeeping).

No backward compat: production hosts will be force-updated. Old
castle-prefixed Beancount metadata in existing Fava ledgers is
historical; new entries use libra-* prefixes going forward.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Padreug 2026-05-05 10:24:46 +02:00
commit c174cda48d
44 changed files with 953 additions and 953 deletions

View file

@ -1,5 +1,5 @@
"""
Centralized Authorization Module for Castle Extension.
Centralized Authorization Module for Libra Extension.
Provides consistent, secure authorization patterns across all endpoints.
@ -55,9 +55,9 @@ class AuthContext:
@property
def is_admin(self) -> bool:
"""
Check if user is a Castle admin (super user).
Check if user is a Libra admin (super user).
Note: In Castle, admin = super_user. There's no separate admin concept.
Note: In Libra, admin = super_user. There's no separate admin concept.
"""
return self.is_super_user
@ -130,7 +130,7 @@ async def require_super_user(
Require super user access.
Raises HTTPException 403 if not super user.
Use for Castle admin operations.
Use for Libra admin operations.
"""
auth = _build_auth_context(wallet)
if not auth.is_super_user: