Changeset 113
- Timestamp:
- 08/22/07 11:17:13
- Files:
-
- AuthKit/branches/0.4/AuthKit.egg-info/PKG-INFO (modified) (1 diff)
- AuthKit/branches/0.4/AuthKit.egg-info/SOURCES.txt (modified) (2 diffs)
- AuthKit/branches/0.4/authkit/authenticate/open_id.py (modified) (7 diffs)
- AuthKit/branches/0.4/examples/docs/open_id_sreg.py (added)
- AuthKit/branches/0.4/test/test.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
AuthKit/branches/0.4/AuthKit.egg-info/PKG-INFO
r110 r113 1 1 Metadata-Version: 1.0 2 2 Name: AuthKit 3 Version: 0.4.0dev-r 983 Version: 0.4.0dev-r112 4 4 Summary: An authentication and authorization toolkit for WSGI applications and frameworks 5 Home-page: http:// 3aims.com/5 Home-page: http://authkit.org/ 6 6 Author: James Gardner 7 7 Author-email: james@pythonweb.org AuthKit/branches/0.4/AuthKit.egg-info/SOURCES.txt
r110 r113 76 76 examples/docs/form.py 77 77 examples/docs/forward.py 78 examples/docs/ passurl.py78 examples/docs/open_id.py 79 79 examples/docs/redirect.py 80 80 examples/user/database/README.txt … … 84 84 ez_setup/README.txt 85 85 ez_setup/__init__.py 86 test/model.py 86 87 test/test.py 87 test/test_model.py88 88 test/user_file_data.txt AuthKit/branches/0.4/authkit/authenticate/open_id.py
r112 r113 78 78 with_path_info=False 79 79 ) 80 # XXX For registration support this should render hidden fields81 # with the sreg options82 80 content = render( 83 81 self.template, … … 145 143 urltouser=None, 146 144 charset=None, 145 sreg_required=None, 146 sreg_optional=None, 147 sreg_policyurl=None 147 148 ): 148 149 self.conn, self.store = make_store(store_type, store_config) … … 161 162 else: 162 163 self.charset = '; charset='+charset 163 164 self.sreg_required = sreg_required 165 self.sreg_optional = sreg_optional 166 self.sreg_policyurl = sreg_policyurl 167 164 168 def __call__(self, environ, start_response): 165 169 # If we are called it is because we want to sign in, so show the … … 183 187 184 188 def verify(self, environ, start_response): 185 # XXX This method should accept sreg options and continue with them186 189 baseurl = self.baseurl or construct_url( 187 190 environ, … … 268 271 trust_root = baseurl 269 272 return_to = baseurl + self.path_process 273 if self.sreg_required: 274 request_.addExtensionArg('sreg', 'required', self.sreg_required) 275 if self.sreg_optional: 276 request_.addExtensionArg('sreg', 'optional', self.sreg_optional) 277 if self.sreg_policyurl: 278 request_.addExtensionArg('sreg', 'policy_url', self.sreg_policyurl) 279 270 280 redirect_url = request_.redirectURL(trust_root, return_to) 271 281 start_response( … … 299 309 elif info.status == consumer.SUCCESS: 300 310 username = info.identity_url 311 user_data = str(info.extensionResponse( 'sreg' )) 301 312 # Set the cookie 302 313 if self.urltouser: 303 314 username = self.urltouser(environ, info.identity_url) 304 environ['paste.auth_tkt.set_user'](username )315 environ['paste.auth_tkt.set_user'](username, user_data=user_data) 305 316 # Return a page that does a meta refresh 306 317 response = """ … … 405 416 urltouser = urltouser, 406 417 charset = auth_conf.get('charset'), 418 sreg_required=auth_conf.get('sreg.required'), 419 sreg_optional=auth_conf.get('sreg.optional'), 420 sreg_policyurl=auth_conf.get('sreg.policyurl') 407 421 ) 408 422 session_middleware = 'beaker.session' AuthKit/branches/0.4/test/test.py
r106 r113 20 20 from digest import app as digest_app 21 21 from forward import app as forward_app 22 from passurl import app as passurl_app22 from open_id import app as openid_app 23 23 from redirect import app as redirect_app 24 24 … … 43 43 digest_app, 44 44 forward_app, 45 passurl_app,45 openid_app, 46 46 redirect_app, 47 47 config_app, … … 133 133 assert 'Please Sign In' in res 134 134 135 def test_ passurl_fail():136 res = TestApp( passurl_app).get('/private')135 def test_openid_fail(): 136 res = TestApp(openid_app).get('/private') 137 137 assertEqual(res.header('content-type'),'text/html; charset=UTF-8') 138 138 assertEqual(res.full_status, '200 OK')
