wildcard domain for "sibling" domains

88 views
Skip to first unread message

Jason

unread,
Mar 27, 2012, 3:18:58 PM3/27/12
to pylons...@googlegroups.com
I would like the auth ticket authentication policy to also set the wild card domain for domains one level up from the current domain. For example: An application running on the domain x.y.foo.com would have ".y.foo.com" set as the domain for one of the cookies. I'm using this to allow app01.mydomain.com and app02.mydomain.com to use the same auth ticket cookie for authentication. Currently I am also using a similarly patched repoze.who so that this works across old Pylons applications and new Pyramid apps, but I couldn't figure out how to send a patch to the repoze.who project that would only apply to repoze.who version 1.

I've already created a patch and made a pull request ( https://github.com/Pylons/pyramid/pull/450 ), but is this likely to be an acceptable addition to Pyramid, especially given that it adds a dependency on the publicsuffix package ( http://pypi.python.org/pypi/publicsuffix )?

If its unlikely to be accepted, I would like to know so that I can create a new auth ticket authentication policy instead.

Thanks,

Jason

Chris McDonough

unread,
Mar 27, 2012, 3:39:32 PM3/27/12
to pylons...@googlegroups.com

Yeah I fear a reliance on that package is not in the cards for Pyramid
right now. I also fear that the cookie helper is already a little out
of control right now with cookie options and I'm loath to add more to it
without trying to reconcile all of them.

- C

Wichert Akkerman

unread,
Mar 27, 2012, 4:09:31 PM3/27/12
to pylons...@googlegroups.com, Chris McDonough
On 2012-3-27 21:39, Chris McDonough wrote:
> On Tue, 2012-03-27 at 12:18 -0700, Jason wrote:
>> I would like the auth ticket authentication policy to also set the
>> wild card domain for domains one level up from the current domain. For
>> example: An application running on the domain x.y.foo.com would have
>> ".y.foo.com" set as the domain for one of the cookies. I'm using this
>> to allow app01.mydomain.com and app02.mydomain.com to use the same
>> auth ticket cookie for authentication. Currently I am also using a
>> similarly patched repoze.who so that this works across old Pylons
>> applications and new Pyramid apps, but I couldn't figure out how to
>> send a patch to the repoze.who project that would only apply to
>> repoze.who version 1.

[..]

>> If its unlikely to be accepted, I would like to know so that I can
>> create a new auth ticket authentication policy instead.
>
> Yeah I fear a reliance on that package is not in the cards for Pyramid
> right now. I also fear that the cookie helper is already a little out
> of control right now with cookie options and I'm loath to add more to it
> without trying to reconcile all of them.

I'ld agree. I'm guessing it's also pretty trivial to wrap the standard
auth ticket class to do this in your own code.

Wichert.

--
Wichert Akkerman <wic...@wiggy.net> It is simple to make things.
http://www.wiggy.net/ It is hard to make things simple.

Jason

unread,
Mar 27, 2012, 4:33:53 PM3/27/12
to pylons...@googlegroups.com


On Tuesday, March 27, 2012 3:39:32 PM UTC-4, Chris McDonough wrote:

Yeah I fear a reliance on that package is not in the cards for Pyramid
right now.  I also fear that the cookie helper is already a little out
of control right now with cookie options and I'm loath to add more to it
without trying to reconcile all of them.

- C


I can dig it. I will close the pull request and just sub-class the current  AuthTktAuthenticationPolicy and AuthTktCookieHelper to extend the __init__ methods and the AuthTktCookieHelper._get_cookies method.

-- Jason
Reply all
Reply to author
Forward
0 new messages