Skip to content

Commit

Permalink
Merge branch 'master' into google
Browse files Browse the repository at this point in the history
  • Loading branch information
adieu committed Feb 28, 2011
2 parents 789cc11 + 12efd78 commit 03773fb
Show file tree
Hide file tree
Showing 201 changed files with 81 additions and 31,596 deletions.
3 changes: 1 addition & 2 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ Some advantages of Yadis support are:

* Easy interoperability for different identity services

For more information about Yadis, see http://yadis.org/ or
http://www.openidenabled.com/yadis/
For more information about Yadis, see http://yadis.org/

Extension Support
-----------------
Expand Down
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Python OpenID may be obtained from
http://www.openidenabled.com/openid/libraries/python
http://github.com/openid/python-openid
and we'd like to hear about how you're using this software.
Write to us at openid@janrain.com.
3 changes: 1 addition & 2 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ CONTACT
=======

Send bug reports, suggestions, comments, and questions to
http://lists.openidenabled.com/mailman/listinfo/dev
dev@lists.openidenabled.com.
http://openid.net/developers/dev-mailing-lists/.

If you have a bugfix or feature you'd like to contribute, don't
hesitate to send it to us. For more detailed information on how to
Expand Down
Empty file modified admin/builddiscover.py
100644 → 100755
Empty file.
Empty file modified admin/fixperms
100644 → 100755
Empty file.
Empty file modified admin/makechangelog
100644 → 100755
Empty file.
Empty file modified admin/pythonsource
100644 → 100755
Empty file.
Empty file modified admin/runtests
100644 → 100755
Empty file.
Empty file modified admin/setversion
100644 → 100755
Empty file.
Empty file modified admin/tagrelease
100644 → 100755
Empty file.
47 changes: 47 additions & 0 deletions contrib/associate
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env python
"""Make an OpenID Assocition request against an endpoint
and print the results."""

import sys

from openid.store.memstore import MemoryStore
from openid.consumer import consumer
from openid.consumer.discover import OpenIDServiceEndpoint

from datetime import datetime

def verboseAssociation(assoc):
"""A more verbose representation of an Association.
"""
d = assoc.__dict__
issued_date = datetime.fromtimestamp(assoc.issued)
d['issued_iso'] = issued_date.isoformat()
fmt = """ Type: %(assoc_type)s
Handle: %(handle)s
Issued: %(issued)s [%(issued_iso)s]
Lifetime: %(lifetime)s
Secret: %(secret)r
"""
return fmt % d

def main():
if not sys.argv[1:]:
print "Usage: %s ENDPOINT_URL..." % (sys.argv[0],)
for endpoint_url in sys.argv[1:]:
print "Associating with", endpoint_url

# This makes it clear why j3h made AssociationManager when we
# did the ruby port. We can't invoke requestAssociation
# without these other trappings.
store = MemoryStore()
endpoint = OpenIDServiceEndpoint()
endpoint.server_url = endpoint_url
c = consumer.GenericConsumer(store)
auth_req = c.begin(endpoint)
if auth_req.assoc:
print verboseAssociation(auth_req.assoc)
else:
print " ...no association."

if __name__ == '__main__':
main()
40 changes: 0 additions & 40 deletions darcs-ignore

This file was deleted.

2 changes: 1 addition & 1 deletion examples/README
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ Getting help

Please send bug reports, patches, and other feedback to

dev@lists.openidenabled.com
http://openid.net/developers/dev-mailing-lists/
5 changes: 2 additions & 3 deletions examples/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ def quoteattr(s):
PYTHONPATH environment variable).
For more information, see the README in the root of the library
distribution or http://www.openidenabled.com/
""")
distribution.""")
sys.exit(1)

from openid.store import memstore
Expand Down Expand Up @@ -423,7 +422,7 @@ def pageHeader(self, title):
<h1>%s</h1>
<p>
This example consumer uses the <a href=
"http://www.openidenabled.com/openid/libraries/python" >Python
"http://github.com/openid/python-openid" >Python
OpenID</a> library. It just verifies that the identifier that you enter
is your identifier.
</p>
Expand Down
2 changes: 1 addition & 1 deletion examples/djopenid/README
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ CONTACT

Please send bug reports, patches, and other feedback to

dev@lists.openidenabled.com
http://openid.net/developers/dev-mailing-lists/
3 changes: 1 addition & 2 deletions examples/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ def quoteattr(s):
PYTHONPATH environment variable).
For more information, see the README in the root of the library
distribution or http://www.openidenabled.com/
""")
distribution.""")
sys.exit(1)

from openid.extensions import sreg
Expand Down
4 changes: 2 additions & 2 deletions openid/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
implementing an OpenID server, see the C{L{openid.server.server}}
module.
@contact: U{dev@lists.openidenabled.com
<http://lists.openidenabled.com/mailman/listinfo/dev>}
@contact: U{http://openid.net/developers/dev-mailing-lists/
<http://openid.net/developers/dev-mailing-lists/}
@copyright: (C) 2005-2008 JanRain, Inc.
Expand Down
4 changes: 2 additions & 2 deletions openid/association.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,12 +527,12 @@ def checkMessageSignature(self, message):
@raises ValueError: if the message has no signature or no signature
can be calculated for it.
"""
"""
message_sig = message.getArg(OPENID_NS, 'sig')
if not message_sig:
raise ValueError("%s has no sig." % (message,))
calculated_sig = self.getMessageSignature(message)
return calculated_sig == message_sig
return cryptutil.const_eq(calculated_sig, message_sig)


def _makePairs(self, message):
Expand Down
9 changes: 4 additions & 5 deletions openid/consumer/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
Add an OpenID login field somewhere on your site. When an OpenID
is entered in that field and the form is submitted, it should make
a request to the your site which includes that OpenID URL.
a request to your site which includes that OpenID URL.
First, the application should L{instantiate a Consumer<Consumer.__init__>}
with a session for per-user state and store for shared state.
Expand Down Expand Up @@ -165,14 +165,13 @@
the URL by the OpenID provider as the information necessary to
finish the request.
Get an C{L{Consumer}} instance with the same session and store as
Get a C{L{Consumer}} instance with the same session and store as
before and call its C{L{complete<Consumer.complete>}} method,
passing in all the received query arguments.
There are multiple possible return types possible from that
method. These indicate the whether or not the login was
successful, and include any additional information appropriate for
their type.
method. These indicate whether or not the login was successful,
and include any additional information appropriate for their type.
@var SUCCESS: constant used as the status for
L{SuccessResponse<openid.consumer.consumer.SuccessResponse>} objects.
Expand Down
10 changes: 10 additions & 0 deletions openid/cryptutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,13 @@ def randomString(length, chrs=None):
else:
n = len(chrs)
return ''.join([chrs[randrange(n)] for _ in xrange(length)])

def const_eq(s1, s2):
if len(s1) != len(s2):
return False

result = True
for i in range(len(s1)):
result = result and (s1[i] == s2[i])

return result
6 changes: 5 additions & 1 deletion openid/fetchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,11 @@ def _parseHeaders(self, header_file):
header_file.seek(0)

# Remove the status line from the beginning of the input
unused_http_status_line = header_file.readline()
unused_http_status_line = header_file.readline().lower ()
if unused_http_status_line.startswith('http/1.1 100 '):
unused_http_status_line = header_file.readline()
unused_http_status_line = header_file.readline()

lines = [line.strip() for line in header_file]

# and the blank line from the end
Expand Down
132 changes: 0 additions & 132 deletions openid/oidUtil.py

This file was deleted.

3 changes: 0 additions & 3 deletions openid/yadis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
"""Yadis.

@see: U{http://www.openidenabled.com/yadis}
"""

__all__ = [
'constants',
Expand Down
Loading

0 comments on commit 03773fb

Please sign in to comment.