[CalendarServer-users] Has UID/GUID syntax changed from CalendarServer-5.2.2 to 6.0

Andre LaBranche dre at apple.com
Wed Mar 18 13:58:39 PDT 2015


Hi,

The path component in /calendars/users/____ is the UID value from the user record, which typically looks like a shortname.

You can also use /principals/__uids__/____, where the missing component is the GUID. In cases where GUID is not specified in the record, the UID value appears to be usable instead.

To see this all in action, use a web browser to load up /principals/users/foo (where ‘foo’ is a valid user UID). Note the Principal URL, Alternate URIs, and Calendar Homes.

-dre

> On Mar 18, 2015, at 1:44 PM, Gaurav Jain <monkeyfdude at gmail.com> wrote:
> 
> Thank you very much for clarifications.
> 
> I have one more question, for GET requests what is the identifier for the user
> 
> is it UID, GUID, short-name or emailAdress??
> 
> I mean in following URL
> 
> /calendars/users/_____$________/calendar.......what is the value of $ in DCS 6.0???
> 
> 
> 
> On Wed, Mar 18, 2015 at 1:36 PM, Andre LaBranche <dre at apple.com <mailto:dre at apple.com>> wrote:
> Hi,
> 
> This is OK:
> 
> <record type="user">
>     <uid>dre</uid>
>     <guid>10000042-0000-0000-0000-000000000001</guid>
>     <short-name>dre</short-name>
>     <password>dre</password>
>     <full-name>Andre LaBranche</full-name>
>     <email>dre at apple.com <mailto:dre at apple.com></email>
> </record>
> 
> e.g.
> 
> andre at xomg [~/cs] % ./bin/calendarserver_manage_principals --search dre
> 1 matches found:
> 
> Andre LaBranche (user)
>    UID: dre
>    Record name: dre
>    Email: dre at apple.com <mailto:dre at apple.com>
> 
> 
> However, this is not OK:
> 
> <record type="user">
>     <uid>dre</uid>
>     <guid>dre</guid>
>     <short-name>dre</short-name>
>     <password>dre</password>
>     <full-name>Andre LaBranche</full-name>
>     <email>dre at apple.com <mailto:dre at apple.com></email>
> </record>
> 
> Startup fails:
> 2015-03-18 13:32:47-0700 [-] [txdav.base.datastore.subpostgres#critical] Can't start or connect to postgres: badly formed hexadecimal UUID string
> 
> To summarize, UID can be a short string or an actual UUID, however GUID must be a UUID if it is present. It doesn’t seem to be an error to omit GUID.
> 
> -dre
> 
>> On Mar 18, 2015, at 11:19 AM, Gaurav Jain <monkeyfdude at gmail.com <mailto:monkeyfdude at gmail.com>> wrote:
>> 
>> Full Stacktrace
>> 
>>         Traceback (most recent call last):
>>           File "/var/caldav/CalendarServer-6.0/.develop/virtualenv/local/lib/python2.7/site-packages/twisted/internet/_baseprocess.py", line 60, in maybeCallProcessEnded
>>             proto.processEnded(Failure(reason))
>>           File "/var/caldav/CalendarServer-6.0/txdav/base/datastore/subpostgres.py", line 164, in processEnded
>>             self.deferred.callback(''.join(self.output))
>>           File "/var/caldav/CalendarServer-6.0/.develop/virtualenv/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 382, in callback
>>             self._startRunCallbacks(result)
>>           File "/var/caldav/CalendarServer-6.0/.develop/virtualenv/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 490, in _startRunCallbacks
>>             self._runCallbacks()
>>         --- <exception caught here> ---
>>           File "/var/caldav/CalendarServer-6.0/.develop/virtualenv/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 577, in _runCallbacks
>>             current.result = callback(current.result, *args, **kw)
>>           File "/var/caldav/CalendarServer-6.0/txdav/base/datastore/subpostgres.py", line 500, in gotStatus
>>             self.ready(*createConnection())
>>           File "/var/caldav/CalendarServer-6.0/txdav/base/datastore/subpostgres.py", line 390, in ready
>>             self.produceConnection, self
>>           File "/var/caldav/CalendarServer-6.0/calendarserver/tap/caldav.py", line 1513, in subServiceFactory
>>             config, store=store, serversDB=serversDB
>>           File "/var/caldav/CalendarServer-6.0/txdav/who/util.py", line 75, in directoryFromConfig
>>             serversDB=serversDB
>>           File "/var/caldav/CalendarServer-6.0/txdav/who/util.py", line 245, in buildDirectory
>>             userDirectory.realmName,
>>           File "/var/caldav/CalendarServer-6.0/.develop/virtualenv/src/twextpy/twext/who/xml.py", line 198, in realmName
>>             self.loadRecords()
>>           File "/var/caldav/CalendarServer-6.0/.develop/virtualenv/src/twextpy/twext/who/xml.py", line 307, in loadRecords
>>             self.parseRecordNode(recordNode, unknownFieldElements)
>>           File "/var/caldav/CalendarServer-6.0/.develop/virtualenv/src/twextpy/twext/who/xml.py", line 370, in parseRecordNode
>>             value = valueType(fieldNode.text)
>>           File "/usr/lib/python2.7/uuid.py", line 134, in __init__
>>             raise ValueError('badly formed hexadecimal UUID string')
>>         exceptions.ValueError: badly formed hexadecimal UUID string
>> 
>> 
>> On Wed, Mar 18, 2015 at 11:09 AM, Gaurav Jain <monkeyfdude at gmail.com <mailto:monkeyfdude at gmail.com>> wrote:
>> This was a valid XML in CalendarServer-5.2.2. It used to be 'user' now its 'record'
>> 
>> I could have a UID as 'gauravj'
>> 
>> <directory realm="Test Realm">
>>   <record>
>>     <uid>0C8BDE62-E600-4696-83D3-8B5ECABDFD2E</uid>
>>     <guid>0C8BDE62-E600-4696-83D3-8B5ECABDFD2E</guid>
>>     <short-name>admin</short-name>
>>     <password>admin</password>
>>     <full-name>Super User</full-name>
>>     <email>admin at example.com <mailto:admin at example.com></email>
>>   </record>
>>   <record>
>>     <uid>gauravj</uid>
>>     <guid>gauravj</guid>
>>     <password>some_password</password>
>>     <email>gauravj at example.com <mailto:gauravj at example.com></email>
>>     <full-name>G J</full-name>
>>     <short-name>G</short-name>
>>   </record>
>> </directory>
>> 
>> 
>> But I CalendarServer-6.0, I get
>> 
>>           File "/usr/lib/python2.7/uuid.py", line 134, in __init__
>>             raise ValueError('badly formed hexadecimal UUID string')
>>         exceptions.ValueError: badly formed hexadecimal UUID string
>> 
>> 
>> 
>> Could you please tell me if I could use the above xml with 6.0??
>> 
>> 
>> Best Regards,
>> 
>> 
>> _______________________________________________
>> calendarserver-users mailing list
>> calendarserver-users at lists.macosforge.org <mailto:calendarserver-users at lists.macosforge.org>
>> https://lists.macosforge.org/mailman/listinfo/calendarserver-users <https://lists.macosforge.org/mailman/listinfo/calendarserver-users>
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-users/attachments/20150318/391623e4/attachment.html>


More information about the calendarserver-users mailing list