Commit Graph

4 Commits

Author SHA1 Message Date
Stefan Lohmaier fc50afa3c8 security: OAuth Auth-Bypass schliessen (client_secret + PKCE jetzt Pflicht)
KRITISCH: /token akzeptierte authorization_code OHNE client_secret
('rely on PKCE alone'-Zweig) und ueberging PKCE wenn code_challenge leer war.
Da client_id nur der Benutzername ist (z.B. 'stefan', steht in der Subdomain),
konnte jeder mit ratbarem Namen einen 30-Tage-Vollzugriffs-Token holen
(verifiziert ausnutzbar). Token galt zudem fuer alle 5 MCP-Dienste.

Fix:
- /authorize: code_challenge (PKCE) PFLICHT
- /token: client_secret PFLICHT (_resolve_client) UND PKCE-Verifikation PFLICHT,
  Bypass-Zweige entfernt.
claude.ai sendet beides (client_secret_post + S256-PKCE, per Audit verifiziert)
-> kein erneutes Verbinden noetig, bestehende Tokens bleiben gueltig.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 10:02:10 +02:00
root 56d92c153b mail: robustes Decoding gegen unbekannte Charsets (x-unknown); OAuth-Token 30 Tage
- _safe_decode() faengt LookupError bei unbekannten/kaputten Mail-Charsets
  (z.B. 'x-unknown') ab, Fallback utf-8 -> latin-1. Verhindert Crash der
  Mail-Suche/Read bei einzelnen kaputt-kodierten Mails.
- common.py: OAuth access_token Lifetime 24h -> 30 Tage (weniger Re-Auth in claude.ai)
- .gitignore: *.before-* Backups ausschliessen

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 09:37:15 +02:00
Stefan Lohmaier 30351f1bcf Switch to per-service subdomains, shared token store
URLs: mail.mcp.home.slohmaier.de, calendar.mcp..., etc.
No more path-prefix routing — each service has its own domain.
OAuth tokens stored in shared .active_tokens.json file so all
services can validate tokens issued by any service.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-12 09:13:54 +02:00
Stefan Lohmaier fb642e47c8 Initial commit: 5 MCP servers for Mail, Calendar, Contacts, Files, Notes
Self-hosted MCP servers with OAuth client_credentials auth.
Each server connects to a different backend:
- Mail: reads Maildir IMAP backups
- Calendar/Tasks: CalDAV against Radicale
- Contacts: CardDAV against Radicale
- Files: WebDAV against oCIS
- Notes: Joplin REST API

Credentials externalized to config.json (not in repo).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-12 06:22:42 +02:00