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:
Stefan Lohmaier
2026-06-12 10:33:01 +02:00
parent ef37d1e467
commit 2618ecfc86
3 changed files with 257 additions and 2 deletions
+5 -2
View File
@@ -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: