Ignore:
Timestamp:
02/09/10 11:43:37 (10 years ago)
Author:
pjkersha
Message:

Incomplete - task 2: XACML-Security Integration

  • Tested local PDP with integration tests. ndg.security.test.integration.full_system. This completes the functionality for the XACML integration - now preparing a new release.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/integration/__init__.py

    r7357 r7414  
    1616    """ 
    1717    method = { 
    18 "/": 'default', 
    19 "/test_401": "test_401", 
    20 "/test_403": "test_403", 
    21 "/test_securedURI": "test_securedURI", 
    22 "/test_accessDeniedToSecuredURI": "test_accessDeniedToSecuredURI", 
    23 "/logout?ndg.security.logout.r=/test_logoutWithReturn2QueryArg":  
    24     "test_logoutWithReturn2QueryArg", 
    25 "/test_logoutViaHttpReferrer": "test_logoutViaHttpReferrer" 
     18        "/": 'default', 
     19        "/test_401": "test_401", 
     20        "/test_403": "test_403", 
     21        "/test_securedURI": "test_securedURI", 
     22        "/test_accessDeniedToSecuredURI": "test_accessDeniedToSecuredURI", 
     23        "/test_logoutWithReturn2QueryArg": "test_logoutWithReturn2QueryArg" 
    2624    } 
    27     header = """        <h1>Authorisation Integration Tests:</h1> 
     25    header = """        <h1>NDG Security Authorisation Integration Tests:</h1> 
    2826        <p>These tests use require the security services application to be 
    2927        running.  See securityserviceapp.py and securityservices.ini in the  
     
    6260             
    6361    def default(self, environ, start_response): 
     62        links = self.method.copy() 
     63        del links['/'] 
     64        del links['/test_logoutWithReturn2QueryArg'] 
     65        links['/logout?ndg.security.logout.r=/test_logoutWithReturn2QueryArg' 
     66              ] = 'test_logoutWithReturn2QueryArg' 
     67         
    6468        if 'username' in environ.get(self.beakerSessionKeyName, {}): 
    6569            response = """<html> 
     
    7377""" % (AuthZTestApp.header, 
    7478       '\n'.join(['<li><a href="%s">%s</a></li>' % (link, name)  
    75                  for link,name in self.method.items() if name != 'default']), 
     79                  for link, name in links.items()]), 
    7680       environ[self.beakerSessionKeyName]['username']) 
    7781         
     
    8589        %s 
    8690        <ul>%s</ul> 
     91        <p>You are logged out.  <a href="/test_401">Login</a></p> 
    8792    </body> 
    8893</html> 
    8994""" % (AuthZTestApp.header, 
    9095       '\n'.join(['<li><a href="%s">%s</a></li>' % (link, name)  
    91                  for link,name in self.method.items() if name != 'default']) 
     96                 for link,name in links.items()]) 
    9297       ) 
    9398 
     
    220225        return response 
    221226     
    222     def test_logoutViaHttpReferrer(self, environ, start_response): 
    223         """Test logout - the middleware works out where to return to by checking 
    224         the HTTP_REFERER environ setting 
    225         """ 
    226         response = """<html> 
    227     <head/> 
    228     <body> 
    229         <h1>Logged Out</h1> 
    230         <p>Successfully redirected to specified return to HTTP_REFERER=%s  
    231         following logout.   
    232         <a href="/">Return to tests</a></p> 
    233     </body> 
    234 </html> 
    235 """ % environ['PATH_INFO'] 
    236  
    237         start_response('200 OK',  
    238                        [('Content-type', 'text/html'), 
    239                         ('Content-length', str(len(response)))]) 
    240         return response 
    241      
    242227    @classmethod 
    243228    def app_factory(cls, globalConfig, **localConfig): 
Note: See TracChangeset for help on using the changeset viewer.