Changeset 4059 for TI12-security/trunk


Ignore:
Timestamp:
23/07/08 15:48:17 (11 years ago)
Author:
pjkersha
Message:

python/Tests/authtest: Pylons AuthKit? OpenID test code - added error2 controller to experiment with WCS AuthKit? IndexError?.

python/ndg.security.common/ndg/security/common/wssecurity/etree.py,
python/ndg.security.common/ndg/security/common/XMLSec.py: fixes following addition of ElementTree XMLSec implementation for signing for SAML Attribute Assertions

python/ndg.security.common/ndg/security/common/xmlsec/etree.py: ElementTree implementation of enveloped signature. Use with new ElementTree based SAML Attribute Assertion code.

python/ndg.security.common/ndg/security/common/authz/pdp/browse.py,

python/ndg.security.common/ndg/security/common/saml/init.py: new SAML Attribute Assertion implementation to replace NDG Attribute Certificate. Hacked from AttCert? module - much work to go.

Location:
TI12-security/trunk/python
Files:
7 added
5 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/python/Tests/authtest/authtest/lib/base.py

    r3830 r4059  
    1414import authtest.model as model 
    1515 
     16from ows_common import exceptions as OWS_E 
     17 
    1618class BaseController(WSGIController): 
    1719 
     
    2123        # the request is routed to. This routing information is 
    2224        # available in environ['pylons.routes_dict'] 
     25        if 'error' in request.params: 
     26            response.headers['content-type'] = 'text/html' 
     27#            resp = WSGIController.__call__(self, environ, start_response) 
     28            #start_response('200 OK', [('Content-type', 'text/html')]) 
     29            return render('signin') 
     30 
    2331        return WSGIController.__call__(self, environ, start_response) 
    2432 
  • TI12-security/trunk/python/ndg.security.common/ndg/security/common/XMLSec.py

    r2927 r4059  
    326326    #_________________________________________________________________________ 
    327327    def read(self, stream=None): 
    328         """Read XML into a libxml2 document to allow signature validation 
     328        """Read XML into a document to allow signature validation 
    329329         
    330330        @param stream: read from a file stream object instead of  
     
    381381            parentNode = getParentNode(self.__docNode) 
    382382        except Exception, e: 
    383             raise VerifyError, "Locating parent node: " + str(e) 
     383            raise SignError, "Locating parent node: " + str(e) 
    384384 
    385385        parentNode.setAttributeNS(XMLNS.BASE, 'xmlns:%s' % 'ds', DSIG.BASE) 
  • TI12-security/trunk/python/ndg.security.common/ndg/security/common/authz/pdp/browse.py

    r4035 r4059  
    1313License, version 1.0 or later.""" 
    1414__contact__ = "P.J.Kershaw@rl.ac.uk" 
    15 __revision__ = "$Id:gatekeeper.py 3079 2007-11-30 09:39:46Z pjkersha $" 
     15__revision__ = "$Id$" 
    1616 
    1717import logging 
  • TI12-security/trunk/python/ndg.security.common/ndg/security/common/authz/pdp/proftp.py

    r4035 r4059  
    7474                'tracefile': '', 
    7575                'acCACertFilePathList': [],  
    76                 'acIssuer': ''} 
     76                'acIssuer': '', 
     77                'wssCfgFilePath': None, 
     78                'wssCfgSection': 'DEFAULT'} 
    7779        
    7880    def __init__(self, cfg=None, cfgSection='DEFAULT', **cfgKw): 
     
    9294        self.userHandle = None 
    9395         
    94         # Set from config file 
    9596        # Set from config file 
    9697        if isinstance(cfg, basestring): 
     
    99100        else: 
    100101            self._cfg = cfg 
     102         
     103        # Parse settings 
     104        if cfg: 
     105            self._parseConfig(cfgSection) 
    101106                         
    102107        # Separate keywords into PDP and WS-Security specific items 
     
    274279            self.smClnt = SessionMgrClient(uri=self.smURI, 
    275280                            cfgFilePath=self.cfgFilePath, 
    276                             cfgFileSection='WS-Security', 
     281                            cfgFileSection=self.wssCfgFilePath, 
     282                             
    277283                            sslCACertFilePathList=self.sslCACertFilePathList, 
    278284                            tracefile=self.tracefile)  
  • TI12-security/trunk/python/ndg.security.common/ndg/security/common/wssecurity/etree.py

    r4052 r4059  
    11481148                                         namespaces=self._processorNSs) 
    11491149            if transformElem is None: 
    1150                 raise VerifyError( 
    1151             'Failed to get transform algorithm for <ds:Reference URI="%s">'%\ 
    1152                         refURI) 
     1150                raise VerifyError('Failed to get transform algorithm for ' 
     1151                                  '<ds:Reference URI="%s">' % refURI) 
    11531152                 
    11541153            refAlgorithm = transformElem.get("Algorithm") 
     
    11791178            # XPath reference 
    11801179            uriXPath = './/*[@wsu:Id="%s"]' % refURI[1:] 
    1181             uriElem=self._soapEnvElem.findall(uriXPath,namespaces=self._processorNSs) 
     1180            uriElem=self._soapEnvElem.findall(uriXPath, 
     1181                                              namespaces=self._processorNSs) 
    11821182            if len(uriElem) > 1: 
    11831183                raise VerifyError("Multiple elements matching '%s' search"  
     
    11911191             
    11921192            # Extract the digest value that was stored in the SOAP request          
    1193             digestElem = refElem.find('ds:DigestValue',namespaces=self._processorNSs) 
     1193            digestElem = refElem.find('ds:DigestValue', 
     1194                                      namespaces=self._processorNSs) 
    11941195            if digestElem is None: 
    11951196                raise VerifyError('Failed to get digestValue for ' \ 
Note: See TracChangeset for help on using the changeset viewer.