Ignore:
Timestamp:
29/09/08 16:05:29 (12 years ago)
Author:
pjkersha
Message:

Working unit tests for WSGI based Attribute Authority.

  • Altered so that all Attribute Config is picked up from the Paste ini file. Separate cfg or xml based config file is still supported.

TODO:

  • Simplify unit test config for client.
Location:
TI12-security/trunk/python/ndg.security.test/ndg/security/test/attAuthority
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/attAuthority/attAuthorityClientTest.cfg

    r4238 r4245  
    1111# ! SiteBMapConfig.xml trusted site A aaURI setting must agree with this  
    1212# setting for test6GetMappedAttCert 
    13 uri = http://localhost:4900/AttributeAuthority 
     13uri = http://localhost:5000/AttributeAuthority 
    1414 
    1515# For https connections only.  !Omit ssl* settings if using http! 
     
    128128cacertfilepathlist = $NDGSEC_AACLNT_UNITTEST_DIR/ca/ndg-test-ca.crt 
    129129 
    130 uri = http://localhost:5050/AttributeAuthority 
     130uri = http://localhost:5100/AttributeAuthority 
    131131userAttCertFilePath = $NDGSEC_AACLNT_UNITTEST_DIR/ac-clnt.xml 
    132132 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/attAuthority/siteAAttAuthority.cfg

    r4139 r4245  
    3636attCertLifetime: 28800  
    3737# Allow an offset for clock skew between servers running  
    38 # security services. NB, measured in seconds - use a minus sign for time in the past 
     38# security services. NB, measured in seconds - use a minus sign for time in the 
     39# past 
    3940attCertNotBeforeOff: 0 
    4041# All Attribute Certificates issued are recorded in this dir 
    4142attCertDir: $NDGSEC_AACLNT_UNITTEST_DIR/attCertLog 
    4243# Files in attCertDir are stored using a rotating file handler 
    43 # attCertFileLogCnt sets the max number of files created before the first is overwritten 
     44# attCertFileLogCnt sets the max number of files created before the first is  
     45# overwritten 
    4446attCertFileName: ac.xml 
    4547attCertFileLogCnt: 16 
     
    4951mapConfigFile: $NDGSEC_AACLNT_UNITTEST_DIR/siteAMapConfig.xml 
    5052 
    51 # Settings for custom AAUserRoles derived class to get user roles for given user ID 
     53# Settings for custom AAUserRoles derived class to get user roles for given  
     54# user ID 
    5255userRolesModFilePath: $NDGSEC_AACLNT_UNITTEST_DIR 
    5356userRolesModName: siteAUserRoles 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/attAuthority/wsgi/site-a.ini

    r4238 r4245  
    1212 
    1313[DEFAULT] 
    14 #wsseCfgFilePath = $NDGSEC_AACLNT_UNITTEST_DIR/wssecurity.cfg 
     14# WS-Security settings in THIS file 
    1515wsseCfgFilePath = %(here)s/site-a.ini 
    1616wsseCfgFileSection = WS-Security 
     17 
     18# Attribute Authority settings 
     19# 'name' setting MUST agree with map config file 'thisHost' name attribute 
     20attributeAuthority.name: Site A 
     21 
     22# Lifetime is measured in seconds 
     23attributeAuthority.attCertLifetime: 28800  
     24 
     25# Allow an offset for clock skew between servers running  
     26# security services. NB, measured in seconds - use a minus sign for time in the 
     27# past 
     28attributeAuthority.attCertNotBeforeOff: 0 
     29 
     30# All Attribute Certificates issued are recorded in this dir 
     31attributeAuthority.attCertDir: $NDGSEC_AACLNT_UNITTEST_DIR/attCertLog 
     32 
     33# Files in attCertDir are stored using a rotating file handler 
     34# attCertFileLogCnt sets the max number of files created before the first is  
     35# overwritten 
     36attributeAuthority.attCertFileName: ac.xml 
     37attributeAuthority.attCertFileLogCnt: 16 
     38attributeAuthority.dnSeparator:/ 
     39 
     40# Location of role mapping file 
     41attributeAuthority.mapConfigFile: $NDGSEC_AACLNT_UNITTEST_DIR/siteAMapConfig.xml 
     42 
     43# Settings for custom AAUserRoles derived class to get user roles for given  
     44# user ID 
     45attributeAuthority.userRolesModFilePath: $NDGSEC_AACLNT_UNITTEST_DIR 
     46attributeAuthority.userRolesModName: siteAUserRoles 
     47attributeAuthority.userRolesClassName: TestUserRoles 
     48 
     49# Config for XML signature of Attribute Certificate 
     50attributeAuthority.signingPriKeyFilePath: $NDGSEC_AACLNT_UNITTEST_DIR/siteA-aa.key 
     51attributeAuthority.signingCertFilePath: $NDGSEC_AACLNT_UNITTEST_DIR/siteA-aa.crt 
     52attributeAuthority.caCertFilePathList: $NDGSEC_AACLNT_UNITTEST_DIR/ca/ndg-test-ca.crt 
    1753 
    1854[server:main] 
     
    3268paste.filter_app_factory = ndg.security.server.wsgi.soap:SOAPBindingMiddleware 
    3369ServiceSOAPBindingClass = ndg.security.server.zsi.attributeauthority.AttributeAuthorityWS 
     70ServiceSOAPBindingPropPrefix = AttributeAuthority 
     71AttributeAuthority.propPrefix = attributeAuthority 
     72AttributeAuthority.propFilePath = $NDGSEC_AACLNT_UNITTEST_DIR/wsgi/site-a.ini 
    3473referencedFilters = wsseSignatureVerificationFilter01 
    3574path = /AttributeAuthority 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/attAuthority/wsgi/site-b.ini

    r4238 r4245  
    1212 
    1313[DEFAULT] 
    14 #wsseCfgFilePath = $NDGSEC_AACLNT_UNITTEST_DIR/wssecurity.cfg 
     14# WS-Security settings in THIS file 
    1515wsseCfgFilePath = %(here)s/site-a.ini 
    1616wsseCfgFileSection = WS-Security 
     17 
     18# Attribute Authority settings 
     19# 'name' setting MUST agree with map config file 'thisHost' name attribute 
     20attributeAuthority.name: Site B 
     21 
     22# Lifetime is measured in seconds 
     23attributeAuthority.attCertLifetime: 28800  
     24 
     25# Allow an offset for clock skew between servers running  
     26# security services. NB, measured in seconds - use a minus sign for time in the 
     27# past 
     28attributeAuthority.attCertNotBeforeOff: 0 
     29 
     30# All Attribute Certificates issued are recorded in this dir 
     31attributeAuthority.attCertDir: $NDGSEC_AACLNT_UNITTEST_DIR/attCertLog 
     32 
     33# Files in attCertDir are stored using a rotating file handler 
     34# attCertFileLogCnt sets the max number of files created before the first is  
     35# overwritten 
     36attributeAuthority.attCertFileName: ac.xml 
     37attributeAuthority.attCertFileLogCnt: 16 
     38attributeAuthority.dnSeparator:/ 
     39 
     40# Location of role mapping file 
     41attributeAuthority.mapConfigFile: $NDGSEC_AACLNT_UNITTEST_DIR/siteBMapConfig.xml 
     42 
     43# Settings for custom AAUserRoles derived class to get user roles for given  
     44# user ID 
     45attributeAuthority.userRolesModFilePath: $NDGSEC_AACLNT_UNITTEST_DIR 
     46attributeAuthority.userRolesModName: siteBUserRoles 
     47attributeAuthority.userRolesClassName: TestUserRoles 
     48 
     49# Config for XML signature of Attribute Certificate 
     50attributeAuthority.signingPriKeyFilePath: $NDGSEC_AACLNT_UNITTEST_DIR/siteB-aa.key 
     51attributeAuthority.signingCertFilePath: $NDGSEC_AACLNT_UNITTEST_DIR/siteB-aa.crt 
     52attributeAuthority.caCertFilePathList: $NDGSEC_AACLNT_UNITTEST_DIR/ca/ndg-test-ca.crt 
    1753 
    1854[server:main] 
     
    3268paste.filter_app_factory = ndg.security.server.wsgi.soap:SOAPBindingMiddleware 
    3369ServiceSOAPBindingClass = ndg.security.server.zsi.attributeauthority.AttributeAuthorityWS 
     70ServiceSOAPBindingPropPrefix = AttributeAuthority 
     71AttributeAuthority.propPrefix = attributeAuthority 
     72AttributeAuthority.propFilePath = $NDGSEC_AACLNT_UNITTEST_DIR/wsgi/site-b.ini 
    3473referencedFilters = wsseSignatureVerificationFilter01 
    3574path = /AttributeAuthority 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/attAuthority/wsgi/siteAServerApp.py

    r4233 r4245  
    3838if __name__ == '__main__': 
    3939    import sys 
     40    import logging 
     41    logging.basicConfig(level=logging.DEBUG) 
     42 
    4043    if len(sys.argv) > 1: 
    4144        port = int(sys.argv[1]) 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/attAuthority/wsgi/siteBServerApp.py

    r4238 r4245  
    1616def infoApp(environ, start_response): 
    1717    start_response('200 OK', [('Content-type', 'text/plain')]) 
    18     return "NDG Security Attribute Authority Unit Tests: Site A Server" 
     18    return "NDG Security Attribute Authority Unit Tests: Site B Server" 
    1919 
    2020def app_factory(global_config, **local_conf): 
     
    3232                                     "siteBAttAuthorityProperties.xml") 
    3333 
    34 # To start the Site A Attribute Authority run  
    35 # $ paster serve site-a.ini or run this file as a script 
    36 # $ ./siteAServerApp.py [port #] 
     34# To start the Site B Attribute Authority run  
     35# $ paster serve site-b.ini or run this file as a script 
     36# $ ./siteBServerApp.py [port #] 
    3737if __name__ == '__main__': 
    3838    import sys 
     39    import logging 
     40    logging.basicConfig(level=logging.DEBUG) 
     41 
    3942    if len(sys.argv) > 1: 
    4043        port = int(sys.argv[1]) 
Note: See TracChangeset for help on using the changeset viewer.