Changeset 4118 for TI12-security


Ignore:
Timestamp:
11/08/08 10:04:26 (11 years ago)
Author:
pjkersha
Message:

raise new NoSignatureFound? if signatureNode not present in SignatureHandler?.verify

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/python/ndg.security.common/ndg/security/common/wsSecurity.py

    r4110 r4118  
    135135class SignatureError(WSSecurityError): 
    136136    """Flag if an error occurs during signature generation""" 
    137          
     137 
     138class NoSignatureFound(WSSecurityError): 
     139    """Raise from SignatureHandler.verify if inbound message is not signed""" 
     140 
     141 
    138142class SignatureHandler(object): 
    139143    """Class to handle signature and verification of signature with  
     
    10871091 
    10881092 
    1089     def verify(self, parsedSOAP): 
     1093    def verify(self, parsedSOAP, raiseNoSignatureFound=True): 
    10901094        """Verify signature 
    10911095         
     
    11141118        except: 
    11151119            # Message wasn't signed 
    1116             log.warning("Input message wasn't signed!") 
    1117             return 
     1120            msg = "Input message wasn't signed!" 
     1121            if raiseNoSignatureFound: 
     1122                raise NoSignatureFound(msg) 
     1123            else:  
     1124                log.warning(msg) 
     1125                return 
    11181126         
    11191127        # Two stage process: reference validation followed by signature  
Note: See TracChangeset for help on using the changeset viewer.