Changeset 4365


Ignore:
Timestamp:
27/10/08 17:21:23 (11 years ago)
Author:
pjkersha
Message:
  • cleaned out old config files from ndg.security.server.conf
  • moved ndg.security.server.twisted code to ndg.security.server.zsi.twisted
Location:
TI12-security/trunk/python/ndg.security.server/ndg/security/server
Files:
4 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/python/ndg.security.server/ndg/security/server/zsi/twisted/__init__.py

    r4362 r4365  
    1313__contact__ = "P.J.Kershaw@rl.ac.uk" 
    1414__revision__ = '$Id$' 
     15 
     16"""WS-Security digital signature handler for Twisted framework 
     17 
     18(moved from ndg.security.common.wsSecurity) 
     19 
     20This is used by NDG-Security server side code ONLY 
     21 
     22NERC Data Grid Project 
     23""" 
     24__author__ = "P J Kershaw" 
     25__date__ = "28/08/07" 
     26__copyright__ = "(C) 2007 STFC & NERC" 
     27__license__ = \ 
     28"""This software may be distributed under the terms of the Q Public  
     29License, version 1.0 or later.""" 
     30__contact__ = "P.J.Kershaw@rl.ac.uk" 
     31__revision__ = '$Id: twisted.py 2909 2007-09-28 14:22:21Z pjkersha $' 
     32 
     33from zope.interface import classProvides, implements, Interface 
     34from ZSI.twisted.WSresource import DefaultHandlerChain, \ 
     35    DefaultCallbackHandler, HandlerChainInterface, DataHandler 
     36 
     37     
     38class WSSecurityHandlerChainFactory: 
     39    protocol = DefaultHandlerChain 
     40     
     41    @classmethod 
     42    def newInstance(cls): 
     43        return cls.protocol(DefaultCallbackHandler,  
     44                            DataHandler, 
     45                            WSSecurityHandler) 
     46 
     47class WSSecurityHandler: 
     48    classProvides(HandlerChainInterface) 
     49 
     50    signatureHandler = None 
     51     
     52    @classmethod 
     53    def processRequest(cls, ps, **kw): 
     54        """Callback for verifying a signature. 
     55         
     56        @param ps: instance representing SOAP request Body. 
     57        @type ps: ZSI.parse.ParsedSoap 
     58        @return ps: instance representing SOAP request Body 
     59        @rtype ps: ZSI.parse.ParsedSoap 
     60        """ 
     61        if cls.signatureHandler: 
     62            cls.signatureHandler.verify(ps) 
     63             
     64        return ps 
     65     
     66    @classmethod 
     67    def processResponse(cls, sw, **kw): 
     68        """Callback for signing an outbound message. 
     69         
     70        @param ps: instance representing SOAP response Body. 
     71        @type ps: ZSI.writer.SoapWriter 
     72        @return ps: instance representing SOAP response Body 
     73        @rtype ps: ZSI.writer.SoapWriter 
     74        """ 
     75        if cls.signatureHandler: 
     76            cls.signatureHandler.sign(sw) 
     77             
     78        return sw 
  • TI12-security/trunk/python/ndg.security.server/ndg/security/server/zsi/twisted/attributeauthority/attAuthority.tac

    r4363 r4365  
    4343         
    4444from ndg.security.common.wssecurity.dom import SignatureHandler 
    45 from ndg.security.server.twisted import WSSecurityHandlerChainFactory, \ 
     45from ndg.security.server.zsi.twisted import WSSecurityHandlerChainFactory, \ 
    4646        WSSecurityHandler 
    4747 
  • TI12-security/trunk/python/ndg.security.server/ndg/security/server/zsi/twisted/sessionmanager/sessionMgr.tac

    r4363 r4365  
    4343from ndg.security.server.SessionMgr import SessionMgr 
    4444from ndg.security.common.wssecurity.dom import SignatureHandler 
    45 from ndg.security.server.twisted import WSSecurityHandler, \ 
     45from ndg.security.server.zsi.twisted import WSSecurityHandler, \ 
    4646        WSSecurityHandlerChainFactory 
    4747         
Note: See TracChangeset for help on using the changeset viewer.