Changeset 150

Show
Ignore:
Timestamp:
03/14/08 14:36:35
Author:
thejimmyg
Message:

Updated the database example and fixed #43

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • AuthKit/trunk/CHANGELOG.txt

    r148 r150  
    440.4.1 (**svn**) 
    55 
     6* Updated the user/database example, it now works #43 
     7* Updated user tokens code to fix #17 
    68* Updated authkit.authenticate.multi so that it should fix #41 and pass 
    79  the WSGI writable from start_response() correctly. 
  • AuthKit/trunk/authkit/authenticate/__init__.py

    r133 r150  
    217217                    user_object,  
    218218                    encrypt=encrypt,  
    219                     data=user_conf['data'] 
     219                    data=user_conf.get('data'), 
    220220                ) 
    221221                log.debug("Setting up authkit.users middleware") 
  • AuthKit/trunk/examples/user/database/app.py

    r141 r150  
    3131        elif path == '/': 
    3232            return self.index(environ, start_response) 
     33        elif path == '/signout': 
     34            return self.signout(environ, start_response) 
    3335        else: 
    3436            start_response("404 Not Found", [("Content-type","text/plain")]) 
     
    4547 
    4648    # Induvidual pages 
     49    def signout(self, environ, start_response): 
     50        start_response('200 OK', [('Content-type','text/html')]) 
     51        return ['Signed out'] 
     52 
    4753    def index(self, environ, start_response): 
    4854        return self._access_granted( 
     
    5460            <li><a href="/admin">Only signed in users with the <tt>admin</tt> role have access [ben]</a></li> 
    5561            <li><a href="/group">Only signed in users in the <tt>pylons</tt> group have access [james]</a></li> 
     62            <li><a href="/signout">Sign out</a></li> 
    5663            </ul> 
     64            <p>The code is set up like this:</p> 
     65<pre> 
     66    users.group_create("pylons") 
     67    users.role_create("admin") 
     68    users.user_create("james", password="password1", group="pylons") 
     69    users.user_create("ben", password="password2") 
     70    users.user_add_role("ben", role="admin") 
     71</pre> 
    5772            """ 
    5873        ) 
     
    8297    form_authenticate_user_type = "authkit.users.sqlalchemy_04_driver:UsersFromDatabase", 
    8398    cookie_signoutpath = '/signout', 
    84     # setup_intercept = "401, 403", 
     99    setup_intercept = "401, 403", 
    85100) 
    86101app = SQLAlchemyManager(app, {'sqlalchemy.url':'sqlite:///test.db'}, [authkit.users.sqlalchemy_04_driver.setup_model])