Changeset 6900 for TI12-security/trunk


Ignore:
Timestamp:
28/05/10 10:56:21 (9 years ago)
Author:
pjkersha
Message:

Incomplete - task 6: Put NDG SAML package on PyPI

  • add documentation folder and Makefile for epydoc
  • updating epydoc for all modules and packages.
Location:
TI12-security/trunk/ndg_saml
Files:
2 added
12 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/ndg_saml/ndg/__init__.py

    r6607 r6900  
    1414__date__ = "23/02/2010" 
    1515__copyright__ = "(C) 2010 Science and Technology Facilities Council" 
    16 __license__ = "BSD - see LICENSE file in top-level directory" 
     16__license__ = "http://www.apache.org/licenses/LICENSE-2.0" 
    1717__contact__ = "Philip.Kershaw@stfc.ac.uk" 
    1818__revision__ = '$Id: $' 
  • TI12-security/trunk/ndg_saml/ndg/saml/__init__.py

    r6069 r6900  
    2424__copyright__ = "(C) 2009 Science and Technology Facilities Council" 
    2525__contact__ = "Philip.Kershaw@stfc.ac.uk" 
    26 __license__ = "BSD - see LICENSE file in top-level directory" 
     26__license__ = "http://www.apache.org/licenses/LICENSE-2.0" 
    2727__contact__ = "Philip.Kershaw@stfc.ac.uk" 
    28 __revision__ = "$Id: $" 
     28__revision__ = "$Id$" 
  • TI12-security/trunk/ndg_saml/ndg/saml/common/__init__.py

    r6609 r6900  
    2626__copyright__ = "(C) 2009 Science and Technology Facilities Council" 
    2727__contact__ = "Philip.Kershaw@stfc.ac.uk" 
    28 __license__ = "BSD - see LICENSE file in top-level directory" 
     28__license__ = "http://www.apache.org/licenses/LICENSE-2.0" 
    2929__contact__ = "Philip.Kershaw@stfc.ac.uk" 
    30 __revision__ = "$Id: $" 
     30__revision__ = "$Id$" 
    3131from ndg.saml.common.xml import SAMLConstants, QName 
    3232  
    3333 
    3434class SAMLObject(object): 
    35     """Base class for all SAML types""" 
     35    """Base class for all SAML types 
     36     
     37    @cvar DEFAULT_ELEMENT_LOCAL_NAME: default XML element name - derived classes 
     38    must specify  
     39    @type DEFAULT_ELEMENT_LOCAL_NAME: None 
     40    @ivar __qname: qualified name for XML element 
     41    @type __qname: ndg.saml.common.xml.QName 
     42    """ 
    3643    DEFAULT_ELEMENT_LOCAL_NAME = None 
    3744    __slots__ = ('__qname',) 
     
    4148                 elementLocalName=None,  
    4249                 namespacePrefix=SAMLConstants.SAML20_PREFIX): 
    43         '''@param namespaceURI: the namespace the element is in 
     50        ''' 
     51        @param namespaceURI: the namespace the element is in 
     52        @type namespaceURI: basestring 
    4453        @param elementLocalName: the local name of the XML element this Object  
    45         represents 
     54        represents, defaults to DEFAULT_ELEMENT_LOCAL_NAME.  Ensure that this 
     55        is set to a valid string in derived classes rather the None base class 
     56        setting 
     57        @type elementLocalName: NoneType/basestring 
    4658        @param namespacePrefix: the prefix for the given namespace 
     59        @type namespacePrefix: basestring 
    4760        ''' 
    4861        if elementLocalName is None: 
     
    5568    @property 
    5669    def qname(self): 
    57         "Qualified Name for this type" 
     70        """Qualified Name for this type 
     71        @return: qualified name 
     72        @rtype: ndg.saml.common.xml.QName 
     73        """ 
    5874        return self.__qname 
    5975             
    6076    @classmethod 
    6177    def fromXML(cls, xmlObject): 
    62         '''Parse from an XML representation into a SAML object 
    63         @type: XML class e.g. ElementTree or 4Suite XML 
    64         @param: XML representation of SAML Object 
     78        '''Parse from an XML representation into a SAML object.  Abstract method 
     79        - derived types should implement 
     80         
     81        @type xmlObject: XML class e.g. ElementTree or 4Suite XML type 
     82        @param xmlObject: XML representation of SAML Object 
    6583        @rtype: saml.saml2.common.SAMLObject derived type 
    6684        @return: SAML object 
     
    7088    @classmethod 
    7189    def toXML(cls, samlObject): 
    72         '''Convert the input SAML object into an XML representation 
    73         @type: saml.saml2.common.SAMLObject derived type 
    74         @param: SAML object 
     90        '''Convert the input SAML object into an XML representation.  Abstract  
     91        method - derived types should implement 
     92        @type samlObject: saml.saml2.common.SAMLObject derived type 
     93        @param samlObject: SAML object 
    7594        @rtype: XML class e.g. ElementTree or 4Suite XML 
    7695        @return: XML representation of SAML Object 
     
    7998 
    8099    def __getstate__(self): 
    81         '''Enable pickling''' 
     100        '''Enable pickling 
     101         
     102        @return: object's attribute dictionary 
     103        @rtype: dict 
     104        ''' 
    82105        _dict = {} 
    83106        for attrName in SAMLObject.__slots__: 
     
    95118   
    96119    def __setstate__(self, attrDict): 
    97         '''Enable pickling''' 
     120        '''Enable pickling 
     121         
     122        @param attrDict: object's attribute dictionary 
     123        @type attrDict: dict 
     124        ''' 
    98125        for attrName, val in attrDict.items(): 
    99126            setattr(self, attrName, val) 
     
    101128 
    102129class SAMLVersion(object): 
    103     """Version helper class""" 
     130    """Version helper class 
     131     
     132    @cvar VERSION_10: SAML Version 1.0 identifier 
     133    @type VERSION_10: tuple 
     134    @cvar VERSION_11: SAML Version 1.1 identifier 
     135    @type VERSION_11: tuple 
     136    @cvar VERSION_20: SAML Version 2.0 identifier 
     137    @type VERSION_20: tuple 
     138    @cvar KNOWN_VERSIONS: list of known SAML version identifiers 
     139    @type KNOWN_VERSIONS: tuple 
     140    @ivar __version: SAML version for the given class instance 
     141    @type __version: tuple 
     142    """ 
    104143     
    105144    VERSION_10 = (1, 0) 
     
    111150     
    112151    def __init__(self, version): 
     152        """Instantiate from a given input version 
     153        @param version: SAML version to set 
     154        @type version: basestring or tuple or list 
     155        @raise TypeError: unexpected type for version input 
     156        """ 
    113157        if isinstance(version, basestring): 
    114158            self.__version = SAMLVersion.valueOf(version) 
     
    120164             
    121165    def __getstate__(self): 
    122         '''Enable pickling''' 
     166        '''Enable pickling 
     167         
     168        @return: object's attribute dictionary 
     169        @rtype: dict 
     170        ''' 
    123171        _dict = {} 
    124172        for attrName in SAMLVersion.__slots__: 
     
    133181   
    134182    def __setstate__(self, attrDict): 
    135         '''Enable pickling''' 
     183        '''Enable pickling 
     184         
     185        @param attrDict: object's attribute dictionary 
     186        @type attrDict: dict 
     187        ''' 
    136188        for attrName, val in attrDict.items(): 
    137189            setattr(self, attrName, val) 
    138190     
    139191    def __str__(self): 
     192        """ 
     193        @return: string representation of SAML version 
     194        @rtype: string 
     195        """ 
    140196        return ".".join([str(i) for i in self.__version]) 
    141197     
    142198    def __eq__(self, version): 
    143         """Test for equality against an input version string, tuple or list""" 
     199        """Test for equality against an input version string, tuple or list 
     200         
     201        @param version: SAML version to test 
     202        @type version: SAMLVersion, basestring, tuple or list 
     203        @raise TypeError: unexpected type for version input 
     204        """ 
    144205        if isinstance(version, SAMLVersion): 
    145206            return str(self) == str(version) 
     
    155216             
    156217    def __ne__(self, version): 
     218        """Test True for this instance version not equal to input version 
     219         
     220        @param version: SAML version to test 
     221        @type version: SAMLVersion, basestring, tuple or list 
     222        @raise TypeError: unexpected type for version input 
     223        """ 
    157224        return not self.__eq__(version) 
    158225             
    159226    def __gt__(self, version):                 
     227        """Test True for this instance version greater than input version 
     228         
     229        @param version: SAML version to test 
     230        @type version: SAMLVersion, basestring, tuple or list 
     231        @raise TypeError: unexpected type for version input 
     232        """ 
    160233        if isinstance(version, basestring): 
    161234            return self.__version > SAMLVersion.valueOf(version) 
     
    167240             
    168241    def __lt__(self, version): 
     242        """Test True for this instance version less than input version 
     243         
     244        @param version: SAML version to test 
     245        @type version: SAMLVersion, basestring, tuple or list 
     246        @raise TypeError: unexpected type for version input 
     247        """ 
    169248        if isinstance(version, basestring): 
    170249            return self.__version < SAMLVersion.valueOf(version) 
     
    176255             
    177256    def __ge__(self, version):                 
     257        """Test True for this instance version greater or equal to the input  
     258        version 
     259         
     260        @param version: SAML version to test 
     261        @type version: SAMLVersion, basestring, tuple or list 
     262        @raise TypeError: unexpected type for version input 
     263        """ 
    178264        if isinstance(version, basestring): 
    179265            return self.__version >= SAMLVersion.valueOf(version) 
     
    185271             
    186272    def __le__(self, version):                 
     273        """Test True for this instance version less than or equal to input  
     274        version 
     275         
     276        @param version: SAML version to test 
     277        @type version: SAMLVersion, basestring, tuple or list 
     278        @raise TypeError: unexpected type for version input 
     279        """ 
    187280        if isinstance(version, basestring): 
    188281            return self.__version <= SAMLVersion.valueOf(version) 
     
    196289    def valueOf(version): 
    197290        """Parse input string into version tuple 
    198         @type version: version 
     291        @type version: basestring 
    199292        @param version: SAML version 
    200293        @rtype: tuple 
  • TI12-security/trunk/ndg_saml/ndg/saml/common/xml.py

    r6609 r6900  
    2626__copyright__ = "(C) 2009 Science and Technology Facilities Council" 
    2727__contact__ = "Philip.Kershaw@stfc.ac.uk" 
    28 __license__ = "BSD - see LICENSE file in top-level directory" 
     28__license__ = "http://www.apache.org/licenses/LICENSE-2.0" 
    2929__contact__ = "Philip.Kershaw@stfc.ac.uk" 
    3030__revision__ = "$Id: $" 
  • TI12-security/trunk/ndg_saml/ndg/saml/saml2/__init__.py

    r6069 r6900  
    2626__copyright__ = "(C) 2009 Science and Technology Facilities Council" 
    2727__contact__ = "Philip.Kershaw@stfc.ac.uk" 
    28 __license__ = "BSD - see LICENSE file in top-level directory" 
     28__license__ = "http://www.apache.org/licenses/LICENSE-2.0" 
    2929__contact__ = "Philip.Kershaw@stfc.ac.uk" 
    30 __revision__ = "$Id: $" 
     30__revision__ = "$Id$" 
  • TI12-security/trunk/ndg_saml/ndg/saml/saml2/core.py

    r6786 r6900  
    2626__copyright__ = "(C) 2009 Science and Technology Facilities Council" 
    2727__contact__ = "Philip.Kershaw@stfc.ac.uk" 
    28 __license__ = "BSD - see LICENSE file in top-level directory" 
     28__license__ = "http://www.apache.org/licenses/LICENSE-2.0" 
    2929__contact__ = "Philip.Kershaw@stfc.ac.uk" 
    30 __revision__ = "$Id: $" 
     30__revision__ = "$Id$" 
    3131from datetime import datetime 
    3232from urlparse import urlsplit, urlunsplit 
  • TI12-security/trunk/ndg_saml/ndg/saml/test/__init__.py

    r6069 r6900  
    33 
    44NERC DataGrid Project 
     5 
     6This implementation is adapted from the Java OpenSAML implementation.  The  
     7copyright and licence information are included here: 
     8 
     9Copyright [2005] [University Corporation for Advanced Internet Development, Inc.] 
     10 
     11Licensed under the Apache License, Version 2.0 (the "License"); 
     12you may not use this file except in compliance with the License. 
     13You may obtain a copy of the License at 
     14 
     15http://www.apache.org/licenses/LICENSE-2.0 
     16 
     17Unless required by applicable law or agreed to in writing, software 
     18distributed under the License is distributed on an "AS IS" BASIS, 
     19WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
     20See the License for the specific language governing permissions and 
     21limitations under the License. 
    522""" 
    623__author__ = "P J Kershaw" 
    724__date__ = "25/07/08" 
    825__copyright__ = "(C) 2009 Science and Technology Facilities Council" 
    9 __license__ = "BSD - see LICENSE file in top-level directory" 
     26__license__ = "http://www.apache.org/licenses/LICENSE-2.0" 
    1027__contact__ = "Philip.Kershaw@stfc.ac.uk" 
    11 __revision__ = '$Id: $' 
     28__revision__ = '$Id$' 
  • TI12-security/trunk/ndg_saml/ndg/saml/test/test_saml.py

    r6609 r6900  
    22 
    33NERC DataGrid Project 
     4 
     5This implementation is adapted from the Java OpenSAML implementation.  The  
     6copyright and licence information are included here: 
     7 
     8Copyright [2005] [University Corporation for Advanced Internet Development, Inc.] 
     9 
     10Licensed under the Apache License, Version 2.0 (the "License"); 
     11you may not use this file except in compliance with the License. 
     12You may obtain a copy of the License at 
     13 
     14http://www.apache.org/licenses/LICENSE-2.0 
     15 
     16Unless required by applicable law or agreed to in writing, software 
     17distributed under the License is distributed on an "AS IS" BASIS, 
     18WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
     19See the License for the specific language governing permissions and 
     20limitations under the License. 
    421""" 
    522__author__ = "P J Kershaw" 
    623__date__ = "21/07/09" 
    724__copyright__ = "(C) 2009 Science and Technology Facilities Council" 
    8 __license__ = "BSD - see LICENSE file in top-level directory" 
     25__license__ = "http://www.apache.org/licenses/LICENSE-2.0" 
    926__contact__ = "Philip.Kershaw@stfc.ac.uk" 
    10 __revision__ = '$Id: $' 
     27__revision__ = '$Id$' 
    1128import logging 
    1229logging.basicConfig(level=logging.DEBUG) 
  • TI12-security/trunk/ndg_saml/ndg/saml/utils.py

    r5601 r6900  
    22 
    33NERC DataGrid Project 
     4 
     5This implementation is adapted from the Java OpenSAML implementation.  The  
     6copyright and licence information are included here: 
     7 
     8Copyright [2005] [University Corporation for Advanced Internet Development, Inc.] 
     9 
     10Licensed under the Apache License, Version 2.0 (the "License"); 
     11you may not use this file except in compliance with the License. 
     12You may obtain a copy of the License at 
     13 
     14http://www.apache.org/licenses/LICENSE-2.0 
     15 
     16Unless required by applicable law or agreed to in writing, software 
     17distributed under the License is distributed on an "AS IS" BASIS, 
     18WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
     19See the License for the specific language governing permissions and 
     20limitations under the License. 
    421""" 
    522__author__ = "P J Kershaw" 
    623__date__ = "10/08/09" 
    724__copyright__ = "(C) 2009 Science and Technology Facilities Council" 
    8 __license__ = "BSD - see LICENSE file in top-level directory" 
     25__license__ = "http://www.apache.org/licenses/LICENSE-2.0" 
    926__contact__ = "Philip.Kershaw@stfc.ac.uk" 
    10 __revision__ = '$Id: $' 
     27__revision__ = '$Id$' 
    1128try: 
    1229    from datetime import strptime 
  • TI12-security/trunk/ndg_saml/ndg/saml/xml/__init__.py

    r6069 r6900  
    2424__copyright__ = "(C) 2009 Science and Technology Facilities Council" 
    2525__contact__ = "Philip.Kershaw@stfc.ac.uk" 
    26 __license__ = "BSD - see LICENSE file in top-level directory" 
     26__license__ = "http://www.apache.org/licenses/LICENSE-2.0" 
    2727__contact__ = "Philip.Kershaw@stfc.ac.uk" 
    28 __revision__ = "$Id: $" 
     28__revision__ = "$Id$" 
    2929import logging 
    3030log = logging.getLogger(__name__) 
    3131    
     32 
    3233class XMLConstants(object): 
    3334    '''XML related constants.''' 
  • TI12-security/trunk/ndg_saml/ndg/saml/xml/etree.py

    r6786 r6900  
    2525__copyright__ = "(C) 2009 Science and Technology Facilities Council" 
    2626__contact__ = "Philip.Kershaw@stfc.ac.uk" 
    27 __license__ = "BSD - see LICENSE file in top-level directory" 
     27__license__ = "http://www.apache.org/licenses/LICENSE-2.0" 
    2828__contact__ = "Philip.Kershaw@stfc.ac.uk" 
    29 __revision__ = "$Id: $" 
     29__revision__ = "$Id$" 
    3030import logging 
    3131log = logging.getLogger(__name__) 
  • TI12-security/trunk/ndg_saml/setup.py

    r6606 r6900  
    11#!/usr/bin/env python 
    2 """SAML Package  
     2"""SAML 2.0 Package 
    33 
    44NERC DataGrid Project 
     5 
     6This implementation is adapted from the Java OpenSAML implementation.  The  
     7copyright and licence information are included here: 
     8 
     9Copyright [2005] [University Corporation for Advanced Internet Development, Inc.] 
     10 
     11Licensed under the Apache License, Version 2.0 (the "License"); 
     12you may not use this file except in compliance with the License. 
     13You may obtain a copy of the License at 
     14 
     15http://www.apache.org/licenses/LICENSE-2.0 
     16 
     17Unless required by applicable law or agreed to in writing, software 
     18distributed under the License is distributed on an "AS IS" BASIS, 
     19WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
     20See the License for the specific language governing permissions and 
     21limitations under the License. 
    522""" 
    623__author__ = "P J Kershaw" 
    724__date__ = "10/08/09" 
    825__copyright__ = "(C) 2009 Science and Technology Facilities Council" 
    9 __license__ = "BSD - see LICENSE file in top-level directory" 
     26__license__ = "http://www.apache.org/licenses/LICENSE-2.0" 
    1027__contact__ = "Philip.Kershaw@stfc.ac.uk" 
    1128__revision__ = '$Id:$' 
     
    1835    
    1936_longDescription = """\ 
    20 SAML 2.0 implementation for use with the NERC DataGrid Attribute and  
    21 Authorisation Query interfaces.  The implementation is based on the Java  
    22 OpenSAML libraries.  An implementation is provided using ElementTree although it 
    23 is also possible to add plugins for other Python XML parsers. 
     37SAML 2.0 implementation for use with the NERC DataGrid / Earth System Grid  
     38Project Attribute and Authorisation Query interfaces.  The implementation is  
     39based on the Java OpenSAML libraries.  An implementation is provided with   
     40ElementTree but it can easily be extended to use other Python XML parsers. 
    2441 
    2542It is not a complete implementation of SAML 2.0.  Only those components required 
     
    3047setup( 
    3148    name =                      'ndg_security_saml', 
    32     version =                   '0.3', 
     49    version =                   '0.4', 
    3350    description =               ('SAML 2.0 implementation for the NERC DataGrid ' 
    3451                             'based on the Java OpenSAML library'), 
    35     long_description =          (), 
     52    long_description =          _longDescription, 
    3653    author =                    'Philip Kershaw', 
    3754    author_email =              'Philip.Kershaw@stfc.ac.uk', 
     
    3956    maintainer_email =          'Philip.Kershaw@stfc.ac.uk', 
    4057    url =                       'http://proj.badc.rl.ac.uk/ndg/wiki/Security', 
    41     license =               'BSD - See LICENCE file for details', 
     58    license =               'http://www.apache.org/licenses/LICENSE-2.0', 
    4259    packages =                      find_packages(), 
    4360    namespace_packages =        [], 
    4461    include_package_data =  True, 
     62    classifiers = [ 
     63        'Development Status :: Development Status :: 4 - Beta', 
     64        'Environment :: Console', 
     65        'Environment :: Web Environment', 
     66        'Intended Audience :: Developers', 
     67        'Intended Audience :: System Administrators', 
     68        'Intended Audience :: Science/Research', 
     69        'License :: OSI Approved :: OSI Approved :: Apache Software License', 
     70        'Natural Language :: English', 
     71        'Operating System :: Microsoft :: Windows', 
     72        'Operating System :: POSIX :: Linux', 
     73        'Programming Language :: Python', 
     74        'Topic :: Security', 
     75        'Topic :: Internet', 
     76        'Topic :: Scientific/Engineering', 
     77        'Topic :: System :: Distributed Computing', 
     78        'Topic :: System :: Systems Administration :: Authentication/Directory', 
     79        'Topic :: Software Development :: Libraries :: Python Modules' 
     80    ], 
    4581    zip_safe =              False 
    4682) 
Note: See TracChangeset for help on using the changeset viewer.