Changeset 6957


Ignore:
Timestamp:
09/06/10 09:47:34 (9 years ago)
Author:
pjkersha
Message:

Incomplete - task 5: MyProxy? Logon HTTPS Interface

  • fixed paths to be absolute for PasteDeploy? loadapp ini file in unit tests.
Location:
TI12-security/trunk/MyProxyWebService/myproxy/server
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/MyProxyWebService/myproxy/server/test/myproxy_ws.py

    r6895 r6957  
    1515from myproxy.server.test import PasteDeployAppServer 
    1616 
    17 THIS_DIR = path.dirname(__file__) 
     17THIS_DIR = path.abspath(path.dirname(__file__)) 
    1818INI_FILENAME = 'myproxywsgi.ini' 
    1919INI_FILEPATH = path.join(THIS_DIR, INI_FILENAME)  
  • TI12-security/trunk/MyProxyWebService/myproxy/server/test/myproxywsgi.ini

    r6950 r6957  
    1919[app:main] 
    2020paste.app_factory = myproxy.server.wsgi.app:MyProxyApp.app_factory 
    21 prefix = myproxy. 
     21prefix = MyProxy. 
    2222 
    2323# HTTP Basic Auth authentication realm used with MyProxy logon requests. 
    24 myproxy.httpbasicauth.realm = myproxy-realm 
     24MyProxy.httpbasicauth.realm = myproxy-realm 
    2525 
    2626# The key name in the WSGI environ dictionary which holds the MyProxy logon 
    2727# function.  This is used by the HTTP Basic Auth middleware 
    28 myproxy.logon.logonFuncEnvKeyName = MYPROXY_LOGON_FUNC 
     28MyProxy.logon.logonFuncEnvKeyName = MYPROXY_LOGON_FUNC 
    2929 
    3030# Path for logon requests 
     
    3434# for the logon request.  The format of this option is inherited from the more 
    3535# generic HTTP Basic Auth middleware which the MyProxyApp uses. 
    36 myproxy.logon.rePathMatchList = /logon 
     36MyProxy.logon.rePathMatchList = /logon 
    3737 
    3838# Path for get trust roots call.  This should be a single path.  Regular  
    3939# expressions are not supported. 
    40 myproxy.getTrustRoots.path = /get-trustroots 
     40MyProxy.getTrustRoots.path = /get-trustroots 
    4141 
    4242# MyProxy server which this MyProxy WSGI app is a client to.  Set here to the  
    4343# fully qualified domain name or else set the MYPROXY_SERVER environment 
    4444# variable.  See the documentation for the MyProxyClient egg for details 
    45 #myproxy.client.hostname = localhost 
    46 myproxy.client.caCertDir = /etc/grid-security/certificates 
     45#MyProxy.client.hostname = localhost 
     46 
     47# CA Certificate directory to enable this application to trust the MyProxy 
     48# server that it fronts e.g. set to /etc/grid-security/certificates.  For these 
     49# tests set to local ca directory 
     50MyProxy.client.caCertDir = %(here)s/ca 
  • TI12-security/trunk/MyProxyWebService/myproxy/server/test/test_myproxywsgi.py

    r6943 r6957  
    5959    """Base class for common Paste Deploy related set-up""" 
    6060    INI_FILENAME = 'myproxywsgi.ini' 
    61     THIS_DIR = os.path.dirname(__file__) 
     61    THIS_DIR = os.path.abspath(os.path.dirname(__file__)) 
    6262    CONFIG_FILENAME = 'test_myproxywsgi.cfg' 
    6363    CONFIG_FILEPATH = os.path.join(THIS_DIR, CONFIG_FILENAME) 
  • TI12-security/trunk/MyProxyWebService/myproxy/server/test/test_myproxywsgi_with_paster.py

    r6953 r6957  
    3030    with bash shell script clients.  For POSIX-like systems ONLY 
    3131    """ 
    32     THIS_DIR = path.dirname(__file__) 
     32    THIS_DIR = path.abspath(path.dirname(__file__)) 
    3333    CA_DIRNAME = 'ca' 
    3434    CA_DIR = path.join(THIS_DIR, CA_DIRNAME) 
     
    8080        ) 
    8181                 
    82         proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, 
    83                                 stderr=subprocess.PIPE, 
    84                                 env={self.__class__.CA_ENV_VARNAME: 
    85                                      self.__class__.CA_DIR}) 
     82        try: 
     83            proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, 
     84                                    stderr=subprocess.PIPE, 
     85                                    env={self.__class__.CA_ENV_VARNAME: 
     86                                         self.__class__.CA_DIR}) 
     87        except OSError, e: 
     88            self.failIf(e.errno == 13, 'Check that the %r script is set with ' 
     89                        'execute permissions' %  
     90                        self.__class__.GET_TRUSTROOTS_SCRIPT_CMD) 
     91            raise 
     92 
    8693        stdoutdata, stderrdata = proc.communicate() 
    8794        self.failIf(len(stderrdata) > 0, "An error message was returned: %s" %  
     
    108115                 
    109116        p1 = subprocess.Popen(["echo", password], stdout=subprocess.PIPE) 
    110         p2 = subprocess.Popen(cmd, stdin=p1.stdout, stdout=subprocess.PIPE, 
    111                               stderr=subprocess.PIPE, 
    112                               env={self.__class__.CA_ENV_VARNAME: 
    113                                    self.__class__.CA_DIR}) 
     117        try: 
     118            p2 = subprocess.Popen(cmd, stdin=p1.stdout, stdout=subprocess.PIPE, 
     119                                  stderr=subprocess.PIPE, 
     120                                  env={self.__class__.CA_ENV_VARNAME: 
     121                                       self.__class__.CA_DIR}) 
     122        except OSError, e: 
     123            self.failIf(e.errno == 13, 'Check that the %r script is set with ' 
     124                        'execute permissions' % self.__class__.LOGON_SCRIPT_CMD) 
     125            raise 
     126         
    114127        stdoutdata, stderrdata = p2.communicate() 
    115128        self.failIf(len(stderrdata) > 0, "An error message was returned: %s" %  
  • TI12-security/trunk/MyProxyWebService/myproxy/server/wsgi/middleware.py

    r6950 r6957  
    209209        return app 
    210210     
    211     def parseConfig(self, prefix=PARAM_PREFIX, myProxyClientPrefix='', 
     211    def parseConfig(self,  
     212                    prefix=PARAM_PREFIX,  
     213                    myProxyClientPrefix=MYPROXY_CLIENT_PARAM_PREFIX, 
    212214                    **app_conf): 
    213215        """Parse dictionary of configuration items updating the relevant  
Note: See TracChangeset for help on using the changeset viewer.