mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-16 08:59:39 +02:00
Create packages/shared-python/manacore_auth/ with:
- auth.py: API key validation, rate limiting, local + external auth
- external_auth.py: mana-core-auth remote validation with caching
- create_auth_dependency(scope): factory for per-service auth deps
Migrated services:
- mana-stt: auth.py now wraps shared auth with scope="stt" (272→42 LOC)
- mana-tts: auth.py now wraps shared auth with scope="tts" (272→42 LOC)
The only difference between services was the scope parameter ("stt" vs "tts").
Both external_auth.py files were 100% identical and are now thin re-exports.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
22 lines
497 B
Python
22 lines
497 B
Python
"""
|
|
External API Key Validation — delegates to shared manacore_auth package.
|
|
"""
|
|
|
|
import sys
|
|
import os
|
|
|
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..", "..", "packages", "shared-python"))
|
|
|
|
from manacore_auth.external_auth import (
|
|
ExternalValidationResult,
|
|
is_external_auth_enabled,
|
|
validate_api_key_external,
|
|
clear_cache,
|
|
)
|
|
|
|
__all__ = [
|
|
"ExternalValidationResult",
|
|
"is_external_auth_enabled",
|
|
"validate_api_key_external",
|
|
"clear_cache",
|
|
]
|