Changeset 6440
- Timestamp:
- 29/01/10 14:07:36 (11 years ago)
- Location:
- TI12-security/trunk/NDGSecurity/python
- Files:
-
- 81 added
- 2 deleted
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
TI12-security/trunk/NDGSecurity/python/Makefile
r6243 r6440 83 83 ${EPYDOC} ./ndg_security_*/ndg -o ${EPYDOC_OUTDIR} \ 84 84 --name ${EPYDOC_NAME} ${EPYDOC_FRAMES_OPT} --include-log --graph=all -v \ 85 > ${EPYDOC_LOGFILE}85 --exclude=nosetests.* > ${EPYDOC_LOGFILE} 86 86 87 87 # Install epydoc on web server - set environment variables in a setup script -
TI12-security/trunk/NDGSecurity/python/Tests/m2Crypto/test_sslClntAuthN.py
r4603 r6440 56 56 # self.socket.connect(self.server_address) 57 57 # self.connected = True 58 from ndg.security.common. m2CryptoSSLUtilityimport HTTPSConnection58 from ndg.security.common.utils.m2crypto import HTTPSConnection 59 59 60 60 if __name__ == "__main__": -
TI12-security/trunk/NDGSecurity/python/Tests/m2Crypto/unicode.py
r4082 r6440 1 1 #!/use/bin/env python 2 2 #from M2Crypto.httpslib import HTTPSConnection 3 from ndg.security.common. m2CryptoSSLUtilityimport HTTPSConnection3 from ndg.security.common.utils.m2crypto import HTTPSConnection 4 4 5 5 #hostname = u'ndgbeta.badc.rl.ac.uk' -
TI12-security/trunk/NDGSecurity/python/ndg_security_common/ndg/security/common/X509.py
r6040 r6440 368 368 dtNow, 369 369 self.__dtNotAfter)) 370 log.error(msg) 370 371 if raiseExcep: 371 372 raise X509CertExpired(msg) -
TI12-security/trunk/NDGSecurity/python/ndg_security_common/ndg/security/common/__init__.py
r4840 r6440 19 19 'attributeauthority', 20 20 'AttCert', 21 'saml_utils', 22 'soap', 21 23 'credentialwallet', 22 'm2CryptoSSLUtility',23 24 'openssl', 24 25 'sessionmanager', -
TI12-security/trunk/NDGSecurity/python/ndg_security_common/ndg/security/common/attributeauthority.py
r6062 r6440 36 36 DomletteElementProxy 37 37 from ndg.security.common.AttCert import AttCert, AttCertParse 38 from ndg.security.common. m2CryptoSSLUtilityimport HTTPSConnection, HostCheck38 from ndg.security.common.utils.m2crypto import HTTPSConnection, HostCheck 39 39 from ndg.security.common.zsi.httpproxy import ProxyHTTPConnection 40 40 -
TI12-security/trunk/NDGSecurity/python/ndg_security_common/ndg/security/common/sessionmanager.py
r5441 r6440 27 27 28 28 from ndg.security.common.AttCert import AttCert, AttCertParse 29 from ndg.security.common. m2CryptoSSLUtilityimport HTTPSConnection, \29 from ndg.security.common.utils.m2crypto import HTTPSConnection, \ 30 30 HostCheck 31 31 from ndg.security.common.zsi.httpproxy import ProxyHTTPConnection -
TI12-security/trunk/NDGSecurity/python/ndg_security_common/ndg/security/common/utils/classfactory.py
r6069 r6440 13 13 log = logging.getLogger(__name__) 14 14 15 15 16 class ClassFactoryError(Exception): 16 17 """Exception handling for NDG classfactory module.""" … … 18 19 log.error(msg) 19 20 Exception.__init__(self, msg) 21 20 22 21 23 def importClass(moduleName, className=None, objectType=None): … … 57 59 58 60 59 def instantiateClass(moduleName, className , moduleFilePath=None,61 def instantiateClass(moduleName, className=None, moduleFilePath=None, 60 62 objectType=None, classArgs=(), classProperties={}): 61 63 ''' -
TI12-security/trunk/NDGSecurity/python/ndg_security_server/ndg/security/server/wsgi/authn.py
r6264 r6440 30 30 SessionHandlerMiddleware) 31 31 32 from ndg.security.server.wsgi.ssl import AuthKitSSLAuthnMiddleware 32 33 33 34 class AuthnException(NDGSecurityMiddlewareError): … … 51 52 '''HTTP Basic Authentication Middleware 52 53 ''' 53 54 54 AUTHN_FUNC_ENV_KEYNAME = ('ndg.security.server.wsgi.authn.' 55 55 'HTTPBasicAuthMiddleware.authenticate') … … 280 280 quotedReturn2URI = urllib.quote(return2URI, safe='') 281 281 return2URIQueryArg = urllib.urlencode( 282 283 282 {AuthnRedirectInitiatorMiddleware.RETURN2URI_ARGNAME: 283 quotedReturn2URI}) 284 284 285 285 redirectURI = self.redirectURI … … 306 306 """ 307 307 if status.startswith(cls.TRIGGER_HTTP_STATUS_CODE): 308 log.debug("%s.checker caught status [%s]: invoking authentication "309 " 308 log.debug("%s.checker caught status [%s]: invoking authentication " 309 "handler", cls.__name__, cls.TRIGGER_HTTP_STATUS_CODE) 310 310 return True 311 311 else: … … 326 326 which performs a similar function. 327 327 """ 328 328 329 @NDGSecurityMiddlewareBase.initCall 329 330 def __call__(self, environ, start_response): … … 345 346 346 347 # Check for a return URI setting in the beaker session and if the user 347 # is authenticated, redirect to this URL deleting the beaker session 348 # has just been authenticated by the AuthKit SSL Client authentication 349 # middleware. If so, redirect to this URL deleting the beaker session 348 350 # URL setting 349 351 return2URI = session.get(self.__class__.RETURN2URI_ARGNAME) 350 if self. isAuthenticated and return2URI:352 if self.sslAuthnSucceeded and return2URI: 351 353 del session[self.__class__.RETURN2URI_ARGNAME] 352 354 session.save() … … 366 368 doc="Boolean indicating if AuthKit " 367 369 "'REMOTE_USER' environment variable is set") 370 371 _sslAuthnSucceeded = lambda self: self.environ.get( 372 AuthKitSSLAuthnMiddleware.AUTHN_SUCCEEDED_ENVIRON_KEYNAME, 373 False) 374 375 sslAuthnSucceeded = property(fget=_sslAuthnSucceeded, 376 doc="Boolean indicating SSL authentication " 377 "has succeeded in " 378 "AuthKitSSLAuthnMiddleware upstream of " 379 "this middleware") 380 368 381 def __init__(self, app, app_conf, **local_conf): 369 382 super(AuthKitRedirectResponseMiddleware, self).__init__(app, app_conf, -
TI12-security/trunk/NDGSecurity/python/ndg_security_server/ndg/security/server/wsgi/openid/provider/__init__.py
r6354 r6440 85 85 # Place here to avoid circular import error with IdentityMapping class 86 86 from ndg.security.server.wsgi.openid.provider.authninterface import ( 87 AbstractAuthNInterface, AuthNInterfaceError) 87 AbstractAuthNInterface, AuthNInterfaceError, 88 AuthNInterfaceInvalidCredentials) 88 89 from ndg.security.server.wsgi.openid.provider.axinterface import (AXInterface, 89 90 MissingRequiredAttrs, AXInterfaceReloginRequired) … … 127 128 @type: defPaths: dict 128 129 129 @cvar formRespWrapperTmpl: If the response to the Relying Party is too long130 it's rendered as form with the POST method instead of query arguments in a131 GET 302 redirect. Wrap the form in this document to make the form submit132 automatically without user intervention. See _displayResponse method130 @cvar FORM_RESP_WRAPPER_TMPL: If the response to the Relying Party is too 131 long it's rendered as form with the POST method instead of query arguments 132 in a GET 302 redirect. Wrap the form in this document to make the form 133 submit automatically without user intervention. See _displayResponse method 133 134 below... 134 @type formRespWrapperTmpl: basestring"""135 136 formRespWrapperTmpl= """<html>135 @type FORM_RESP_WRAPPER_TMPL: basestring""" 136 137 FORM_RESP_WRAPPER_TMPL = """<html> 137 138 <head> 138 139 <script type="text/javascript"> 139 140 function doRedirect() 140 141 { 142 document.forms[0].style.visibility = "hidden"; 141 143 document.forms[0].submit(); 142 144 } … … 361 363 os.path.expandvars(opt['consumer_store_dirpath'])) 362 364 self.oidserver = server.Server(store, self.urls['url_openidserver']) 363 364 def getCharset(self):365 return self.__charset366 367 def getPaths(self):368 return self.__paths369 370 def getBase_url(self):371 return self.__base_url372 373 def getUrls(self):374 return self.__urls375 376 def getMethod(self):377 return self.__method378 379 def getSessionMiddlewareEnvironKeyName(self):380 return self.__sessionMiddlewareEnvironKeyName381 382 def getSession(self):383 return self.__session384 385 def setCharset(self, value):386 # Convert from string type where required387 if not value:388 self.__charset = ''389 elif isinstance(value, basestring):390 self.__charset = '; charset=' + value391 else:392 raise TypeError('Expecting string type for "charset" attribute; '393 'got %r' % type(value))394 395 def setPaths(self, value):396 if not isinstance(value, dict):397 raise TypeError('Expecting dict type for '398 '"paths" attribute; got %r' %399 type(value))400 self.__paths = value401 402 def setBase_url(self, value):403 if not isinstance(value, basestring):404 raise TypeError('Expecting string type for '405 '"base_url" attribute; got %r' %406 type(value))407 self.__base_url = value408 409 def setUrls(self, value):410 if not isinstance(value, dict):411 raise TypeError('Expecting dict type for '412 '"urls" attribute; got %r' %413 type(value))414 self.__urls = value415 416 def setMethod(self, value):417 if not isinstance(value, dict):418 raise TypeError('Expecting dict type for '419 '"method" attribute; got %r' %420 type(value))421 self.__method = value422 423 def setSessionMiddlewareEnvironKeyName(self, value):424 if not isinstance(value, basestring):425 raise TypeError('Expecting string type for '426 '"sessionMiddlewareEnvironKeyName" attribute; '427 'got %r' %428 type(value))429 self.__sessionMiddlewareEnvironKeyName = value430 431 def setSession(self, value):432 if not isinstance(value, beaker.session.SessionObject):433 raise TypeError('Expecting beaker.session.SessionObject type for '434 '"session" attribute; got %r' %435 type(value))436 437 self.__session = value438 439 def getOidResponse(self):440 return self.__oidResponse441 442 def getSregResponse(self):443 return self.__sregResponse444 445 def getAxResponse(self):446 return self.__axResponse447 448 def getOidserver(self):449 return self.__oidserver450 451 def getQuery(self):452 return self.__query453 454 def getTrustedRelyingParties(self):455 return self.__trustedRelyingParties456 457 def setOidResponse(self, value):458 if not isinstance(value, server.OpenIDResponse):459 raise TypeError('Expecting OpenIDResponse type for '460 '"oidResponse" attribute; got %r' %461 type(value))462 self.__oidResponse = value463 464 def setSregResponse(self, value):465 self.__sregResponse = value466 467 def setAxResponse(self, value):468 if not isinstance(value, AXInterface):469 raise TypeError('Expecting AXInterface type for '470 '"axResponse" attribute; got %r' %471 type(value))472 self.__axResponse = value473 474 def setOidserver(self, value):475 if not isinstance(value, server.Server):476 raise TypeError('Expecting openid.server.server.Server type for '477 '"oidserver" attribute; got %r' %478 type(value))479 self.__oidserver = value480 481 def setQuery(self, value):482 if not isinstance(value, dict):483 raise TypeError('Expecting dict type for '484 '"query" attribute; got %r' %485 type(value))486 self.__query = value487 488 def setTrustedRelyingParties(self, value):489 if isinstance(value, basestring):490 pat = OpenIDProviderMiddleware.TRUSTED_RELYINGPARTIES_SEP_PAT491 self.__trustedRelyingParties = tuple([i for i in pat.split(value)])492 493 elif isinstance(value, (list, tuple)):494 self.__trustedRelyingParties = tuple(value)495 else:496 raise TypeError('Expecting list or tuple type for '497 '"trustedRelyingParties" attribute; got %r' %498 type(value))499 365 500 366 @classmethod … … 797 663 identity = oidRequest.identity 798 664 799 trust_root = oidRequest.trust_root 800 if self.query.get('remember', 'no').lower() == 'yes': 801 self.session[ 802 OpenIDProviderMiddleware.APPROVED_FLAG_SESSION_KEYNAME] = { 803 trust_root: 'always' 804 } 805 self.session.save() 806 665 # Check for user selected to trust this RP for future logins. 666 self._applyTrustRoot(oidRequest) 667 807 668 # Check for POST'ed user explicit setting of AX parameters 808 669 self._applyUserAXSelections() … … 827 688 code=400) 828 689 690 def _applyTrustRoot(self, oidRequest): 691 """Check to see if user wants to trust the current Relying Party and if 692 so set record this decision in the session 693 """ 694 if self.query.get('remember', 'no').lower() == 'yes': 695 self.session[ 696 OpenIDProviderMiddleware.APPROVED_FLAG_SESSION_KEYNAME] = { 697 oidRequest.trust_root: 'always' 698 } 699 self.session.save() 700 829 701 def _applyUserAXSelections(self): 830 702 """Helper for do_allow method - process the query response checking … … 945 817 environ, 946 818 self.query['username']) 819 820 except AuthNInterfaceInvalidCredentials: 821 log.error("No username %r matching an OpenID URL: %s", 822 self.query.get('username'), 823 traceback.format_exc()) 824 msg = ("No match was found for your account name. Please " 825 "check that your details are correct or contact the " 826 "site administrator.") 827 828 response = self._render.login(environ, start_response, 829 msg=msg, 830 success_to=self.urls['url_decide']) 831 return response 832 947 833 except Exception: 948 log.error("Associating username %r with OpenID URL: %s" %949 (self.query.get('username'),950 traceback.format_exc()))951 msg = ("An internal error occured matching an OpenID"952 " to your account. If the problem persists"953 " contact your systemadministrator.")954 955 response = self._render. errorPage(environ,956 start_response,957 msg)834 log.error("Associating username %r with OpenID URL: %s", 835 self.query.get('username'), 836 traceback.format_exc()) 837 msg = ("An error occured matching an OpenID to your account. " 838 "If the problem persists contact the site " 839 "administrator.") 840 841 response = self._render.login(environ, start_response, 842 msg=msg, 843 success_to=self.urls['url_decide']) 958 844 return response 959 845 … … 1448 1334 # Wrap in HTML with Javascript OnLoad to submit the form 1449 1335 # automatically without user intervention 1450 response = OpenIDProviderMiddleware. formRespWrapperTmpl% \1336 response = OpenIDProviderMiddleware.FORM_RESP_WRAPPER_TMPL % \ 1451 1337 webresponse.body 1452 1338 else: … … 1478 1364 ('Location', url)]) 1479 1365 return [] 1366 1367 def getCharset(self): 1368 return self.__charset 1369 1370 def getPaths(self): 1371 return self.__paths 1372 1373 def getBase_url(self): 1374 return self.__base_url 1375 1376 def getUrls(self): 1377 return self.__urls 1378 1379 def getMethod(self): 1380 return self.__method 1381 1382 def getSessionMiddlewareEnvironKeyName(self): 1383 return self.__sessionMiddlewareEnvironKeyName 1384 1385 def getSession(self): 1386 return self.__session 1387 1388 def setCharset(self, value): 1389 # Convert from string type where required 1390 if not value: 1391 self.__charset = '' 1392 elif isinstance(value, basestring): 1393 self.__charset = '; charset=' + value 1394 else: 1395 raise TypeError('Expecting string type for "charset" attribute; ' 1396 'got %r' % type(value)) 1397 1398 def setPaths(self, value): 1399 if not isinstance(value, dict): 1400 raise TypeError('Expecting dict type for ' 1401 '"paths" attribute; got %r' % 1402 type(value)) 1403 self.__paths = value 1404 1405 def setBase_url(self, value): 1406 if not isinstance(value, basestring): 1407 raise TypeError('Expecting string type for ' 1408 '"base_url" attribute; got %r' % 1409 type(value)) 1410 self.__base_url = value 1411 1412 def setUrls(self, value): 1413 if not isinstance(value, dict): 1414 raise TypeError('Expecting dict type for ' 1415 '"urls" attribute; got %r' % 1416 type(value)) 1417 self.__urls = value 1418 1419 def setMethod(self, value): 1420 if not isinstance(value, dict): 1421 raise TypeError('Expecting dict type for ' 1422 '"method" attribute; got %r' % 1423 type(value)) 1424 self.__method = value 1425 1426 def setSessionMiddlewareEnvironKeyName(self, value): 1427 if not isinstance(value, basestring): 1428 raise TypeError('Expecting string type for ' 1429 '"sessionMiddlewareEnvironKeyName" attribute; ' 1430 'got %r' % 1431 type(value)) 1432 self.__sessionMiddlewareEnvironKeyName = value 1433 1434 def setSession(self, value): 1435 if not isinstance(value, beaker.session.SessionObject): 1436 raise TypeError('Expecting beaker.session.SessionObject type for ' 1437 '"session" attribute; got %r' % 1438 type(value)) 1439 1440 self.__session = value 1441 1442 def getOidResponse(self): 1443 return self.__oidResponse 1444 1445 def getSregResponse(self): 1446 return self.__sregResponse 1447 1448 def getAxResponse(self): 1449 return self.__axResponse 1450 1451 def getOidserver(self): 1452 return self.__oidserver 1453 1454 def getQuery(self): 1455 return self.__query 1456 1457 def getTrustedRelyingParties(self): 1458 return self.__trustedRelyingParties 1459 1460 def setOidResponse(self, value): 1461 if not isinstance(value, server.OpenIDResponse): 1462 raise TypeError('Expecting OpenIDResponse type for ' 1463 '"oidResponse" attribute; got %r' % 1464 type(value)) 1465 self.__oidResponse = value 1466 1467 def setSregResponse(self, value): 1468 self.__sregResponse = value 1469 1470 def setAxResponse(self, value): 1471 if not isinstance(value, AXInterface): 1472 raise TypeError('Expecting AXInterface type for ' 1473 '"axResponse" attribute; got %r' % 1474 type(value)) 1475 self.__axResponse = value 1476 1477 def setOidserver(self, value): 1478 if not isinstance(value, server.Server): 1479 raise TypeError('Expecting openid.server.server.Server type for ' 1480 '"oidserver" attribute; got %r' % 1481 type(value)) 1482 self.__oidserver = value 1483 1484 def setQuery(self, value): 1485 if not isinstance(value, dict): 1486 raise TypeError('Expecting dict type for ' 1487 '"query" attribute; got %r' % 1488 type(value)) 1489 self.__query = value 1490 1491 def setTrustedRelyingParties(self, value): 1492 if isinstance(value, basestring): 1493 pat = OpenIDProviderMiddleware.TRUSTED_RELYINGPARTIES_SEP_PAT 1494 self.__trustedRelyingParties = tuple([i for i in pat.split(value)]) 1495 1496 elif isinstance(value, (list, tuple)): 1497 self.__trustedRelyingParties = tuple(value) 1498 else: 1499 raise TypeError('Expecting list or tuple type for ' 1500 '"trustedRelyingParties" attribute; got %r' % 1501 type(value)) 1480 1502 1481 1503 charset = property(getCharset, setCharset, None, "Charset's Docstring") -
TI12-security/trunk/NDGSecurity/python/ndg_security_server/ndg/security/server/wsgi/openid/provider/renderinginterface/genshi/templates/base.html
r6127 r6440 10 10 <link rel="icon" type="image/ico" 11 11 href="${c.baseURL}/layout/favicon.jpg"/> 12 <script type="text/javascript" src="${c.baseURL}/js/toggleDiv.js"></script> 12 13 </head> 13 14 -
TI12-security/trunk/NDGSecurity/python/ndg_security_server/ndg/security/server/wsgi/openid/provider/renderinginterface/genshi/templates/decide.html
r6272 r6440 27 27 <td> 28 28 This site has also requested some additional information: 29 <table id="opAXRequestedAttributes"> 29 <span> 30 <a href="javascript:;" title="Toggle help" onclick="toggleDiv(1,'axHelp','shown','hidden','div'); return false;"> 31 <img src="/layout/icons/help.png" alt="Toggle help" class="helpicon"/></a> 32 </span> 33 <div id="axHelp" class="hidden"> 34 <div class="helptxt"> 35 <p>The site where you want to sign in has requested some additional 36 information as well as your OpenID. Review the list of items below. 37 The righthand column, "Return Item to Requesting Site?" has a tick box 38 assigned to each item. By unticking a given box you can prevent the 39 related item from being returned to the requested site. However, for 40 some items, the tick box may be disabled. This indicates that the 41 requesting site has marked this item as mandatory. In this case, 42 you can still choose the "No" button at the bottom off this form and 43 cancel sign in to the given site.</p> 44 <p>If you are otherwise happy to return the requested information, 45 select the "Yes" button</p> 46 </div> 47 </div> 48 <table id="opAXRequestedAttributes"> 30 49 <tr> 31 50 <th>Item</th> … … 33 52 <th>Return Item to Requesting Site?</th> 34 53 </tr> 35 <tr py:for="i in axRequestedAttr.values()"> 36 <td>${i.alias or i.type_uri}</td> 54 <?python 55 # Only get those attributes that it was possible to retrieve 56 # values for 57 requestedVals = [i for i in axRequestedAttr.values() 58 if axFetchResponse.getSingle(i.type_uri)] 59 ?> 60 <tr py:for="i in requestedVals"> 37 61 <?python 38 defaultVal = "<information not available from this site>"39 attrVal = axFetchResponse.getSingle(i.type_uri, default=defaultVal)40 41 62 # Disable checkbox if attribute is required and not optional 42 63 nameAttr = 'ax.%s' % i.alias 43 64 if i.required: 44 inputAttr = {'disabled': 'disabled' }65 inputAttr = {'disabled': 'disabled', 'checked': "checked"} 45 66 else: 46 67 inputAttr = {'id': i.alias, 'name': nameAttr, 'value': i.type_uri} 47 48 if attrVal == defaultVal:49 inputAttr.update({'disabled': 'disabled'})50 else:51 inputAttr.update({'checked': "checked"})52 68 ?> 53 <td>${attrVal}</td> 69 <td>${i.alias or i.type_uri}</td> 70 <td>${axFetchResponse.getSingle(i.type_uri)}</td> 54 71 <!-- hidden input is required to force the setting of disabled checkbox values --> 55 72 <td><input type="checkbox" py:attrs="inputAttr"/> 56 73 <input py:if="i.required" type="hidden" value="${i.type_uri}" name="$nameAttr"/></td> 57 74 </tr> -
TI12-security/trunk/NDGSecurity/python/ndg_security_server/ndg/security/server/wsgi/openid/relyingparty/__init__.py
r6354 r6440 54 54 middleware to return to following OpenID sign in. 55 55 ''' 56 OPENID_RP_PREFIX = 'openid.relyingparty.' 57 IDP_WHITELIST_CONFIG_FILEPATH_OPTNAME = 'idpWhitelistConfigFilePath' 58 SIGNIN_INTERFACE_MIDDLEWARE_CLASS_OPTNAME = 'signinInterfaceMiddlewareClass' 59 SIGNIN_INTERFACE_PREFIX = 'signinInterface.' 60 61 AUTHKIT_COOKIE_SIGNOUTPATH_OPTNAME = 'authkit.cookie.signoutpath' 62 AUTHKIT_OPENID_TMPL_OPTNAME_PREFIX = 'authkit.openid.template.' 63 AUTHKIT_OPENID_TMPL_OBJ_OPTNAME = AUTHKIT_OPENID_TMPL_OPTNAME_PREFIX + 'obj' 64 AUTHKIT_OPENID_TMPL_STRING_OPTNAME = AUTHKIT_OPENID_TMPL_OPTNAME_PREFIX + \ 65 'string' 66 AUTHKIT_OPENID_TMPL_FILE_OPTNAME = AUTHKIT_OPENID_TMPL_OPTNAME_PREFIX + \ 67 'file' 68 56 69 sslPropertyDefaults = { 57 'idpWhitelistConfigFilePath': None70 IDP_WHITELIST_CONFIG_FILEPATH_OPTNAME: None 58 71 } 59 72 propertyDefaults = { 60 'signinInterfaceMiddlewareClass': None,73 SIGNIN_INTERFACE_MIDDLEWARE_CLASS_OPTNAME: None, 61 74 'baseURL': '' 62 75 } … … 64 77 propertyDefaults.update(NDGSecurityMiddlewareBase.propertyDefaults) 65 78 66 def __init__(self, app, global_conf, prefix= 'openid.relyingparty.',79 def __init__(self, app, global_conf, prefix=OPENID_RP_PREFIX, 67 80 **app_conf): 68 81 """Add AuthKit and Beaker middleware dependencies to WSGI stack and … … 83 96 # Whitelisting of IDPs. If no config file is set, no validation is 84 97 # executed 98 cls = OpenIDRelyingPartyMiddleware 99 85 100 idpWhitelistConfigFilePath = app_conf.get( 86 prefix + 'idpWhitelistConfigFilePath')101 prefix + cls.IDP_WHITELIST_CONFIG_FILEPATH_OPTNAME) 87 102 if idpWhitelistConfigFilePath is not None: 88 103 self._initIdPValidation(idpWhitelistConfigFilePath) 89 104 90 105 # Check for sign in template settings 91 if prefix+'signinInterfaceMiddlewareClass' in app_conf: 92 if 'authkit.openid.template.obj' in app_conf or \ 93 'authkit.openid.template.string' in app_conf or \ 94 'authkit.openid.template.file' in app_conf: 95 log.warning("OpenID Relying Party " 96 "'signinInterfaceMiddlewareClass' " 97 "setting overrides 'authkit.openid.template.*' " 98 "AuthKit settings") 106 if prefix+cls.SIGNIN_INTERFACE_MIDDLEWARE_CLASS_OPTNAME in app_conf: 107 if (cls.AUTHKIT_OPENID_TMPL_OBJ_OPTNAME in app_conf or 108 cls.AUTHKIT_OPENID_TMPL_STRING_OPTNAME in app_conf or 109 cls.AUTHKIT_OPENID_TMPL_FILE_OPTNAME in app_conf): 99 110 100 signinInterfacePrefix = prefix+'signinInterface.' 111 log.warning("OpenID Relying Party %r setting overrides " 112 "'%s*' AuthKit settings", 113 cls.AUTHKIT_OPENID_TMPL_OPTNAME_PREFIX, 114 cls.SIGNIN_INTERFACE_MIDDLEWARE_CLASS_OPTNAME) 115 116 signinInterfacePrefix = prefix+cls.SIGNIN_INTERFACE_PREFIX 117 118 className = app_conf[ 119 prefix + cls.SIGNIN_INTERFACE_MIDDLEWARE_CLASS_OPTNAME] 101 120 classProperties = {'prefix': signinInterfacePrefix} 102 121 classProperties.update(app_conf) 103 app = instantiateClass(104 app_conf[prefix+'signinInterfaceMiddlewareClass'],105 None,106 objectType=SigninInterface,107 classArgs=(app, global_conf),108 classProperties=classProperties)122 123 app = instantiateClass(className, 124 None, 125 objectType=SigninInterface, 126 classArgs=(app, global_conf), 127 classProperties=classProperties) 109 128 110 129 # Delete sign in interface middleware settings … … 114 133 del conf[k] 115 134 116 app_conf['authkit.openid.template.string'] = app.makeTemplate() 135 app_conf[ 136 cls.AUTHKIT_OPENID_TMPL_STRING_OPTNAME] = app.makeTemplate() 117 137 118 self.signoutPath = app_conf.get( 'authkit.cookie.signoutpath')138 self.signoutPath = app_conf.get(cls.AUTHKIT_COOKIE_SIGNOUTPATH_OPTNAME) 119 139 120 140 app = authkit.authenticate.middleware(app, app_conf) … … 157 177 interface 158 178 - Manage AuthKit verify and process actions setting the referrer URI 159 to manage redirects 179 to manage redirects correctly 160 180 161 181 @type environ: dict … … 193 213 not referrerPathInfo.endswith(self._authKitVerifyPath) and 194 214 not referrerPathInfo.endswith(self._authKitProcessPath)): 195 # Subvert authkit.authenticate.open_id.AuthOpenIDHandler.process 215 216 # An app has redirected to the Relying Party interface setting the 217 # special ndg.security.r query argument. Subvert 218 # authkit.authenticate.open_id.AuthOpenIDHandler.process 196 219 # reassigning it's session 'referer' key to the URI specified in 197 # the referrer query argument setin the request URI220 # ndg.security.r in the request URI 198 221 session['referer'] = referrer 199 222 session.save() … … 230 253 _status = status 231 254 for name, val in header: 232 if name.lower() == 'content-type' and \233 val.startswith('text/html'):255 if (name.lower() == 'content-type' and 256 val.startswith('text/html')): 234 257 _status = self.getStatusMessage(401) 235 258 break … … 293 316 Exception.__init__(self, msg, **kw) 294 317 318 295 319 class SigninInterfaceInitError(SigninInterfaceError): 296 320 """Error with initialisation of SigninInterface. Raise from __init__""" 297 321 errorMsg = "SigninInterface initialisation error" 298 322 323 299 324 class SigninInterfaceConfigError(SigninInterfaceError): 300 325 """Error with configuration settings. Raise from __init__""" 301 326 errorMsg = "SigninInterface configuration error" 327 302 328 303 329 class SigninInterface(NDGSecurityMiddlewareBase): -
TI12-security/trunk/NDGSecurity/python/ndg_security_server/ndg/security/server/wsgi/openid/relyingparty/signin_interface/genshi/public/layout/default.css
r6245 r6440 12 12 line-height:1.4; 13 13 font-size: small; 14 } 15 16 .helptxt { 17 font-size: smaller; 18 background-color: #e6f0f8; 19 } 20 21 div.hidden { 22 display: none; 23 } 24 25 .helpicon 26 { 27 cursor:help; 14 28 } 15 29 -
TI12-security/trunk/NDGSecurity/python/ndg_security_server/ndg/security/server/wsgi/openid/relyingparty/signin_interface/genshi/templates/base.html
r6202 r6440 10 10 <link rel="icon" type="image/ico" 11 11 href="${c.baseURL}/layout/favicon.jpg"/> 12 <script type="text/javascript" src="${c.baseURL}/js/toggleDiv.js"></script> 12 13 </head> 13 14 -
TI12-security/trunk/NDGSecurity/python/ndg_security_server/ndg/security/server/wsgi/openid/relyingparty/signin_interface/genshi/templates/signin.html
r6113 r6440 35 35 input.openid-identifier { 36 36 background: url($c.baseURL/layout/openid-inputicon.gif) no-repeat; 37 background-color: #fff;38 37 background-position: 0 50%; 39 38 padding-left: 18px; -
TI12-security/trunk/NDGSecurity/python/ndg_security_server/ndg/security/server/wsgi/session.py
r6271 r6440 148 148 "path [%s]", self.signoutPath) 149 149 150 referrer = environ.get('HTTP_REFERER') 151 if referrer is not None: 152 def _start_response(status, header, exc_info=None): 153 """Alter the header to send a redirect to the logout 154 referrer address""" 155 filteredHeader = [(field, val) for field, val in header 156 if field.lower() != 'location'] 157 filteredHeader.extend([('Location', referrer)]) 158 return start_response(self.getStatusMessage(302), 159 filteredHeader, 160 exc_info) 161 162 else: 163 log.error('No referrer set for redirect following logout') 164 _start_response = start_response 165 166 # Clear user details from beaker session 167 for keyName in self.__class__.SESSION_KEYNAMES: 168 session.pop(keyName, None) 169 session.save() 150 _start_response = self._doLogout(environ, start_response, session) 170 151 else: 171 152 log.debug("SessionHandlerMiddleware.__call__: checking for " 172 153 "REMOTE_* environment variable settings set by OpenID " 173 154 "Relying Party signin...") 174 175 if SessionHandlerMiddleware.USERNAME_SESSION_KEYNAME not in session\ 176 and SessionHandlerMiddleware.USERNAME_ENVIRON_KEYNAME in environ: 177 log.debug("SessionHandlerMiddleware.__call__: updating session " 178 "username=%s", environ[ 179 SessionHandlerMiddleware.USERNAME_ENVIRON_KEYNAME]) 155 self._setSession(environ, session) 156 157 _start_response = start_response 158 159 return self._app(environ, _start_response) 160 161 def _doLogout(self, environ, start_response, session): 162 """Execute logout action, 163 - clear the beaker session 164 - set the referrer URI to redirect back to by setting a custom 165 start_response function which modifies the HTTP header setting the 166 location field for a redirect 167 168 @param environ: environment dictionary 169 @type environ: dict like object 170 @type start_response: function 171 @param start_response: standard WSGI start response function 172 @param session: beaker session 173 @type session: beaker.session.SessionObject 174 """ 175 176 # Clear user details from beaker session 177 for keyName in self.__class__.SESSION_KEYNAMES: 178 session.pop(keyName, None) 179 session.save() 180 181 referrer = environ.get('HTTP_REFERER') 182 if referrer is not None: 183 def _start_response(status, header, exc_info=None): 184 """Alter the header to send a redirect to the logout 185 referrer address""" 186 filteredHeader = [(field, val) for field, val in header 187 if field.lower() != 'location'] 188 filteredHeader.extend([('Location', referrer)]) 189 return start_response(self.getStatusMessage(302), 190 filteredHeader, 191 exc_info) 180 192 181 session[SessionHandlerMiddleware.USERNAME_SESSION_KEYNAME 182 ] = environ[ 183 SessionHandlerMiddleware.USERNAME_ENVIRON_KEYNAME] 184 session.save() 185 186 remoteUserData = environ.get( 193 return _start_response 194 else: 195 log.error('No referrer set for redirect following logout') 196 return start_response 197 198 def _setSession(self, environ, session): 199 """Check for REMOTE_USER and REMOTE_USER_DATA set by authentication 200 handlers and set a new session from them if present 201 202 @type environ: dict like object 203 @param environ: WSGI environment variables dictionary 204 @param session: beaker session 205 @type session: beaker.session.SessionObject 206 """ 207 208 # Set user id 209 if (SessionHandlerMiddleware.USERNAME_SESSION_KEYNAME not in session 210 and SessionHandlerMiddleware.USERNAME_ENVIRON_KEYNAME in environ): 211 212 log.debug("SessionHandlerMiddleware.__call__: updating session " 213 "username=%s", environ[ 214 SessionHandlerMiddleware.USERNAME_ENVIRON_KEYNAME]) 215 216 session[SessionHandlerMiddleware.USERNAME_SESSION_KEYNAME 217 ] = environ[ 218 SessionHandlerMiddleware.USERNAME_ENVIRON_KEYNAME] 219 session.save() 220 221 # Check for auxiliary user data 222 remoteUserData = environ.get( 187 223 SessionHandlerMiddleware.USERDATA_ENVIRON_KEYNAME, '') 188 if remoteUserData: 189 log.debug("SessionHandlerMiddleware.__call__: found " 190 "REMOTE_USER_DATA=%s, set from OpenID Relying Party " 191 "signin", 192 environ[ 193 SessionHandlerMiddleware.USERDATA_ENVIRON_KEYNAME 194 ]) 224 if remoteUserData: 225 log.debug("SessionHandlerMiddleware.__call__: found " 226 "REMOTE_USER_DATA=%s, set from OpenID Relying Party " 227 "signin", 228 environ[ 229 SessionHandlerMiddleware.USERDATA_ENVIRON_KEYNAME 230 ]) 231 232 if (SessionHandlerMiddleware.SM_URI_SESSION_KEYNAME not in 233 session or 234 SessionHandlerMiddleware.ID_SESSION_KEYNAME not in session): 195 235 196 236 # eval is safe here because AuthKit cookie is signed and 197 # AuthKit middleware checks for tampering 198 if (SessionHandlerMiddleware.SM_URI_SESSION_KEYNAME not in 199 session or 200 SessionHandlerMiddleware.ID_SESSION_KEYNAME not in session): 201 202 axData = eval(remoteUserData) 203 if (isinstance(axData, dict) and 204 SessionHandlerMiddleware.AX_KEYNAME in axData): 237 # AuthKit middleware checks for tampering 238 axData = eval(remoteUserData) 239 if (isinstance(axData, dict) and 240 SessionHandlerMiddleware.AX_KEYNAME in axData): 241 242 ax = axData[SessionHandlerMiddleware.AX_KEYNAME] 243 244 # Save attributes keyed by attribute name 245 session[SessionHandlerMiddleware.AX_SESSION_KEYNAME 246 ] = SessionHandlerMiddleware._parseOpenIdAX(ax) 247 248 log.debug("SessionHandlerMiddleware.__call__: updated " 249 "session with OpenID AX values: %r", 250 session[ 251 SessionHandlerMiddleware.AX_SESSION_KEYNAME 252 ]) 205 253 206 ax = axData[SessionHandlerMiddleware.AX_KEYNAME] 254 # Save Session Manager specific attributes 255 sessionManagerURI = ax.get( 256 SessionHandlerMiddleware.SM_URI_AX_KEYNAME) 207 257 208 # Save attributes keyed by attribute name 209 session[ 210 SessionHandlerMiddleware.AX_SESSION_KEYNAME 211 ] = SessionHandlerMiddleware._parseOpenIdAX(ax) 212 213 log.debug("SessionHandlerMiddleware.__call__: updated " 214 "session with OpenID AX values: %r" % 215 session[ 216 SessionHandlerMiddleware.AX_SESSION_KEYNAME 217 ]) 258 session[SessionHandlerMiddleware.SM_URI_SESSION_KEYNAME 259 ] = sessionManagerURI 260 261 sessionId = ax.get( 262 SessionHandlerMiddleware.SESSION_ID_AX_KEYNAME) 263 session[SessionHandlerMiddleware.ID_SESSION_KEYNAME 264 ] = sessionId 218 265 219 # Save Session Manager specific attributes 220 sessionManagerURI = ax.get( 221 SessionHandlerMiddleware.SM_URI_AX_KEYNAME) 222 223 session[SessionHandlerMiddleware.SM_URI_SESSION_KEYNAME 224 ] = sessionManagerURI 225 226 sessionId = ax.get( 227 SessionHandlerMiddleware.SESSION_ID_AX_KEYNAME) 228 session[SessionHandlerMiddleware.ID_SESSION_KEYNAME 229 ] = sessionId 230 231 session.save() 232 233 log.debug("SessionHandlerMiddleware.__call__: updated " 234 "session " 235 "with sessionManagerURI=%s and " 236 "sessionId=%s", 237 sessionManagerURI, 238 sessionId) 239 240 # Reset cookie removing user data 241 setUser = environ[ 266 session.save() 267 268 log.debug("SessionHandlerMiddleware.__call__: updated " 269 "session " 270 "with sessionManagerURI=%s and " 271 "sessionId=%s", 272 sessionManagerURI, 273 sessionId) 274 275 # Reset cookie removing user data by accessing the Auth ticket 276 # function available from environ 277 setUser = environ[ 242 278 SessionHandlerMiddleware.AUTH_TKT_SET_USER_ENVIRON_KEYNAME] 243 setUser( 244 session[SessionHandlerMiddleware.USERNAME_SESSION_KEYNAME]) 245 else: 246 log.debug("SessionHandlerMiddleware.__call__: REMOTE_USER_DATA " 247 "is not set") 248 249 _start_response = start_response 250 251 return self._app(environ, _start_response) 252 279 setUser(session[SessionHandlerMiddleware.USERNAME_SESSION_KEYNAME]) 280 else: 281 log.debug("SessionHandlerMiddleware.__call__: REMOTE_USER_DATA " 282 "is not set") 283 253 284 @staticmethod 254 285 def _parseOpenIdAX(ax): -
TI12-security/trunk/NDGSecurity/python/ndg_security_server/ndg/security/server/wsgi/ssl.py
r6069 r6440 69 69 70 70 PARAM_PREFIX = 'sslAuthn.' 71 72 # isValidCert requires special parsing of certificate when passed via a 73 # proxy 74 X509_CERT_PAT = re.compile('(\s?-----[A-Z]+\sCERTIFICATE-----\s?)|\s+') 75 76 # Flag to other middleware that authentication succeeded by setting this key 77 # in the environ to True. This is done in the isValidCert method 78 AUTHN_SUCCEEDED_ENVIRON_KEYNAME = ('ndg.security.server.wsgi.ssl.' 79 'ApacheSSLAuthnMiddleware.authenticated') 71 80 72 81 def __init__(self, app, global_conf, prefix=PARAM_PREFIX, **app_conf): … … 321 330 # Then, treat as a base64 encoded string decoding and passing as DER 322 331 # format to the X.509 parser 323 x509CertPat = re.compile('(\s?-----[A-Z]+\sCERTIFICATE-----\s?)|\s+')324 cert = x509CertPat.sub('', sslClientCert)332 333 cert = self.__class__.X509_CERT_PAT.sub('', sslClientCert) 325 334 derCert = base64.decodestring(cert) 326 335 self.__clientCert = X509Cert.Parse(derCert, format=X509Cert.formatDER) 327 336 337 # Check validity time 338 if not self.__clientCert.isValidTime(): 339 return False 340 341 # Verify against trust root if set 328 342 if len(self.caCertStack) == 0: 329 343 log.warning("No CA certificates set for Client certificate " … … 343 357 "unexpected exception type %s: %s" % (type(e), e)) 344 358 return False 345 359 360 # Verify against list of acceptable DNs if set 346 361 if len(self.clientCertDNMatchList) > 0: 347 362 dn = self.__clientCert.dn 348 363 for expectedDN in self.clientCertDNMatchList: 349 364 if dn == expectedDN: 365 self.environ[ 366 ApacheSSLAuthnMiddleware.AUTHN_SUCCEEDED_ENVIRON_KEYNAME 367 ] = True 350 368 return True 351 369 352 370 return False 353 371 372 self.environ[ 373 ApacheSSLAuthnMiddleware.AUTHN_SUCCEEDED_ENVIRON_KEYNAME] = True 354 374 return True 355 375 -
TI12-security/trunk/NDGSecurity/python/ndg_security_server/ndg/security/server/wsgi/zsi.py
r6069 r6440 26 26 from ndg.security.common.utils.classfactory import instantiateClass, \ 27 27 importClass 28 28 29 29 30 class ZSIMiddlewareError(SOAPMiddlewareError): 30 31 """Base class for ZSI Middleware type exceptions""" 31 32 33 32 34 class ZSIMiddlewareReadError(SOAPMiddlewareReadError): 33 35 """ZSI Middleware read error""" 34 36 37 35 38 class ZSIMiddlewareConfigError(SOAPMiddlewareConfigError): 36 39 """ZSI middleware configuration error""" 40 37 41 38 42 class ZSIMiddleware(SOAPMiddleware): … … 405 409 SERVICE_SOAP_BINDING_PROPPREFIX_OPTNAME = 'serviceSOAPBindingPropPrefix' 406 410 DEFAULT_SERVICE_SOAP_BINDING_PROPPREFIX_OPTNAME = \ 407 'ndg.security.serv ier.wsgi.zsi.serviceSOAPBinding.'411 'ndg.security.server.wsgi.zsi.serviceSOAPBinding.' 408 412 409 413 SERVICE_SOAP_BINDING_ENVIRON_KEYNAME_OPTNAME = \ -
TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/config/attributeauthority/sitea/attributeCertificateLog/ac.xml
r6290 r6440 9 9 <userId>ndg-user</userId> 10 10 <validity> 11 <notBefore>2010 01 11 15 49 07</notBefore>12 <notAfter>2010 01 11 23 49 07</notAfter>11 <notBefore>2010 01 20 08 54 54</notBefore> 12 <notAfter>2010 01 20 16 54 54</notAfter> 13 13 </validity> 14 14 <attributes> … … 33 33 <provenance>original</provenance> 34 34 </acInfo> 35 <ds:Signature><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces PrefixList="ds"></ec:InclusiveNamespaces></ds:CanonicalizationMethod><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></ds:SignatureMethod><ds:Reference URI=""><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></ds:Transform><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces PrefixList="xmlns"></ec:InclusiveNamespaces></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></ds:DigestMethod><ds:DigestValue> cs742SaTEW8PS3CCXsxLO6MicaE=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>Z2CdNfHi6XVUdUMKWZMvEzd2vBLJebd4NEfnetyfEAHjhZosiZ6ladn4p+tgnUXZ2ZdtnpYE3j4436 F1ceowUA5DWxaS2Gs1jhWXTZYAkgohwH9ZUUEwiN7Rtj/C8aMB0aAjxHI/X5U/J/Lrriw0MrIQ1r 37 oA0AIRrGA9YByOVP1jY=</ds:SignatureValue><ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIICBTCCAW6gAwIBAgICAP0wDQYJKoZIhvcNAQEEBQAwLzEMMAoGA1UEChMDTkRH35 <ds:Signature><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces PrefixList="ds"></ec:InclusiveNamespaces></ds:CanonicalizationMethod><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></ds:SignatureMethod><ds:Reference URI=""><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></ds:Transform><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces PrefixList="xmlns"></ec:InclusiveNamespaces></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></ds:DigestMethod><ds:DigestValue>s1dB/p8Cl1SmY0/Jcq+2z2biXHs=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>Sw36kLKRjSro9409KGZ5YPsQrU9FcvkzwO5n3WJ1WQkgDTS2IhGHCW5OB64bL8e3Ub3gdM1WlHC4 36 ybGYfPOuuVfQ4ZHHfLqQMWA9p5ALRmUTAglSt9/uTPYzc8yk7wCWHNYqMDVPHbHwy5MWyAToCHGx 37 rqJRs9WgozMJMugslJk=</ds:SignatureValue><ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIICBTCCAW6gAwIBAgICAP0wDQYJKoZIhvcNAQEEBQAwLzEMMAoGA1UEChMDTkRH 38 38 MQ0wCwYDVQQLEwRCQURDMRAwDgYDVQQDEwdUZXN0IENBMB4XDTA4MTIxNTE2MzUy 39 39 NFoXDTEzMTIxNDE2MzUyNFowSjEaMBgGA1UEChMRTkRHIFNlY3VyaXR5IFRlc3Qx -
TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/integration/authz_lite/openidrelyingparty/public/layout/default.css
r6127 r6440 1 /* Following information on http://css.maxdesign.com.au/floatutorial/tutorial0816.htm */ 2 /* Entire Page Contents */ 1 /* 2 * NDG Security OpenID Provider and Relying Party Stylesheet 3 */ 3 4 4 5 body, html { 5 6 7 8 9 10 11 12 font-size:small;6 margin: 0; 7 padding: 0; 8 border: 0; 9 background-color: #eee; 10 color:#333333; 11 font-family:Verdana, Arial, Helvetica, sans-serif; 12 line-height:1.4; 13 font-size: small; 13 14 } 14 15 15 body { 16 16 .helptxt { 17 font-size: smaller; 18 background-color: #e6f0f8; 17 19 } 18 20 19 21 22 div.hidden { 23 display: none; 24 } 25 26 .helpicon 27 { 28 cursor:help; 29 } 30 31 /* 32 * Provider Attribute Exchange Request parameters 33 */ 34 #opAXRequestedAttributes { 35 width: 100%; 36 border-collapse: collapse; 37 background-color: #e6f0f8; 38 table-layout: auto; 39 margin-top:10px; 40 margin-bottom: 20px; 41 } 42 43 #opAXRequestedAttributes td, #opAXRequestedAttributes th 44 { 45 font-size:0.9em; 46 border:1px solid #ffffff; 47 padding:3px 7px 2px 7px; 48 } 49 50 #opAXRequestedAttributes th 51 { 52 font-size:1.0em; 53 text-align:left; 54 padding-top:5px; 55 padding-bottom:4px; 56 background-color: #cedbe5; 57 color: #333; 58 } 59 20 60 21 61 /* Top Banner Div */ 22 23 62 #header { 24 63 color: #8c8c8c; … … 31 70 clear: both; 32 71 margin-top:10px; 33 /* border: solid #555555;*/34 72 border: solid #8c8c8c; 35 73 border-width: 0 0 2px 0; … … 46 84 } 47 85 48 .searchBar {margin-top: 2px; background-color: #f0f0f0; } /* Change this color and you need to change the color in the pagetab current */49 .searchBar table {padding-left:10px; padding-bottom:0px; margin:0px;font-weight:bold;}50 .searchBar .hidden {display:none}51 /* .searchOneLine {margin-top: 2px; margin-bottom: 2px; background-color: #f0f0f0; text-align:right; font-size:100%;} */52 53 #Header {color: black; background-color: white; text-align: center; margin-bottom: 10px; padding-top: 3px; padding-right: 0px; padding-left: 0px; padding-bottom: 0px; font-size: medium; font-weight:bold; color:white}54 #Header table {margin:0px; padding:20px;}55 56 /* Main Tabs First Cut */57 /* Reminder: top, right, bottom, left */58 #PageTabs {margin: 5px 0px 0px 0px; line-height:normal;border: solid black; border-width: 0px 0px 0px 0px;}59 #PageTabRow {width:100%; }60 #PageTabRow ul {margin:0 0 0 10px; padding:0; list-style:none; }61 #PageTabRow li {float:left; margin-right:10px; padding: 2px 10px; border: solid black; border-width:1px 1px 0px 1px; }62 #PageTabRow li.current {position:relative; top:1px; background-color: #f0f0f0; } /* color should be same as searchBar! */63 #PageTabRow li.hidden {}64 #PageTabRow a {display:block; text-decoration:none;}65 .line {border-top: 1px solid black; clear:both;}66 67 68 /* In page tabs */69 /* Reminder: top, right, bottom, left */70 .InPageTabs {margin: 5px 20px 0px 20px; line-height:normal; border: solid black; border-width: 0px 0px 0px 0px;}71 72 .InPageHdr ul {margin:0 0 0 10px; padding:0; list-style:none; }73 .InPageHdr li {float:left; margin-right:10px; padding: 2px 10px; border: solid black; border-width:1px 1px 0px 1px; }74 .InPageHdr li.current {position:relative; top:1px; background-color: #f0f0f0; } /* color should be same as searchBar! */75 .InPageHdr li.hidden {}76 .InPageHdr a {display:block; text-decoration:none;}77 .InPageContent {border:1px solid black; clear: both;}78 .InPageContent ul {list-style:none;}79 .InPageContent .hidden {display:none;}80 /* Left Column if Necessary */81 82 #Left{ WIDTH: 220px; FLOAT: left; margin-bottom: 10px; margin-right:10px;margin-left:5px;}83 .tabhdr { margin-top:5px; float:left; line-height:normal;}84 .tabhdr ul {margin:0; padding:0; list-style:none;}85 .tabhdr a:link {display:block; text-decoration:none; color:black; float:left; width:5em;}86 .tabhdr li {margin:0;}87 .tabhdr li.current {float:left; margin-right:3px; padding:2px 10px; background-color:#f0f0f0;88 border-top: 1px solid #3c78b5; border-right: 1px solid #3c78b5; border-left: 1px solid #3c78b5; position:relative;top:1px;}89 .tabhdr li.hidden {float:left; margin-right:3px; padding:2px 10px;90 border-left:1px solid #3c78b5; border-right:1px solid #3c78b5; border-top:1px solid #3c78b5; }91 .tabcontent {padding:2px 10px; background: #f0f0f0; clear:both; border:1px solid #3c78b5;}92 .tabcontent ul {list-style:none; font-size:50%; margin-left:0; padding-left:0; }93 /* Main Content */94 95 #contents {border-left: 1px solid #3c78b5;}96 #contentsRight {border-left: 1px solid #3c78b5; margin-left:250px;}97 98 .error {display:block;text-align:center;font-size:150%;background-color:red; padding:10px;}99 100 /* The following is the css associated with pretty printing xml */101 .xmlDoc {font-size:80%}102 .xmlElem {PADDING-LEFT: 20px;}103 .xmlAttrVal {COLOR:Red; }104 .xmlAttrTyp {COLOR:Green; }105 .xmlElemTag {COLOR:Blue; }106 .highlight {BACKGROUND-COLOR:Yellow; }107 .ndgem {FONT-WEIGHT: bold}108 109 /* This is the "metadata" css */110 .metadata {PADDING-LEFT: 20px; font-size:80%; padding-right:20px;}111 #Corrections {PADDING-LEFT:20px; font-size:80%; padding-right:20px;}112 .metadata #keywords {COLOR: Blue; FONT-SIZE:120%; FONT-WEIGHT:bold;}113 .metaentry {COLOR: Black}114 .metadata .hidden {display:none}115 116 86 /* We don't want borders on linked images */ 117 87 a img {border: none;} 118 88 119 /* StubB */120 .headingblock{background-color: #f0f0f0;border: 1px solid #3c78b5; margin:10px 60px 20px 50px; padding-top:5px;}121 /* .bottomblock{border: 1px solid #3c78b5; margin-left:5px;margin-right:5px;padding:5px;}*/122 123 .heading {124 font-size: 140%;125 font-weight: bold;126 color: #003366;127 padding: 4px;128 text-align:center;129 }130 131 132 /* top right bottom left */133 .metadata #abstract {MARGIN: 5px 20px 10px 20px; font-size:100%; padding: 8px 8px 8px 8px; text-align:justify;}134 .metadata h4 {font-size: 120%;135 line-height: normal;136 font-weight: bold;137 color: #003366;138 padding: 2px 2px 2px 2px;139 margin: 0px 0px 4px 0px;140 }141 .metadata table {padding-top:10px;}142 143 .linehead {144 font-size: 120%;145 line-height: normal;146 font-weight: bold;147 background-color: #f0f0f0;148 color: #003366;149 border-bottom: 1px solid #3c78b5;150 padding: 2px 2px 2px 2px;151 margin: 0px 0px 4px 0px;152 }153 .emphatic {font-size: 120%;154 line-height: normal;155 font-weight: bold;156 background-color: #f0f0f0;157 color: #003366;158 border-bottom: 1px solid #3c78b5;159 padding: 2px 2px 2px 2px;160 margin: 0px 0px 4px 0px;161 }162 .rowhead {163 font-size: 100%;164 font-weight: bold;165 border-bottom: 1px solid #3c78b5;166 }167 .cellhead { font-size: 100%; font-weight: bold;}168 169 .ndgem {font-weight:bold}170 tr.rowlo {background: #eeeeee;171 border-top:1px;172 border-bottom:1px;173 border-bottom-color:#FFFFFF;174 border-top-color:#000000;175 }176 tr.rowhi {177 border-top:1px;178 border-bottom:1px;179 border-bottom-color:#FFFFFF;180 border-top-color:#000000;181 }182 183 /* Selection page */184 185 .gsummary .hidden {display: none}186 187 188 89 /* And now the footer */ 189 # Footer{90 #footer { 190 91 color: #ffffff; 191 92 background-color: #003153; … … 212 113 } 213 114 115 /* 116 * Provider Login 117 */ 118 #loginForm { 119 margin-bottom: 50px; 120 padding-top: 0px; 121 padding-right: 10px; 122 padding-left: 10px; 123 clear: both; 124 margin-top:25px; 125 } 126 127 /* 128 * Provider Decide Page form Content 129 */ 130 #decideFormContent { 131 margin-top:25px; 132 margin-bottom: 50px; 133 padding-top: 0px; 134 padding-right: 10px; 135 padding-left: 10px; 136 border-width: 0 0 2px 0; 137 clear: both; 138 } 139 140 /* 141 * Provider - display user OpenID in decide page interface 142 */ 143 #identityUriBox { 144 font-size:0.9em; 145 color: black; 146 background-color: #e6f0f8; 147 margin-top:10px; 148 margin-bottom: 20px; 149 padding-top: 10px; 150 padding-right: 10px; 151 padding-left: 7px; 152 padding-bottom: 10px; 153 } 154 155 /* 156 * Provider Main page 157 */ 158 #mainPageContent { 159 margin-top:25px; 160 margin-bottom: 50px; 161 padding-top: 0px; 162 padding-right: 10px; 163 padding-left: 10px; 164 border-width: 0 0 2px 0; 165 clear: both; 166 } 167 168 /* 169 * Provider - error page 170 */ 171 #errorContent { 172 margin-top:25px; 173 margin-bottom: 50px; 174 padding-top: 0px; 175 padding-right: 10px; 176 padding-left: 10px; 177 border-width: 0 0 2px 0; 178 clear: both; 179 } 180 214 181 #message { 215 182 color: #8c8c8c; … … 223 190 border-radius: 10px 10px; 224 191 margin: 20px; 225 /*padding: 10px 20px;*/226 192 } -
TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/integration/authz_lite/securityservices.ini
r6276 r6440 123 123 124 124 openid.relyingparty.baseURL = %(authkit.openid.baseurl)s 125 openid.relyingparty.idpWhitelistConfigFilePath = %(here)s/openidrelyingparty/ssl-idp-validator.xml125 #openid.relyingparty.idpWhitelistConfigFilePath = %(here)s/openidrelyingparty/ssl-idp-validator.xml 126 126 openid.relyingparty.signinInterfaceMiddlewareClass = ndg.security.server.wsgi.openid.relyingparty.signin_interface.genshi.GenshiSigninTemplate 127 #openid.relyingparty.signinInterface.staticContentRootDir = %(here)s/openidrelyingparty/public127 openid.relyingparty.signinInterface.staticContentRootDir = %(here)s/openidrelyingparty/public 128 128 openid.relyingparty.signinInterface.baseURL = %(openid.relyingparty.baseURL)s 129 129 openid.relyingparty.signinInterface.initialOpenID = %(openIDProviderIDSelectURI)s … … 176 176 # specified - see commented out entry for firstName below. The number of 177 177 # attributes for each attribute name defaults to 1 unless otherwise set 178 authkit.openid.ax.typeuri.firstName=http://openid.net/schema/namePerson/first179 authkit.openid.ax.alias.firstName=firstName180 # authkit.openid.ax.count.firstName=1178 #authkit.openid.ax.typeuri.firstName=http://openid.net/schema/namePerson/first 179 #authkit.openid.ax.alias.firstName=firstName 180 ##authkit.openid.ax.count.firstName=1 181 181 #authkit.openid.ax.required.firstName=True 182 authkit.openid.ax.typeuri.lastName=http://openid.net/schema/namePerson/last 183 authkit.openid.ax.alias.lastName=lastName 184 authkit.openid.ax.required.lastName=True 185 authkit.openid.ax.typeuri.emailAddress=http://openid.net/schema/contact/internet/email 186 authkit.openid.ax.alias.emailAddress=emailAddress 187 authkit.openid.ax.required.emailAddress=True 188 182 #authkit.openid.ax.typeuri.lastName=http://openid.net/schema/namePerson/last 183 #authkit.openid.ax.alias.lastName=lastName 184 #authkit.openid.ax.required.lastName=True 185 #authkit.openid.ax.typeuri.emailAddress=http://openid.net/schema/contact/internet/email 186 #authkit.openid.ax.alias.emailAddress=emailAddress 187 #authkit.openid.ax.required.emailAddress=True 188 189 # ESG Gateway requested parameters 190 authkit.openid.ax.typeuri.uuid:http://openid.net/schema/person/guid 191 authkit.openid.ax.alias.uuid=uuid 192 authkit.openid.ax.typeuri.username:http://openid.net/schema/namePerson/friendly 193 authkit.openid.ax.alias.username=username 194 authkit.openid.ax.typeuri.firstname:http://openid.net/schema/namePerson/first 195 authkit.openid.ax.alias.firstname=firstname 196 authkit.openid.ax.required.firstname:True 197 authkit.openid.ax.typeuri.middlename:http://openid.net/schema/namePerson/middle 198 authkit.openid.ax.alias.middlename=middlename 199 authkit.openid.ax.typeuri.lastname:http://openid.net/schema/namePerson/last 200 authkit.openid.ax.required.lastname:True 201 authkit.openid.ax.alias.lastname=lastname 202 authkit.openid.ax.typeuri.email:http://openid.net/schema/contact/internet/email 203 authkit.openid.ax.required.email:True 204 authkit.openid.ax.alias.email=email 205 authkit.openid.ax.typeuri.gateway:http://www.earthsystemgrid.org/gateway 206 authkit.openid.ax.alias.gateway=gateway 207 authkit.openid.ax.typeuri.organization:http://openid.net/schema/company/name 208 authkit.openid.ax.alias.organization=organization 209 authkit.openid.ax.typeuri.city:http://openid.net/schema/contact/city/home 210 authkit.openid.ax.alias.city=city 211 authkit.openid.ax.typeuri.state:http://openid.net/schema/contact/state/home 212 authkit.openid.ax.alias.state=state 213 authkit.openid.ax.typeuri.country:http://openid.net/schema/contact/country/home 214 authkit.openid.ax.alias.country=country 189 215 190 216 [filter:SSLCientAuthnRedirectResponseFilter] -
TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/unit/sslclientauthnmiddleware/test_sslclientauthn.py
r6069 r6440 25 25 from ndg.security.common.utils.configfileparsers import \ 26 26 CaseSensitiveConfigParser 27 from ndg.security.common. m2CryptoSSLUtilityimport HTTPSConnection27 from ndg.security.common.utils.m2crypto import HTTPSConnection 28 28 29 29
Note: See TracChangeset
for help on using the changeset viewer.