Add Apple iCloud adapter - #272
Conversation
- Implement CalDAV client for Apple iCloud calendars - Support basic auth with Apple ID + app-specific passwords - Dynamic calendar discovery and friendly name resolution - Full CRUD operations for calendar events - iCalendar parsing using go-ical library - Seamless integration with existing adapter pattern
- Fix CalDAV PUT request paths using resolved principal/calendar IDs - Add required If-None-Match header for new event creation - Implement thread-safe calendar resolution caching with sync.Once - Combine CreateEvent/UpdateEvent methods to reduce duplication - Resolve Google->Apple sync 400 Bad Request errors
02bda05 to
1f3277c
Compare
- Generate consistent SyncID from iCal UID for better event matching - Add 412 Precondition Failed error handling in CreateEvent - Gracefully fallback to update operation when event already exists This resolves conflicts in bidirectional sync scenarios where the same logical event exists in both calendars with different UIDs, preventing CalDAV 412 errors while maintaining sync functionality.
|
I would love to make use of this. I tried the Zep adapter as mentioned in #227 but no luck there. |
|
@mmisiewicz, just copy my branch and compile it from source with Use the compiled Cron runs the daily bidirectional sync between my Primary (Apple) calendar and Work (Google Workspace) calendar. |
|
Can confirm it's working great for me and I'd love to see this merged! |
|
@MichaelEischer why is this one not moving? |
| if err := c.SetupAuth(ctx, credentials, storage, bindPort); err != nil { | ||
| return nil, err | ||
| } | ||
| } else if c, ok := client.(port.OAuth2Adapter); ok { | ||
| if err := c.SetupOauth2(ctx, credentials, storage, bindPort); err != nil { |
There was a problem hiding this comment.
Given it's the same arguments, wouldn't it be simpler/smaller change to keep the same SetupOauth2 method/interface?
|
@pavsap sorry about the delay. Would you maybe rebase and revisit this PR once more? |
|
@frittentheke No worries, thanks for getting back. I'll rebase onto the current main and revisit the PR in my spare time. As for testing, I don't have a setup right now, but I'll think about how to test this without an active Apple Calendar account and report back. |
Overview
This PR adds support for Apple iCloud calendars via the CalDAV protocol, enabling users to sync their iCloud calendars with CalendarSync.
Features
github.com/emersion/go-icalConfiguration Example
Implementation Details
Setup Requirements
Testing
☑️ Authentication with Apple ID + app-specific password
☑️ Calendar discovery and name resolution
☑️ Event reading from iCloud calendars
☑️ Integration with existing CalendarSync architecture
Recent Updates
☑️ Fixed CalDAV event creation (resolved 400 Bad Request errors)
☑️ Added thread-safe calendar resolution caching for performance
☑️ Fixed Google->Apple sync functionality