Skip to content

feat: add CalDAV support for ProtonMail Calendar#335

Open
bobbiejaxn wants to merge 1 commit into
emersion:masterfrom
bobbiejaxn:caldav-support
Open

feat: add CalDAV support for ProtonMail Calendar#335
bobbiejaxn wants to merge 1 commit into
emersion:masterfrom
bobbiejaxn:caldav-support

Conversation

@bobbiejaxn
Copy link
Copy Markdown

Implements CalDAV proxy bridging ProtonMail Calendar API to standard CalDAV protocol (RFC 4791).

What's new

  • caldav/caldav.go (452 lines): Full caldav.Backend implementation

    • CalendarHomeSetPath, ListCalendars, GetCalendar
    • ListCalendarObjects, GetCalendarObject, QueryCalendarObjects
    • PutCalendarObject (create/update events with PGP encryption)
    • DeleteCalendarObject
    • Per-calendar event cache with EventRefreshCalendar invalidation
  • protonmail/calendar.go: Extended with 7 API methods + PGP crypto

    • CalendarEventCard.Read() / NewEncryptedCalendarEventCard()
    • GetCalendar, CreateCalendar, DeleteCalendar
    • GetCalendarEvent, CreateCalendarEvent, UpdateCalendarEvent, DeleteCalendarEvent
  • protonmail/events.go: EventRefreshCalendar + EventCalendarEvent

  • cmd/hydroxide/main.go: New --caldav-port flag, caldav serve command

  • go.mod / go.sum: Added go-webdav/caldav dependency

Implementation notes

  • CardDAV implementation used as template (carddav/carddav.go)
  • go-webdav/caldav library handles all CalDAV protocol handling
  • PGP encryption follows same pattern as ContactCard crypto
  • Calendar creation is forbidden (matches CardDAV address book pattern)

Closes #207

@bobbiejaxn
Copy link
Copy Markdown
Author

Ping @emersion — this PR is a complete CalDAV implementation that mirrors the existing CardDAV backend pattern. It's mergeable with a clean diff. The other open CalDAV PRs (#282 has merge conflicts / dirty state, #329 is minimal with only ListCalendars) are less comprehensive. Happy to address any review feedback.

Implements caldav.Backend interface bridging ProtonMail Calendar API
to standard CalDAV protocol (RFC 4791).

- New caldav/caldav.go (452 lines): full Backend implementation
- Extended protonmail/calendar.go: 7 new API methods + PGP decrypt/sign
- Extended protonmail/events.go: EventRefreshCalendar support
- Extended cmd/hydroxide/main.go: --caldav-port, caldav serve command
- Updated go.mod/go.sum for go-webdav/caldav dependency

CardDAV implementation used as template. Builds and vets clean.

Closes emersion#207
@bobbiejaxn
Copy link
Copy Markdown
Author

I've rebased this PR onto the latest master. The merge conflict in has been resolved (kept the newer upstream dependency versions alongside the dependency needed for CalDAV). CI should be re-triggering shortly. Would appreciate a review when you have capacity.

@bobbiejaxn
Copy link
Copy Markdown
Author

I've rebased this PR onto the latest master. The merge conflict in go.mod has been resolved (kept the newer upstream dependency versions alongside the rrule-go dependency needed for CalDAV). CI should be re-triggering shortly. Would appreciate a review when you have capacity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CalDAV support

1 participant