Add test client and automated integration test suite
- 'test' OAuth client maps to stefan's data via USER_ALIASES - 38 tests covering OAuth (metadata, client_credentials, PKCE, invalid secret, no auth), Mail (accounts, folders, search), Calendar (calendars, tasks, events, search), Contacts (search, empty), Files (list, info), Notes (notebooks) - Daily systemd timer (05:00) with NTFY notification on failure - Shared token store (.active_tokens.json) for cross-process auth Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -23,7 +23,7 @@ from starlette.middleware.base import BaseHTTPMiddleware
|
||||
BASE_DIR = os.path.dirname(__file__)
|
||||
TOKENS_FILE = os.path.join(BASE_DIR, "tokens.json")
|
||||
CONFIG_FILE = os.path.join(BASE_DIR, "config.json")
|
||||
VALID_USERS = ["stefan", "kati"]
|
||||
VALID_USERS = ["stefan", "kati", "test"]
|
||||
|
||||
_config_cache = None
|
||||
|
||||
@@ -61,8 +61,11 @@ def _load_tokens():
|
||||
return _tokens_cache
|
||||
|
||||
|
||||
USER_ALIASES = {"test": "stefan"}
|
||||
|
||||
def get_current_user() -> str | None:
|
||||
return _current_user.get()
|
||||
user = _current_user.get()
|
||||
return USER_ALIASES.get(user, user)
|
||||
|
||||
|
||||
def get_user_key(username: str) -> str:
|
||||
|
||||
Reference in New Issue
Block a user