[swift-corelibs-dev] Implementing HTTPCookieStorage

Tony Parker anthony.parker at apple.com
Mon Jan 23 11:30:11 CST 2017


Here is the branch where I started the work but didn’t get too far.

https://github.com/parkera/swift-corelibs-foundation/tree/parkera/xdg_implementation

One tricky part is that we need to figure out a way to test this stuff without exposing public API from file manager…

- Tony

> On Jan 23, 2017, at 2:09 AM, Pushkar N Kulkarni <pushkar.nk at in.ibm.com> wrote:
> 
> Hi Tony, 
> 
> Thanks! A starting point will really help. 
> 
> I've filed a feature request on JIRA: https://bugs.swift.org/browse/SR-3697 <https://bugs.swift.org/browse/SR-3697>
> 
> Pushkar N Kulkarni,
> IBM Runtimes
> 
> Simplicity is prerequisite for reliability - Edsger W. Dijkstra
> 
> 
> 
> -----anthony.parker at apple.com <mailto:-----anthony.parker at apple.com> wrote: -----
> To: Pushkar N Kulkarni <pushkar.nk at in.ibm.com <mailto:pushkar.nk at in.ibm.com>>
> From: Tony Parker 
> Sent by: anthony.parker at apple.com <mailto:anthony.parker at apple.com>
> Date: 01/20/2017 11:28PM
> Cc: Will Stanton <willstanton1 at yahoo.com <mailto:willstanton1 at yahoo.com>>, swift-corelibs-dev <swift-corelibs-dev at swift.org <mailto:swift-corelibs-dev at swift.org>>
> Subject: Re: [swift-corelibs-dev] Implementing HTTPCookieStorage
> 
> Yup, I think that makes sense.
> 
> I started an implementation a bit ago but didn’t get very far before I got derailed onto some other topics. I’ll see if I can clean it up and put it somewhere as a starting point.
> 
> - Tony
> 
>> On Jan 20, 2017, at 2:31 AM, Pushkar N Kulkarni <pushkar.nk at in.ibm.com <mailto:pushkar.nk at in.ibm.com>> wrote:
>> 
>> Hi Tony, Will, others: 
>> 
>> Apologies for bringing this up after a long time!
>> 
>> I hope we still agree on the use of the "XDG Base Directory Specification". I did a quick read of the spec document. 
>> 
>> I am happy to file a JIRA report for this.
>> 
>> The scope, as I understand it is: CoreFoundation will implement the "XDG Base Directory Specification" and present an API to allow Foundation to retrieve the different absolute paths(related to the different env variables defined), which will be used to persist the different kinds of user data.
>> 
>> Please do let me know if my understanding is correct. Please augment it if necessary. 
>> 
>> Thanks!
>> Pushkar N Kulkarni,
>> IBM Runtimes
>> 
>> Simplicity is prerequisite for reliability - Edsger W. Dijkstra
>> 
>> 
>> 
>> -----swift-corelibs-dev-bounces at swift.org <mailto:-----swift-corelibs-dev-bounces at swift.org> wrote: -----
>> To: Will Stanton <willstanton1 at yahoo.com <mailto:willstanton1 at yahoo.com>>
>> From: Tony Parker via swift-corelibs-dev 
>> Sent by: swift-corelibs-dev-bounces at swift.org <mailto:swift-corelibs-dev-bounces at swift.org>
>> Date: 11/17/2016 03:45AM
>> Cc: swift-corelibs-dev <swift-corelibs-dev at swift.org <mailto:swift-corelibs-dev at swift.org>>
>> Subject: Re: [swift-corelibs-dev] Implementing HTTPCookieStorage
>> 
>> Hi Will,
>> 
>> > On Nov 14, 2016, at 12:56 PM, Will Stanton <willstanton1 at yahoo.com <mailto:willstanton1 at yahoo.com>> wrote:
>> > 
>> > Hello Tony,
>> > 
>> > Thanks for the reply. About XDG_DATA_HOME, the variable is undefined on my desktop-less server, and I think many processes still have their own save locations.
>> > Still, I can believe its used in a lot of places (https://github.com/search?q=XDG_DATA_HOME&type=Code&utf8= <https://github.com/search?q=XDG_DATA_HOME&type=Code&utf8=>✓) and am not opposed to it!
>> > 
>> > Perhaps SEARCH/$EXECUTABLE_NAME/Preferences.plist would be good place and format for NSUserDefaults with SEARCH = getenv(XDG_DATA_HOME) then ~/.config?
>> > 
>> > 
>> > What about the path for cookies+caches?
>> 
>> I’m just reading this spec for the first time, but it looks like it accounts for that:
>> 
>> > • There is a single base directory relative to which user-specific non-essential (cached) data should be written. This directory is defined by the environment variable $XDG_CACHE_HOME.
>> 
>> Overall the spec looks reasonable and seems to be close to what we we would need.
>> 
>> A great next step would be to file a JIRA and look for volunteers who want to help implement this in SCL-Foundation.
>> 
>> - Tony
>> 
>> > 
>> > Regards,
>> > Will Stanton
>> > 
>> >> On Nov 14, 2016, at 2:37 PM, Tony Parker via swift-corelibs-dev <swift-corelibs-dev at swift.org <mailto:swift-corelibs-dev at swift.org>> wrote:
>> >> 
>> >> Off-list, someone pointed me here:
>> >> 
>> >> https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html <https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html>
>> >> 
>> >> and here:
>> >> 
>> >> http://stackoverflow.com/questions/1024114/location-of-ini-config-files-in-linux-unix <http://stackoverflow.com/questions/1024114/location-of-ini-config-files-in-linux-unix>
>> >> 
>> >> Noting that there seems to be a growing consensus for $HOME/.config.
>> >> 
>> >> Is this spec beginning to be used in the real world?
>> > 
>> 
>> _______________________________________________
>> swift-corelibs-dev mailing list
>> swift-corelibs-dev at swift.org <mailto:swift-corelibs-dev at swift.org>
>> https://lists.swift.org/mailman/listinfo/swift-corelibs-dev <https://lists.swift.org/mailman/listinfo/swift-corelibs-dev>
>> 
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-corelibs-dev/attachments/20170123/e79ef38c/attachment.html>


More information about the swift-corelibs-dev mailing list