Ignore:
Timestamp:
20/05/08 17:11:20 (12 years ago)
Author:
pjkersha
Message:
  • New ndg.security.common.zsi_util.httpproxy.ProxyHTTPConnection class replaces urllib2client - easier to fit into existing ZSI client framework.
  • Further OpenID integration into Single Sign On Service. User now authenticates OK but patches needed to AuthKit? + need to handle return_to URL dynamically according to page visited before WAYF call.
File:
1 edited

Legend:

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

    r3790 r3914  
    2828from ndg.security.common.m2CryptoSSLUtility import HTTPSConnection, \ 
    2929    HostCheck 
     30from ndg.security.common.zsi_utils.httpproxy import ProxyHTTPConnection 
    3031from SessionMgr_services import SessionMgrServiceLocator 
    3132 
     
    119120                 uri=None,  
    120121                 tracefile=None, 
     122                 httpProxyHost=None, 
     123                 ignoreHttpProxyEnv=False, 
    121124                 sslCACertList=[], 
    122125                 sslCACertFilePathList=[], 
     
    159162        self.__uri = None 
    160163        self._transdict = {} 
    161         self._transport = None        
     164        self._transport = ProxyHTTPConnection        
    162165         
    163166        if uri: 
    164167            self.__setURI(uri) 
     168 
     169        self.__setHTTPProxyHost(httpProxyHost) 
     170        self.__setIgnoreHttpProxyEnv(ignoreHttpProxyEnv) 
    165171 
    166172        if sslPeerCertCN: 
     
    195201         
    196202        if not isinstance(uri, basestring): 
    197             raise SessionMgrClientError, \ 
    198                              "Session Manager WSDL URI must be a valid string" 
     203            raise SessionMgrClientError( 
     204                             "Session Manager WSDL URI must be a valid string") 
    199205         
    200206        self.__uri = uri 
     
    202208            scheme = urlparse.urlparse(self.__uri)[0] 
    203209        except TypeError: 
    204             raise AttributeAuthorityClientError, \ 
    205                 "Error parsing transport type from URI" 
     210            raise AttributeAuthorityClientError( 
     211                                    "Error parsing transport type from URI") 
    206212                 
    207213        if scheme == "https": 
    208214            self._transport = HTTPSConnection 
    209215        else: 
    210             self._transport = None 
     216            self._transport = ProxyHTTPConnection 
    211217             
    212218            # Ensure SSL settings are cancelled 
     
    222228    uri = property(fset=__setURI, fget=__getURI, doc="Session Manager URI") 
    223229 
     230 
     231    #_________________________________________________________________________ 
     232    def __setHTTPProxyHost(self, val): 
     233        """Set a HTTP Proxy host overriding any http_proxy environment variable 
     234        setting""" 
     235        if self._transport != ProxyHTTPConnection: 
     236            raise SessionMgrClientError(\ 
     237                "Setting HTTP Proxy Host - transport class is %s type, " % \ 
     238                self._transport + \ 
     239                "expecting ProxyHTTPConnection type") 
     240         
     241        self._transdict['httpProxyHost']= val 
     242 
     243    httpProxyHost = property(fset=__setHTTPProxyHost,  
     244        doc="HTTP Proxy hostname - overrides any http_proxy env var setting") 
     245 
     246 
     247    #_________________________________________________________________________ 
     248    def __setIgnoreHttpProxyEnv(self, val): 
     249        """Set to True to ignore any http_proxy environment variable setting""" 
     250        if self._transport != ProxyHTTPConnection: 
     251            raise SessionMgrClientError(\ 
     252                "Setting ignore HTTP Proxy Host flag but transport class " + \ 
     253                "is not ProxyHTTPConnection type") 
     254         
     255        self._transdict['ignoreHttpProxyEnv']= val 
     256 
     257    ignoreHttpProxyEnv = property(fset=__setIgnoreHttpProxyEnv,  
     258    doc="Set to True to ignore any http_proxy environment variable setting") 
     259     
    224260 
    225261    #_________________________________________________________________________ 
Note: See TracChangeset for help on using the changeset viewer.