python-openid-cla-1.2/0000775000175000017500000000000012540047177017333 5ustar puiterwijkpuiterwijk00000000000000python-openid-cla-1.2/setup.cfg0000664000175000017500000000007312540047177021154 0ustar puiterwijkpuiterwijk00000000000000[egg_info] tag_build = tag_date = 0 tag_svn_revision = 0 python-openid-cla-1.2/python_openid_cla.egg-info/0000775000175000017500000000000012540047177024523 5ustar puiterwijkpuiterwijk00000000000000python-openid-cla-1.2/python_openid_cla.egg-info/dependency_links.txt0000664000175000017500000000000112540047177030571 0ustar puiterwijkpuiterwijk00000000000000 python-openid-cla-1.2/python_openid_cla.egg-info/requires.txt0000664000175000017500000000003012540047177027114 0ustar puiterwijkpuiterwijk00000000000000six python-openid>=2.2.5python-openid-cla-1.2/python_openid_cla.egg-info/top_level.txt0000664000175000017500000000001312540047177027247 0ustar puiterwijkpuiterwijk00000000000000openid_cla python-openid-cla-1.2/python_openid_cla.egg-info/PKG-INFO0000664000175000017500000000052112540047177025616 0ustar puiterwijkpuiterwijk00000000000000Metadata-Version: 1.0 Name: python-openid-cla Version: 1.2 Summary: This is an implementation of the OpenID cla extension for python-openid Home-page: http://www.github.com/puiterwijk/python-openid-cla/ Author: Patrick Uiterwijk Author-email: puiterwijk@gmail.com License: BSD Description: UNKNOWN Keywords: openid cla Platform: UNKNOWN python-openid-cla-1.2/python_openid_cla.egg-info/SOURCES.txt0000664000175000017500000000044112540047177026406 0ustar puiterwijkpuiterwijk00000000000000setup.py openid_cla/__init__.py openid_cla/cla.py python_openid_cla.egg-info/PKG-INFO python_openid_cla.egg-info/SOURCES.txt python_openid_cla.egg-info/dependency_links.txt python_openid_cla.egg-info/requires.txt python_openid_cla.egg-info/top_level.txt python_openid_cla.egg-info/zip-safepython-openid-cla-1.2/python_openid_cla.egg-info/zip-safe0000664000175000017500000000000112540043407026143 0ustar puiterwijkpuiterwijk00000000000000 python-openid-cla-1.2/setup.py0000664000175000017500000000431712540047056021046 0ustar puiterwijkpuiterwijk00000000000000# Copyright (c) 2013, Patrick Uiterwijk # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of Patrick Uiterwijk nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL Patrick Uiterwijk BE LIABLE FOR ANY # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import sys from setuptools import setup, find_packages install_requires = ['six'] if sys.version_info[0] == 2: install_requires.append('python-openid>=2.2.5') elif sys.version_info[0] == 3: install_requires.append('python3-openid') setup( name = "python-openid-cla", version = "1.2", install_requires = install_requires, zip_safe = True, packages = ['openid_cla'], author = 'Patrick Uiterwijk', author_email = 'puiterwijk@gmail.com', description = 'This is an implementation of the OpenID cla extension for python-openid', license = 'BSD', keywords = 'openid cla', url = 'http://www.github.com/puiterwijk/python-openid-cla/', ) python-openid-cla-1.2/openid_cla/0000775000175000017500000000000012540047177021430 5ustar puiterwijkpuiterwijk00000000000000python-openid-cla-1.2/openid_cla/__init__.py0000664000175000017500000000304412540043305023527 0ustar puiterwijkpuiterwijk00000000000000# Copyright (c) 2013, Patrick Uiterwijk # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of Patrick Uiterwijk nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL Patrick Uiterwijk BE LIABLE FOR ANY # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. python-openid-cla-1.2/openid_cla/cla.py0000664000175000017500000000773212540047043022542 0ustar puiterwijkpuiterwijk00000000000000"""CLA extension request and response parsing and object representation @var cla_uri: The URI used for the CLA extension namespace and XRD Type Value """ from openid.message import ( registerNamespaceAlias, NamespaceAliasRegistrationError, ) from openid.extension import Extension import logging import six __all__ = [ 'CLARequest', 'CLAResponse', 'cla_uri', 'supportsCLA', ] # The namespace for this extension cla_uri = 'http://fedoraproject.org/specs/open_id/cla' # Some predefined CLA uris CLA_URI_FEDORA_CLICK = 'http://admin.fedoraproject.org/accounts/cla/click' CLA_URI_FEDORA_DELL = 'http://admin.fedoraproject.org/accounts/cla/dell' CLA_URI_FEDORA_DONE = 'http://admin.fedoraproject.org/accounts/cla/done' CLA_URI_FEDORA_FEDORA = 'http://admin.fedoraproject.org/accounts/cla/fedora' CLA_URI_FEDORA_FPCA = 'http://admin.fedoraproject.org/accounts/cla/fpca' CLA_URI_FEDORA_IBM = 'http://admin.fedoraproject.org/accounts/cla/ibm' CLA_URI_FEDORA_INTEL = 'http://admin.fedoraproject.org/accounts/cla/intel' CLA_URI_FEDORA_REDHAT = 'http://admin.fedoraproject.org/accounts/cla/redhat' try: registerNamespaceAlias(cla_uri, 'cla') except NamespaceAliasRegistrationError as e: logging.exception('registerNamespaceAlias(%r, %r) failed: %s' % ( cla_uri, 'cla', str(e),)) def supportsCLA(endpoint): return endpoint.usesExtension(cla_uri) class CLARequest(Extension): ns_uri = 'http://fedoraproject.org/specs/open_id/cla' ns_alias = 'cla' def __init__(self, requested=None): Extension.__init__(self) self.requested = [] if requested: self.requestCLAs(requested) def requestedCLAs(self): return self.requested def fromOpenIDRequest(cls, request): self = cls() # Since we're going to mess with namespace URI mapping, don't # mutate the object that was passed in. message = request.message.copy() args = message.getArgs(self.ns_uri) self.parseExtensionArgs(args) return self fromOpenIDRequest = classmethod(fromOpenIDRequest) def parseExtensionArgs(self, args): items = args.get('query_cla') if items: for cla_uri in items.split(','): self.requestCLA(cla_uri) def wereCLAsRequested(self): return bool(self.requested) def __requests__(self, cla_uri): return cla_uri in self.requested def requestCLA(self, cla_uri): if not cla_uri in self.requested: self.requested.append(cla_uri) def requestCLAs(self, cla_uris): if isinstance(cla_uris, six.string_types): raise TypeError('CLA URIs should be passed as a list of ' 'strings (not %r)' % (type(field_names),)) for cla_uri in cla_uris: self.requestCLA(cla_uri) def getExtensionArgs(self): args = {} if self.requested: args['query_cla'] = ','.join(self.requested) return args class CLAResponse(Extension): ns_uri = 'http://fedoraproject.org/specs/open_id/cla' ns_alias = 'cla' def __init__(self, clas=None): Extension.__init__(self) if clas is None: self.clas = [] else: self.clas = clas def extractResponse(cls, request, clas): self = cls() for cla in request.requestedCLAs(): if cla in clas: self.clas.append(cla) return self extractResponse = classmethod(extractResponse) def fromSuccessResponse(cls, success_response, signed_only=True): self = cls() if signed_only: args = success_response.getSignedNS(self.ns_uri) else: args = success_response.message.getArgs(self.ns_uri) if not args: return None self.clas = args['signed_cla'].split(',') return self fromSuccessResponse = classmethod(fromSuccessResponse) def getExtensionArgs(self): return {'signed_cla': ','.join(self.clas)} python-openid-cla-1.2/PKG-INFO0000664000175000017500000000052112540047177020426 0ustar puiterwijkpuiterwijk00000000000000Metadata-Version: 1.0 Name: python-openid-cla Version: 1.2 Summary: This is an implementation of the OpenID cla extension for python-openid Home-page: http://www.github.com/puiterwijk/python-openid-cla/ Author: Patrick Uiterwijk Author-email: puiterwijk@gmail.com License: BSD Description: UNKNOWN Keywords: openid cla Platform: UNKNOWN