From 455eeda1f479b771efac0a40d37de0e847cd3543 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 11 Oct 2011 08:07:56 -0400 Subject: docstring --- pyramid/authentication.py | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/pyramid/authentication.py b/pyramid/authentication.py index ef64a361d..e1834054d 100644 --- a/pyramid/authentication.py +++ b/pyramid/authentication.py @@ -410,26 +410,16 @@ class AuthTicket(object): Once you provide all the arguments, use .cookie_value() to generate the appropriate authentication ticket. - CGI usage:: + Usage:: - token = auth_tkt.AuthTick('sharedsecret', 'username', + token = AuthTicket('sharedsecret', 'username', os.environ['REMOTE_ADDR'], tokens=['admin']) - print 'Status: 200 OK' - print 'Content-type: text/html' - print token.cookie() - print - ... redirect HTML ... + val = token.cookie_value() - Webware usage:: - - token = auth_tkt.AuthTick('sharedsecret', 'username', - self.request().environ()['REMOTE_ADDR'], tokens=['admin']) - self.response().setCookie('auth_tkt', token.cookie_value()) """ def __init__(self, secret, userid, ip, tokens=(), user_data='', - time=None, cookie_name='auth_tkt', - secure=False): + time=None, cookie_name='auth_tkt', secure=False): self.secret = secret self.userid = userid self.ip = ip -- cgit v1.2.3