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/AttAuthority/__init__.py

    r3755 r3914  
    3838    HostCheck 
    3939 
     40from ndg.security.common.zsi_utils.httpproxy import ProxyHTTPConnection 
     41 
    4042import logging 
    4143log = logging.getLogger(__name__) 
     
    7375                 uri=None,  
    7476                 tracefile=None, 
     77                 httpProxyHost=None, 
     78                 ignoreHttpProxyEnv=False, 
    7579                 sslCACertList=[], 
    7680                 sslCACertFilePathList=[], 
     
    111115        self.__uri = None 
    112116        self._transdict = {}         
     117        self._transport = HTTPProxyConnection 
    113118         
    114119        if uri: 
    115120            self.__setURI(uri) 
    116121 
     122        self.__setHTTPProxyHost(httpProxyHost) 
     123        self.__setIgnoreHttpProxyEnv(ignoreHttpProxyEnv) 
     124         
    117125        if sslPeerCertCN: 
    118126            self.__setSSLPeerCertCN(sslPeerCertCN) 
     
    157165            self._transport = HTTPSConnection 
    158166        else: 
    159             self._transport = None 
     167            self._transport = ProxyHTTPConnection 
    160168 
    161169 
     
    168176             
    169177    uri = property(fset=__setURI, fget=__getURI,doc="Attribute Authority URI") 
     178 
     179 
     180    #_________________________________________________________________________ 
     181    def __setHTTPProxyHost(self, val): 
     182        """Set a HTTP Proxy host overriding any http_proxy environment variable 
     183        setting""" 
     184        if self._transport != ProxyHTTPConnection: 
     185            raise AttAuthorityClientError(\ 
     186                "Setting HTTP Proxy Host but transport class is not " + \ 
     187                "ProxyHTTPConnection type") 
     188         
     189        self._transdict['httpProxyHost'] = val 
     190 
     191    httpProxyHost = property(fset=__setHTTPProxyHost,  
     192        doc="HTTP Proxy hostname - overrides any http_proxy env var setting") 
     193 
     194 
     195    #_________________________________________________________________________ 
     196    def __setIgnoreHttpProxyEnv(self, val): 
     197        """Set to True to ignore any http_proxy environment variable setting""" 
     198        if self._transport != ProxyHTTPConnection: 
     199            raise AttAuthorityClientError(\ 
     200                "Setting ignore HTTP Proxy Host flag but transport class " + \ 
     201                "is not ProxyHTTPConnection type") 
     202         
     203        self._transdict['ignoreHttpProxyEnv'] = val 
     204 
     205    ignoreHttpProxyEnv = property(fset=__setIgnoreHttpProxyEnv,  
     206    doc="Set to True to ignore any http_proxy environment variable setting") 
    170207 
    171208 
     
    362399        @return: dictionary of host information indexed by hostname derived  
    363400        from the map configuration""" 
    364              
     401 
     402        hosts = self.__srv.getAllHostsInfo() 
    365403        try: 
    366404            hosts = self.__srv.getAllHostsInfo() 
Note: See TracChangeset for help on using the changeset viewer.