[Pypi-checkins] r975 - trunk/pypi

richard python-checkins at python.org
Mon Sep 5 06:25:10 CEST 2011


Author: richard
Date: Mon Sep  5 06:25:10 2011
New Revision: 975

Modified:
   trunk/pypi/webui.py
Log:
fix identity extraction based on remapped url

Modified: trunk/pypi/webui.py
==============================================================================
--- trunk/pypi/webui.py	(original)
+++ trunk/pypi/webui.py	Mon Sep  5 06:25:10 2011
@@ -2949,6 +2949,9 @@
         if p.returncode != 0:
             raise FormError, "Key processing failed. Please contact the administrator. Detail: "+stdout
 
+    #
+    # OpenID Provider
+    #
     def openid_discovery(self):
         """Return an XRDS document containing an OpenID provider endpoint URL."""
         payload = '''<xrds:XRDS
@@ -3089,8 +3092,8 @@
             return False
         if identity == 'http://specs.openid.net/auth/2.0/identifier_select':
             return False
-        qs = urlparse.urlparse(identity).query
-        if urlparse.parse_qs(qs).get("username",[None])[0] != self.username:
+        username = urlparse.urlparse(identity).path.split('/')[-1]
+        if username != self.username:
             # identity is not owned by user so decline the request
             False
 


More information about the Pypi-checkins mailing list