Re: shared xDAV resources

2018-04-07 Thread Bron Gondwana
Ken knows this code best.  I bet there's something which is requiring
that there's a user on the mboxname because we implement the same
behaviour at FastMail by having a separate user on which shared
resources are kept.  The DAV resources are stored per-user, and
without a place to keep them for "shared calendars" that code might
just not be accessible.  I'm sure it would be possible to create a
shared DAV database as well for this case, but it just needs some
programming effort.
Bron.


On Sun, 8 Apr 2018, at 07:30, Anatoli wrote:
> Hi All,
> 
>  I'm trying to understand the code responsible for enumerating user
>  calendars (and xDAV resources in general) to try to make the
>  discovery work for shared resources too (currently there's no way to
>  access shared resources with Apple xDAV client implementation, yes
>  with Thunderbird as it doesn't use the discovery mechanism, but
>  instead should be pointed to the exact URL for each calendar). If I
>  understand it correctly, the functionality is in imap/http_caldav.c.> 
>  Could you please point me to the place where the enumeration occurs
>  and briefly mention how the general workflow looks like?> 
>  The client asks for:
> 
> PROPFIND /dav/calendars/user//
>
>   ...> 
>  The server responds with:
> 
> HTTP/1.1 207 Multi-Status
>
>  
>
>  /dav/calendars/user//
>   ... 
>
>  /dav/calendars/user//Default/
>  
> ...> 
>  The idea is to include in the returned lists the shared calendars too
>  with the discovery logic based on the IMAP shared folders.> 
>  Below goes the initial exchange between the calendar app on iOS
>  10.2.6 and Cyrus 3.0.5 when the exact URL (/dav/calendars/shared/)
>  for the shared calendar is provided in the advanced settings of the
>  app (the URL finally resets to the user principals folder
>  (/dav/principals/user/t...@domain.com/) as iOS is pointed to it by
>  Cyrus). In the attached file goes the telemetry for the rest of the
>  communication.> 
>  Thanks,
>  Anatoli
> 
> -- t...@domain.com Sun Mar 25 06:05:36 2018
>
>  <1521968736<*PROPFIND* */dav/calendars/shared/* HTTP/1.1 Accept: */*
>  Content-type: text/xml Connection: keep-alive Content-length: 181
>  Host: mail.domain.com User-agent: iOS/11.2.6 (15D100) accountsd/1.0
>  Prefer: return=minimal Depth: 0 Brief: t Accept-language: en-us
>  Authorization: Basic ... Accept-encoding: br, gzip, deflate
>
>  <1521968736<   xmlns:A="DAV:">
>
>  
>  
>
>
>
>  >1521968736>HTTP/1.1 207 Multi-Status
>  Date: Sun, 25 Mar 2018 09:05:36 GMT Strict-Transport-Security: max-
>  age=600 Vary: Accept-Encoding, Brief, Prefer Preference-Applied:
>  return=minimal Content-Type: application/xml; charset=utf-8 Content-
>  Length: 546
>
> xmlns:C="urn:ietf:params:xml:ns:caldav">
>
>  */dav/calendars/shared/*
>  
>
>  
>*/dav/principals/user/t...@domain.com/* 
>principal>
>  
>
>  
>HTTP/1.1 200 OK 
>
>
>  <1521968736  Host: mail.domain.com Connection: keep-alive Accept: */* User-Agent:
>  iOS/11.2.6 (15D100) accountsd/1.0 Accept-Language: en-us Content-
>  Length: 0 Accept-Encoding: br, gzip, deflate
>
>  >1521968736>HTTP/1.1 200 OK
>  Date: Sun, 25 Mar 2018 09:05:36 GMT Strict-Transport-Security: max-
>  age=600 Cache-Control: no-cache Link: ;
>  rel="server-info"; token="80769c2c66d340ecd178710db26d56b9c4699e3e"
>  DAV: 1, 2, 3, access-control, extended-mkcol, resource-sharing DAV:
>  calendar-access, calendar-auto-schedule DAV: calendar-query-extended,
>  calendar-availability, calendar-managed-attachments DAV: calendarserver-
>  sharing, inbox-availability DAV: addressbook Allow: OPTIONS, GET,
>  HEAD Allow: PROPFIND, REPORT, COPY Content-Length: 0> Email had 1 attachment:


>  * telemetry.log
>   36k (text/x-log)

--
  Bron Gondwana, CEO, FastMail Pty Ltd
  br...@fastmailteam.com




shared xDAV resources

2018-04-07 Thread Anatoli

Hi All,

I'm trying to understand the code responsible for enumerating user 
calendars (and xDAV resources in general) to try to make the discovery 
work for shared resources too (currently there's no way to access shared 
resources with Apple xDAV client implementation, yes with Thunderbird as 
it doesn't use the discovery mechanism, but instead should be pointed to 
the exact URL for each calendar). If I understand it correctly, the 
functionality is in imap/http_caldav.c.


Could you please point me to the place where the enumeration occurs and 
briefly mention how the general workflow looks like?


The client asks for:

PROPFIND /dav/calendars/user//


...

The server responds with:

HTTP/1.1 207 Multi-Status


  
/dav/calendars/user//
    
...
  
  
/dav/calendars/user//Default/
    
  
...

The idea is to include in the returned lists the shared calendars too 
with the discovery logic based on the IMAP shared folders.


Below goes the initial exchange between the calendar app on iOS 10.2.6 
and Cyrus 3.0.5 when the exact URL (/dav/calendars/shared/) for the 
shared calendar is provided in the advanced settings of the app (the URL 
finally resets to the user principals folder 
(/dav/principals/user/t...@domain.com/) as iOS is pointed to it by Cyrus). 
In the attached file goes the telemetry for the rest of the communication.


Thanks,
Anatoli

-- t...@domain.com Sun Mar 25 06:05:36 2018

<1521968736<*PROPFIND* */dav/calendars/shared/* HTTP/1.1
Accept: */*
Content-type: text/xml
Connection: keep-alive
Content-length: 181
Host: mail.domain.com
User-agent: iOS/11.2.6 (15D100) accountsd/1.0
Prefer: return=minimal
Depth: 0
Brief: t
Accept-language: en-us
Authorization: Basic ...
Accept-encoding: br, gzip, deflate

<1521968736<

  
    
    
    
  



>1521968736>HTTP/1.1 207 Multi-Status
Date: Sun, 25 Mar 2018 09:05:36 GMT
Strict-Transport-Security: max-age=600
Vary: Accept-Encoding, Brief, Prefer
Preference-Applied: return=minimal
Content-Type: application/xml; charset=utf-8
Content-Length: 546



  
    */dav/calendars/shared/*
    
  
    
  */dav/principals/user/t...@domain.com/*
    
    
  
  
    
  
  HTTP/1.1 200 OK
    
  


<15219687361521968736>HTTP/1.1 200 OK
Date: Sun, 25 Mar 2018 09:05:36 GMT
Strict-Transport-Security: max-age=600
Cache-Control: no-cache
Link: ; rel="server-info"; 
token="80769c2c66d340ecd178710db26d56b9c4699e3e"

DAV: 1, 2, 3, access-control, extended-mkcol, resource-sharing
DAV: calendar-access, calendar-auto-schedule
DAV: calendar-query-extended, calendar-availability, 
calendar-managed-attachments

DAV: calendarserver-sharing, inbox-availability
DAV: addressbook
Allow: OPTIONS, GET, HEAD
Allow: PROPFIND, REPORT, COPY
Content-Length: 0
-- t...@domain.com Sun Mar 25 06:05:38 2018

<1521968738

  




http://calendarserver.org/ns/"/>
http://calendarserver.org/ns/"/>
http://calendarserver.org/ns/"/>






  

>1521968738>HTTP/1.1 207 Multi-Status
Date: Sun, 25 Mar 2018 09:05:38 GMT
Strict-Transport-Security: max-age=600
Vary: Accept-Encoding, Brief, Prefer
Preference-Applied: return=minimal
Content-Type: application/xml; charset=utf-8
Content-Length: 1955


http://calendarserver.org/ns/;>
  
/dav/principals/user/t...@domain.com/

  

  /dav/calendars/user/t...@domain.com/


  mailto:t...@domain.com


  /dav/principals/user/t...@domain.com/

t...@domain.com

  /dav/notifications/user/t...@domain.com/


  /dav/principals/user/


  /dav/principals/user/t...@domain.com/


  /dav/calendars/user/t...@domain.com/Inbox/


  /dav/calendars/user/t...@domain.com/Outbox/


  

  

  
  

  

  
  

  

  

  
  HTTP/1.1 200 OK

  

-- t...@domain.com Sun Mar 25 06:05:38 2018

<15219687381521968738>HTTP/1.1 200 OK
Date: Sun, 25 Mar 2018 09:05:38 GMT
Strict-Transport-Security: max-age=600
Cache-Control: no-cache
Link: ; rel="server-info"; token="80769c2c66d340ecd178710db26d56b9c4699e3e"
DAV: 1, 2, 3, access-control, extended-mkcol, resource-sharing
DAV: calendar-access, calendar-auto-schedule
DAV: calendar-query-extended, calendar-availability, calendar-managed-attachments
DAV: calendarserver-sharing, inbox-availability
DAV: addressbook
Allow: OPTIONS, GET, HEAD
Allow: PROPFIND, REPORT, COPY
Content-Length: 0

<1521968738

  

http://calendarserver.org/ns/"/>
http://apple.com/ns/ical/"/>
http://me.com/_namespace/"/>

http://apple.com/ns/ical/"/>


http://apple.com/ns/ical/"/>