From: Marty Alchin <gulop...@gmail.com>
Date: Fri, 25 Sep 2009 08:57:42 -0400
Local: Fri, Sep 25 2009 8:57 am
Subject: Re: Adding signing (and signed cookies) to Django core
On Fri, Sep 25, 2009 at 7:02 AM, Luke Plant <L.Plant...@cantab.net> wrote: This was something I was concerned with when I put together my app, so > Suppose one part of an app signs an e-mail address for the purpose of > an account confirmation link sent in an e-mail. The user won't be > able to forge the link unless they know HMAC(SECRET_KEY, email). > However, suppose another part of the website allows a user to set I just added the name of the cookie to the signature as well, rather than requiring some other explicit prefix. Since the two parts of the application would need to use different names anyway to avoid other problems, I figured the cookie name alone would be sufficient. If we end up with something like response.set_signed_cookie() or response.set_cookie(..., signed=True), the cookie name would be available to the signing code internally, without any need to add in some other key. Of course, it'd still be worth documenting for the case of using the > So I propose: I think this is good for everywhere the raw signing API is accessed, > - we add unique prefixes to the SECRET_KEY for every different perhaps to the point where that API can't even be used without a key (a namespace, really - honking great idea!). Helpers on top of that API could do without asking for that separately, if they can retrieve a reasonable key from other forms of input, such as a cookie name or a query-string argument name. -Gul You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||