Ignore:
Timestamp:
21/09/07 11:31:27 (13 years ago)
Author:
pjkersha
Message:

ndg.security.server/setup.py: added *.conf for conf/ openssl.conf file

ndg.security.server/ndg/security/server/AttAuthority/init.py:

  • Use RotatingFileHandler? from logging package to enable store of ACs issued to be limited. Properties file attCertFileLogCnt sets maximum number of files created before rotation.
  • newAttCertFilePath() is replaced by rotating file handler functionality
  • added logging with some debug messages - more needed to complete

ndg.security.server/ndg/security/server/conf/attCert/init.py

  • renamed to ndg.security.test/ndg/security/test/AttAuthority/attCertLog/init.py

ndg.security.server/ndg/security/server/conf/userRoles.py: userIsRegistered should return bool

ndg.security.server/ndg/security/server/conf/attAuthorityProperties.xml,
ndg.security.test/ndg/security/test/AttAuthority/siteAAttAuthorityProperties.xml,
ndg.security.test/ndg/security/test/AttAuthority/siteBAttAuthorityProperties.xml:

  • filled in default values for most attributes to ease installation config tasks
  • attCertFilePfx and attCertFileSfx replaced with attCertFileName and attCertFileLog attributes for new AC logging.

ndg.security.client/ndg/security/client/ndgSessionClient.py: removed debug calls. This module may now be surplus because of Pylons framework and plans for Java and PHP clients.

ndg.security.test/ndg/security/test/AttAuthority/siteAUserRoles.py: added coapec for testing

ndg.security.test/ndg/security/test/AttAuthority/siteAMapConfig.xml: fix formatting

ndg.security.test/ndg/security/test/AttAuthority/attAuthorityClientTest.cfg: altered settings for tests

ndg.security.test/ndg/security/test/Log/LogTest.py: exptd with log config. Eventually change to be harness for SOAP log interface

Makefile: use default python + added force target.

Location:
TI12-security/trunk/python/ndg.security.test/ndg/security/test
Files:
2 added
6 edited

Legend:

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

    r2884 r2900  
    1010# ! SiteBMapConfig.xml trusted site A aaURI setting must agree with this  
    1111# setting for test6GetMappedAttCert 
    12 uri = https://localhost:5000/AttributeAuthority 
     12uri = http://localhost:5000/AttributeAuthority 
    1313#uri = https://localhost:5000/AttributeAuthority 
    1414#uri = http://glue.badc.rl.ac.uk/DEWS/MarineDataServer/AttributeAuthority 
     
    6868#issuingclntcertfilepath = ./proxy-cert.pem 
    6969# Setup for use by testGetMappedAttCert test 
    70 attCertFilePath = ./ac.xml 
     70attCertFilePath = ./ac-clnt.xml 
    7171 
    7272[test6GetAttCertWithUserIdSet] 
     
    103103# Marine Data Server 
    104104#uri = http://glue.badc.rl.ac.uk/DEWS/MarineDataServer/AttributeAuthority 
    105 userAttCertFilePath = ./ac.xml 
     105userAttCertFilePath = ./ac-clnt.xml 
     106 
    106107mappedAttCertFilePath = ./mapped-ac.xml 
    107108 
     
    129130 
    130131uri = http://localhost:5000/AttributeAuthority 
    131 userAttCertFilePathList = ./ac.xml 
     132userAttCertFilePathList = ./ac-clnt.xml 
    132133 
    133134 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/AttAuthority/siteAAttAuthorityProperties.xml

    r2884 r2900  
    33    <name>Site A</name> 
    44    <portNum>5000</portNum> 
    5     <useSSL>Yes</useSSL> <!-- leave blank to use http --> 
     5    <useSSL></useSSL> <!-- leave blank to use http --> 
    66    <sslCertFile>$NDGSEC_AA_UNITTEST_DIR/aa-cert.pem</sslCertFile> 
    77    <sslKeyFile>$NDGSEC_AA_UNITTEST_DIR/aa-key.pem</sslKeyFile> 
     
    2020    <attCertLifetime>28800</attCertLifetime> 
    2121    <attCertNotBeforeOff>0</attCertNotBeforeOff> 
    22     <attCertFilePfx>ac-</attCertFilePfx> 
    23     <attCertFileSfx>.xml</attCertFileSfx> 
     22    <attCertFileName>ac.xml</attCertFileName> 
     23    <attCertFileLogCnt>16</attCertFileLogCnt> 
    2424    <mapConfigFile>$NDGSEC_AA_UNITTEST_DIR/siteAMapConfig.xml</mapConfigFile> 
    25     <attCertDir>$NDGSEC_AA_UNITTEST_DIR</attCertDir> 
     25    <attCertDir>$NDGSEC_AA_UNITTEST_DIR/attCertLog</attCertDir> 
    2626    <dnSeparator>/</dnSeparator> 
    2727    <userRolesModFilePath>$NDGSEC_AA_UNITTEST_DIR</userRolesModFilePath> 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/AttAuthority/siteAMapConfig.xml

    r2739 r2900  
    11<?xml version="1.0" encoding="utf-8"?> 
    22<AAmap> 
    3         <thisHost name="Site A"> 
    4             <aaURI>thisHostAttAuthorityURI</aaURI> 
    5             <loginURI>login</loginURI> 
     3    <thisHost name="Site A"> 
     4        <aaURI>thisHostAttAuthorityURI</aaURI> 
     5        <loginURI>login</loginURI> 
    66        </thisHost> 
    77    <trusted name="Site C"> 
    8             <aaURI>attAuthorityURI</aaURI> 
    9             <loginURI>http://www.sitec.blah/loginPageURI</loginURI> 
    10                 <role remote="StaffMember" local="staff"/> 
     8        <aaURI>attAuthorityURI</aaURI> 
     9        <loginURI>http://www.sitec.blah/loginPageURI</loginURI> 
     10        <role remote="StaffMember" local="staff"/> 
    1111    </trusted> 
    1212    <trusted name="Site D"> 
    13             <aaURI>attAuthorityURI</aaURI> 
    14             <loginURI>loginPageURI</loginURI> 
    15                 <role remote="academic" local="postgrad"/> 
    16                 <role remote="student" local="SiteDStudent"/> 
    17                 <role remote="eoGroup" local="atsr-archive"/> 
     13        <aaURI>attAuthorityURI</aaURI> 
     14        <loginURI>loginPageURI</loginURI> 
     15        <role remote="academic" local="postgrad"/> 
     16        <role remote="student" local="SiteDStudent"/> 
     17        <role remote="eoGroup" local="atsr-archive"/> 
    1818    </trusted> 
    1919</AAmap> 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/AttAuthority/siteAUserRoles.py

    r2270 r2900  
    2929 
    3030    def getRoles(self, userId): 
    31         return ['staff', 'postdoc', 'undergrad']  
     31        return ['staff', 'postdoc', 'undergrad', 'coapec']  
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/AttAuthority/siteBAttAuthorityProperties.xml

    r2350 r2900  
    2020    <attCertLifetime>28800</attCertLifetime> 
    2121    <attCertNotBeforeOff>0</attCertNotBeforeOff> 
    22     <attCertFilePfx>ac-</attCertFilePfx> 
    23     <attCertFileSfx>.xml</attCertFileSfx> 
     22    <attCertFileName>ac.xml</attCertFileName> 
     23    <attCertFileLogCnt>16</attCertFileLogCnt> 
    2424    <mapConfigFile>$NDGSEC_AA_UNITTEST_DIR/siteBMapConfig.xml</mapConfigFile> 
    25     <attCertDir>$NDGSEC_AA_UNITTEST_DIR</attCertDir> 
     25    <attCertDir>$NDGSEC_AA_UNITTEST_DIR/attCertLog</attCertDir> 
    2626    <dnSeparator>/</dnSeparator> 
    2727    <userRolesModFilePath>$NDGSEC_AA_UNITTEST_DIR</userRolesModFilePath> 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/Log/LogTest.py

    r2686 r2900  
    1212""" 
    1313import unittest 
    14  
    15 from ndg.security.server.Log import * 
     14import os 
     15import logging 
     16#logging.basicConfig(level=logging.DEBUG, 
     17#                    format='%(asctime)s %(levelname)-8s %(message)s', 
     18#                    datefmt='%a, %d %b %Y %H:%M:%S', 
     19#                    filename='./ndg.log', 
     20#                    filemode='w') 
     21from logging.config import fileConfig 
     22fileConfig('log.cfg') 
     23log = logging.getLogger(__name__) 
    1624 
    1725class LogTestCase(unittest.TestCase): 
    1826 
    1927    def setUp(self): 
    20         self.log = Log(logName='LogUnitTest', 
    21                        logFilePath="./ndg.log",  
    22                        console=True, 
    23                        sysLog=True) 
    24          
    25         # Force rotating file handler to produce multiple files 
    26         self.log.__class__.maxBytes = 10 
     28        pass 
     29     
     30    def __output(self): 
     31        print log 
     32        log.info('Jackdaws love my big sphinx of quartz.') 
     33     
     34        log.debug('Quick zephyrs blow, vexing daft Jim.') 
     35        log.info('How quickly daft jumping zebras vex.') 
     36        log.warning('Jail zesty vixen who grabbed pay from quack.') 
     37        log.error('The five boxing wizards jump quickly.') 
    2738 
    28     def test(self): 
    29          
    30         self.log.info('Jackdaws love my big sphinx of quartz.') 
    31      
    32         self.log.debug('Quick zephyrs blow, vexing daft Jim.') 
    33         self.log.info('How quickly daft jumping zebras vex.') 
    34         self.log.warning('Jail zesty vixen who grabbed pay from quack.') 
    35         self.log.error('The five boxing wizards jump quickly.') 
    36              
     39 
     40    def test1(self): 
     41        self.__output() 
     42           
    3743             
    3844#_____________________________________________________________________________        
Note: See TracChangeset for help on using the changeset viewer.