Changeset 7131


Ignore:
Timestamp:
30/06/10 14:37:48 (9 years ago)
Author:
pjkersha
Message:

Added unit test package

Location:
TI12-security/trunk/NDGSoap/ndg/soap
Files:
6 edited
4 copied

Legend:

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

    r6416 r7131  
    1 """NDG SOAP package contains WS-Security Signature Handler and SOAP WSGI  
    2 middleware 
     1"""SOAP common package for NDG SAML.   
    32 
    4 NERC DataGrid Project  
     3Initially for use with SAML SOAP Bindings.  This itself 
     4uses ElementTree.  This SOAP interface provides an ElementTree interface to 
     5support it 
     6 
     7NERC DataGrid Project 
    58""" 
    69__author__ = "P J Kershaw" 
    7 __date__ = "26/01/2010" 
     10__date__ = "24/07/09" 
    811__copyright__ = "(C) 2009 Science and Technology Facilities Council" 
    9 __license__ = "BSD - see LICENSE file in top-level directory" 
     12__license__ = "http://www.apache.org/licenses/LICENSE-2.0" 
    1013__contact__ = "Philip.Kershaw@stfc.ac.uk" 
    11 __revision__ = '$Id: $' 
     14__revision__ = '$Id: __init__.py 7130 2010-06-30 13:33:07Z pjkersha $' 
     15import logging 
     16log = logging.getLogger(__name__) 
     17 
     18class SOAPException(Exception): 
     19    """Base SAOP Exception class""" 
     20     
     21class SOAPFault(SOAPException): 
     22    """SOAP Fault""" 
     23     
     24class SOAPObject(object): 
     25    """Base class for SOAP envelope, header and body elements""" 
     26     
     27    ELEMENT_PREFIX = "SOAP-ENV" 
     28    SOAP11_NS = "http://schemas.xmlsoap.org/soap/envelope/" 
     29    SOAP12_NS = "http://www.w3.org/2003/05/soap-envelope" 
     30    DEFAULT_NS = SOAP11_NS 
     31     
     32    def create(self): 
     33        raise NotImplementedError() 
     34     
     35    def parse(self): 
     36        raise NotImplementedError() 
     37     
     38    def serialize(self): 
     39        raise NotImplementedError() 
     40     
     41    def prettyPrint(self): 
     42        raise NotImplementedError() 
     43   
     44     
     45class SOAPEnvelopeBase(SOAPObject): 
     46    """SOAP Envelope""" 
     47     
     48    DEFAULT_ELEMENT_LOCAL_NAME = "Envelope" 
     49    DEFAULT_ELEMENT_NS = SOAPObject.DEFAULT_NS 
     50    DEFAULT_ELEMENT_NS_PREFIX = SOAPObject.ELEMENT_PREFIX 
     51     
     52    soapHeader = property() 
     53    soapBody = property() 
     54     
     55     
     56class SOAPHeaderBase(SOAPObject): 
     57    """SOAP Header base class""" 
     58     
     59    DEFAULT_ELEMENT_LOCAL_NAME = "Header" 
     60    DEFAULT_ELEMENT_NS = SOAPObject.DEFAULT_NS 
     61    DEFAULT_ELEMENT_NS_PREFIX = SOAPObject.ELEMENT_PREFIX     
     62         
     63class SOAPBodyBase(SOAPObject): 
     64    """SOAP Body base class""" 
     65     
     66    DEFAULT_ELEMENT_LOCAL_NAME = "Body" 
     67    DEFAULT_ELEMENT_NS = SOAPObject.DEFAULT_NS 
     68    DEFAULT_ELEMENT_NS_PREFIX = SOAPObject.ELEMENT_PREFIX 
  • TI12-security/trunk/NDGSoap/ndg/soap/client.py

    r7130 r7131  
    55__author__ = "P J Kershaw" 
    66__date__ = "27/07/09" 
    7 __copyright__ = "" 
     7__copyright__ = "(C) 2010 Science and Technology Facilities Council" 
    88__license__ = "http://www.apache.org/licenses/LICENSE-2.0" 
    99__contact__ = "Philip.Kershaw@stfc.ac.uk" 
  • TI12-security/trunk/NDGSoap/ndg/soap/etree.py

    r7130 r7131  
    55__author__ = "P J Kershaw" 
    66__date__ = "27/07/09" 
    7 __copyright__ = "" 
     7__copyright__ = "(C) 2010 Science and Technology Facilities Council" 
    88__license__ = "http://www.apache.org/licenses/LICENSE-2.0" 
    99__contact__ = "Philip.Kershaw@stfc.ac.uk" 
  • TI12-security/trunk/NDGSoap/ndg/soap/utils/__init__.py

    r6416 r7131  
    1 """NDG SOAP utilities package 
    2  
    3 NERC DataGrid Project 
    4 """ 
    5 __author__ = "Philip Kershaw" 
    6 __date__ = "25/01/2010" 
    7 __copyright__ = "(C) 2010 Science and Technology Facilities Council" 
    8 __license__ = "BSD - see LICENSE file in top-level directory" 
    9 __contact__ = "Philip.Kershaw@stfc.ac.uk" 
    10 __revision__ = '$Id: $' 
  • TI12-security/trunk/NDGSoap/ndg/soap/utils/etree.py

    r7130 r7131  
    55__author__ = "P J Kershaw" 
    66__date__ = "02/04/09" 
    7 __copyright__ = "" 
     7__copyright__ = "(C) 2010 Science and Technology Facilities Council" 
    88__license__ = "http://www.apache.org/licenses/LICENSE-2.0" 
    99__contact__ = "Philip.Kershaw@stfc.ac.uk" 
  • TI12-security/trunk/NDGSoap/ndg/soap/wssecurity/__init__.py

    r6417 r7131  
    1212    """For WS-Security generic exceptions not covered by other exception 
    1313    classes in this module""" 
     14     
    1415         
    1516class WSSecurityConfigError(WSSecurityError): 
    1617    """Configuration error with WS-Security setting or settings""" 
     18 
     19 
     20class InvalidCertChain(WSSecurityError):     
     21    """Raised from SignatureHandler.verify if the certificate submitted to 
     22    verify a signature is not from a known CA""" 
     23  
    1724  
    1825class TimestampError(WSSecurityError): 
     
    2027    the created or expiry times in an input message Timestamp""" 
    2128 
     29 
    2230class MessageExpired(TimestampError): 
    2331    """Raised from SignatureHandler._verifyTimestamp if the timestamp of 
    2432    the message being processed is before the current time.  Can be caught in 
    2533    order to set a wsu:MessageExpired fault code""" 
    26  
    27 class InvalidCertChain(WSSecurityError):     
    28     """Raised from SignatureHandler.verify if the certificate submitted to 
    29     verify a signature is not from a known CA""" 
  • TI12-security/trunk/NDGSoap/ndg/soap/wssecurity/test/unit/signaturehandler/foursuite/client/echoClientTest.cfg

    r6417 r7131  
    1515# - NB, the two CA certificates are for the python and the java clients,  
    1616# respectively 
    17 caCertFilePathList = $NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     17caCertFilePathList = $NDGSEC_TEST_CONFIG_DIR/ca/d573507a.0 
    1818 
    1919[test1Echo] 
  • TI12-security/trunk/NDGSoap/ndg/soap/wssecurity/test/unit/signaturehandler/foursuite/server/echoservice.ini

    r6419 r7131  
    9393 
    9494# Verify against known CAs - Provide a space separated list of file paths 
    95 wssecurity.caCertFilePathList=%(testConfigDir)s/ca/ndg-test-ca.crt 
     95wssecurity.caCertFilePathList=%(testConfigDir)s/ca/d573507a.0 
    9696 
    9797#______________________________________________________________________________ 
  • TI12-security/trunk/NDGSoap/ndg/soap/wssecurity/test/unit/signaturehandler/foursuite/server/wssecurity.cfg

    r6399 r7131  
    9393# Provide a space separated list of file paths 
    9494# - NB, the two CA certificates are for the python and the java clients, respectively 
    95 #caCertFilePathList=$NDGSEC_TEST_CONFIG_DIR/ca/java-ca.crt $NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
    96 caCertFilePathList=$NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     95#caCertFilePathList=$NDGSEC_TEST_CONFIG_DIR/ca/java-ca.crt $NDGSEC_TEST_CONFIG_DIR/ca/d573507a.0 
     96caCertFilePathList=$NDGSEC_TEST_CONFIG_DIR/ca/d573507a.0 
    9797 
    9898# Force an exception if a client message doesn't contain a timestamp 
Note: See TracChangeset for help on using the changeset viewer.