Commit Graph

6 Commits

Author SHA1 Message Date
Stefan Lohmaier 0a1576aaa5 test: dedizierter mcptest-User statt Stefans echter Daten
USER_ALIASES test->mcptest. Eigene Backends pro Dienst:
- Radicale-User mcptest + /mcptest/calendar-test + contacts-test
- oCIS-User mcptest (Graph-API), Joplin lokales Profil :41186
- statische Test-Maildir tests/testdata/maildir (mcp-test-mail/-empty)
test_all.py auf mcptest-Backends umgestellt (Account-/Kalender-/Kontaktnamen).
config.json (gitignored) mit mcptest in allen Maps. Doku: tests/MCPTEST.md.
54 Tests gruen. Stefans calendar-test/contacts-test + Joplin-Test-Reste entfernt.
2026-06-19 07:46:35 +02:00
Stefan Lohmaier b555a2e19d security: redirect_uri-Allowlist + mail Path-Traversal-Schutz
- common.py /authorize: redirect_uri muss https://claude.ai/ oder https://claude.com/ sein
  (verhindert offenen Redirect / Code-Abfluss an fremde URIs).
- mail/server.py _open_folder: realpath-Check, Ordner muss im Account-Verzeichnis
  bleiben (Path-Traversal verhindert).
- tests: get_token_pkce auf sicheren Flow aktualisiert (erlaubte redirect_uri +
  client_secret). 54/54 Tests gruen.
test-Client bleibt (Test-Suite braucht ihn, Secret 600-geschuetzt).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 10:09:23 +02:00
Stefan Lohmaier c06e6d6b4c Joplin via Data API + Mail attachments
Notes server rewritten to use Joplin CLI Data API (joplin-cli sync
clients on host, ports 41184/41185). Clean fast search, proper
resource handling. New tools: list_note_resources, read_resource
(attachments as inline image/document/text).

Mail server: read_mail now lists attachments; new read_attachment
tool returns images inline, PDFs/docs as EmbeddedResource, text directly.

Tests: 54 total. Notes now real (notebooks, list, create+read).
Mail attachment listing + fetch tested.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-12 12:26:26 +02:00
Stefan Lohmaier 38cf147eec Fix Files tests: isolated test dir, auto-create and cleanup
Tests create /.mcp-tests/ in oCIS at start, delete at end.
No interference with user's real files. Fixed for stefan's
actual oCIS account (was using admin before).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-12 10:51:58 +02:00
Stefan Lohmaier e721250552 Expand test suite to 51 tests with full CRUD coverage
Test collections: calendar-test, contacts-test, /mcp-tests/
- OAuth: 30 tests (metadata, credentials, PKCE, rejection, tools list × 5 servers)
- Mail: 5 tests (accounts, folders, search, empty search, read full mail)
- Calendar: 5 tests (list, tasks, create event + verify, create task + verify, date range)
- Contacts: 4 tests (search, empty, create + verify, get details)
- Files: 6 tests (list, info, write+read+delete, create+delete folder, move, search)
- Notes: 1 test (list notebooks)

All tests create unique timestamped data and clean up after themselves.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-12 10:36:29 +02:00
Stefan Lohmaier 2618ecfc86 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>
2026-06-12 10:33:01 +02:00