Changeset 6107 for TI12-security/trunk
- Timestamp:
- 11/12/09 15:23:40 (11 years ago)
- Location:
- TI12-security/trunk/python
- Files:
-
- 43 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
TI12-security/trunk/python/.pydevproject
r6098 r6107 5 5 <pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.6</pydev_property> 6 6 <pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property> 7 8 <pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH"> 9 <path>/ndgsecurity/MyProxyClient</path> 10 </pydev_pathproperty> 7 11 </pydev_project> -
TI12-security/trunk/python/MyProxyClient/myproxy/client.py
r6098 r6107 1069 1069 # - private key 1070 1070 # - rest of cert chain 1071 pemKey = key.as_pem(cipher=None) 1072 creds = [pemCerts[0], pemKey] 1073 creds.extend(pemCerts[1:]) 1071 if keys is not None: 1072 pemKey = keys.as_pem(cipher=None) 1073 creds = [pemCerts[0], pemKey] 1074 creds.extend(pemCerts[1:]) 1075 else: 1076 creds = pemCerts 1074 1077 1075 1078 return tuple(creds) 1076 1077 1079 1078 1080 def getDelegation(self, *arg, **kw): -
TI12-security/trunk/python/MyProxyClient/test/myProxyClient.cfg
r5048 r6107 12 12 # Delete this element and take setting from MYPROXY_SERVER environment 13 13 # variable if required 14 #hostname=localhost14 hostname=localhost 15 15 16 16 # Delete this element to take default setting 7512 or read … … 43 43 proxyCertLifetime=64800 44 44 45 caCertFilePath=$MYPROXYCLIENT_UNITTEST_DIR/ndg-test-ca.crt 45 #caCertFilePath=$MYPROXYCLIENT_UNITTEST_DIR/ndg-test-ca.crt 46 caCertFilePath=$MYPROXYCLIENT_UNITTEST_DIR/ndg-glue-ca.crt -
TI12-security/trunk/python/ndg_security_common/ndg/security/common/credentialwallet.py
r6064 r6107 36 36 AttributeRequestDenied, NoMatchingRoleInTrustedHosts) 37 37 aaImportError = False 38 except ImportError :39 log.warning('Loading CredentialWallet without SOAP interface imports ')38 except ImportError, e: 39 log.warning('Loading CredentialWallet without SOAP interface imports: %s', e) 40 40 41 41 # Likewise - may not want to use WS and use AttributeAuthority locally in which … … 45 45 AttributeAuthorityError, AttributeAuthorityAccessDenied) 46 46 aaImportError = False 47 except :47 except ImportError, e: 48 48 log.warning('Loading CredentialWallet without Attribute Authority ' 49 'interface imports ')49 'interface imports %s', e) 50 50 51 51 if aaImportError: -
TI12-security/trunk/python/ndg_security_server/ndg/security/server/wsgi/myproxy/__init__.py
r6069 r6107 11 11 import logging 12 12 log = logging.getLogger(__name__) 13 import traceback 13 14 import re 14 15 import httplib … … 150 151 "with MyProxy server %r: %s" % 151 152 (self.myProxyClient.hostname, e)) 153 except Exception, e: 154 log.error("MyProxyClient.logon raised an unknown exception " 155 "calling %r: %s", 156 self.myProxyClient.hostname, 157 traceback.format_exc()) 158 raise 152 159 153 160 start_response(status, -
TI12-security/trunk/python/ndg_security_server/ndg/security/server/wsgi/openid/relyingparty/signin_interface/genshi/__init__.py
r6069 r6107 1 """NDG Security OpenID Relying Party Buffetbased Sign in template1 """NDG Security OpenID Relying Party Genshi based Sign in template 2 2 3 3 NERC DataGrid Project … … 27 27 """Provide Templating for OpenID Relying Party Middleware Sign in interface 28 28 via Buffet class""" 29 29 DEFAULT_TEMPLATES_DIR = path.join(path.dirname(__file__), 'templates') 30 DEFAULT_STATIC_CONTENT_DIR = path.join(path.dirname(__file__), 'public') 31 32 SIGNIN_TEMPLATE_NAME = 'signin.html' 33 30 34 propertyDefaults = { 31 'templateType': 'kid', 32 'templateRootDir': None, 33 'staticContentRootDir': './', 35 'templateRootDir': DEFAULT_TEMPLATES_DIR, 36 'staticContentRootDir': DEFAULT_STATIC_CONTENT_DIR, 34 37 'baseURL': 'http://localhost', 35 38 'initialOpenID': '', 36 ' logoutURI': '',39 'heading': '', 37 40 'leftLogo': None, 38 'leftAlt': None, 39 'ndgLink': 'http://ndg.nerc.ac.uk', 40 'ndgImage': None, 41 'disclaimer': 'Test deployment only', 42 'stfcLink': 'http://www.stfc.ac.uk/', 43 'stfcImage': None, 41 'leftAlt': '', 42 'leftLink': None, 43 'leftImage': None, 44 'footerText': 'Test deployment only', 45 'rightLink': None, 46 'rightImage': None, 47 'rightAlt': '', 44 48 'helpIcon': None 45 49 } 46 DEFAULT_TEMPLATES_DIR = path.join(path.dirname(__file__), 'templates')47 SIGNIN_TEMPLATE_NAME = 'signin.html'48 50 49 51 def __init__(self, app, global_conf, **local_conf): … … 51 53 object 52 54 53 @type *arg: tuple 54 @param *arg: RenderingInterface parent class arguments 55 @type **opt: dict 56 @param **opt: additional keywords to set-up Buffet rendering''' 55 @type app: callable following WSGI interface 56 @param app: next middleware application in the chain 57 @type global_conf: dict 58 @param global_conf: PasteDeploy global configuration dictionary 59 enables other global configuration parameters to be filtered out 60 @type local_conf: dict 61 @param local_conf: PasteDeploy application specific configuration 62 dictionary 63 ''' 57 64 super(GenshiSigninTemplate, self).__init__(app, 58 65 global_conf, 59 66 **local_conf) 60 if self.templateRootDir is None:61 self.templateRootDir = GenshiSigninTemplate.DEFAULT_TEMPLATES_DIR62 67 63 68 self.__loader = TemplateLoader(self.templateRootDir, auto_reload=True) -
TI12-security/trunk/python/ndg_security_server/ndg/security/server/wsgi/openid/relyingparty/signin_interface/genshi/public/layout/ndg2.css
r5984 r6107 6 6 padding: 0; 7 7 border: 0; 8 background-color: # fff;8 background-color: #eee; 9 9 color:#333333; 10 10 font-family:Verdana, Arial, Helvetica, sans-serif; … … 22 22 23 23 #header { 24 height: 100px; 25 background: #fff; 26 padding: 0; 27 border: solid #333333; 28 border-width: 0 0 2px 0; 29 background-repeat:no-repeat; 30 } 24 color: #8c8c8c; 25 height: 60px; 26 background: #ffffff; 27 margin-bottom: 10px; 28 padding-top: 3px; 29 padding-right: 10px; 30 padding-left: 10px; 31 clear: both; 32 margin-top:10px; 33 /* border: solid #555555;*/ 34 border: solid #8c8c8c; 35 border-width: 0 0 2px 0; 36 background-repeat:no-repeat; 37 } 31 38 32 39 #logo{ … … 160 167 .cellhead { font-size: 100%; font-weight: bold;} 161 168 162 .key {background-image:url(/layout/key.gif);}163 164 #map {width:440px; height:220px; border: 1px solid black;}165 /* .map {width:300px;height:250px;border:0;padding:0;margin:0;overflow:hidden;}*/166 /* NumSim */167 168 #visMap {width: 600px; height: 300px; border: 1px solid black;}169 170 .Model {margin: 5px 5px 5px 20px; border: 1px solid #3c78b5; clear:both;}171 172 /* Advanced Search Page */173 174 .clear { clear: both; }175 .outer {border-left: 14px solid #FFFFFF; border-right: 500px solid #FFFFFF; }176 .inner {width: 100%; }177 .inner .hidden {display:none;background-color: #f4f4f4; border:1px solid black;}178 .float-wrap {float: left; width: 100%; margin-left: -14px; }179 #AdvContent {float: right; background-color: #fff;margin-right: -14px; width: 100%;}180 * html #AdvContent {position: relative; }181 .contentWrap{padding: 5px;}182 .contentWrap ol, .contentWrap ul {margin: 3px 0 5px 35px;}183 .contentWrap li {padding-bottom: 2px;}184 #innerLeft {float: left;width: 1px;min-height: 250px;padding: 0;}185 * html #innerLeft {position: relative; height: 250px;}186 #innerRight {float: right; width: 490px;padding: 5px;min-height: 250px;margin-right: -500px; }187 * html #innerRight {height: 250px;position: relative; }188 .searchHdr {font-weight:bold;color: #571F12;background-color: #fff;padding:15px 0px 10px 0px;vertical-align:text-top;}189 .SearchBox {padding:0 0 0 60px;}190 .SearchTxt {padding:0 20px 0 0;}191 .SearchStartDate {padding:0 0 0 60px;}192 .SearchEndDate {padding:0 0 0 60px;}193 .SearchSource {padding:0 0 0 60px;}194 .SearchSubmit {padding:30px 0 20px 60px;}195 196 .helptxt {font-size:smaller; background-color:LightGrey;}197 198 /* Results Page */199 200 201 #context { margin: 5px 10px 5px 10px; border:0; color:#571512;}202 #SemanticSearchBox{margin: 0px 0px 0px 0px; border:0}203 #SemanticSearchResults { margin: 5px 10px 5px 10px; border:0; color:#571512;}204 205 .resultsBar {text-align:right; margin: 2px 10px 2px 10px; border:0;}206 .resultsBar .hidden {display:none;}207 .resultsBar .resultsLeft {float:left}208 209 #resultsTab thead {background-color: #075993; color:#FFFFFF; margin: 0px 10px 0px 10px;}210 #resultsTab th {211 background-color: #075993;212 color:#FFFFFF;213 padding: 3px 10px 3px 10px;214 }215 #resultsTab td {216 color:#333333;217 /* line-height:1.5; */218 padding: 5px 10px 5px 10px;219 }220 /* #resultsTab tbody {vertical-align:baseline; } */221 222 169 .ndgem {font-weight:bold} 223 170 tr.rowlo {background: #eeeeee; … … 240 187 241 188 /* And now the footer */ 242 #Footer { color: #999999; background-color: #eeeeee; margin-bottom: 25px; padding-top: 3px; padding-right: 10px; padding-left: 10px; clear: both; border-top: 2px solid #333333; margin-top:10px; font-size:80%; border-bottom: 2px solid #333333;} 189 #Footer { 190 color: #ffffff; 191 background-color: #003153; 192 padding-top: 3px; 193 clear: both; 194 margin-top:10px; 195 font-size: smaller; 196 } 197 198 a.FooterLink:link {color:orange} 199 a.FooterLink:visited {color:teal} 243 200 244 201 /* Footer not yet checked */ … … 246 203 /* Footer not yet checked complete */ 247 204 248 205 #openIDSignin { 206 margin-bottom: 50px; 207 padding-top: 0px; 208 padding-right: 10px; 209 padding-left: 10px; 210 clear: both; 211 margin-top:25px; 212 } 213 214 #message { 215 color: #8c8c8c; 216 font-size: smaller; 217 } 218 219 div#main { 220 background-color: #fff; 221 border: 1px solid #ccc; 222 -moz-border-radius: 10px 10px; 223 border-radius: 10px 10px; 224 margin: 20px; 225 /*padding: 10px 20px;*/ 226 } -
TI12-security/trunk/python/ndg_security_server/ndg/security/server/wsgi/openid/relyingparty/signin_interface/genshi/templates/ndgpage.html
r5984 r6107 1 1 <!-- This is a bunch of named templates for use in pages --> 2 2 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://genshi.edgewall.org/"> 3 3 <?python from genshi import HTML ?> 4 4 <!-- HTML Header and Document header follow --> 5 5 … … 12 12 </head> 13 13 14 <div py:def="header()"> 15 <div id="header"/> 16 <div id="logo"><img src="${c.leftLogo}" alt="${c.leftAlt}" /></div> 17 </div> 18 19 <div py:def="PageTabs(tabv)" id="PageTabs"> 20 <div id="PageTabRow"> 21 <ul> 22 <span py:for="tab in c.pageTabs"> 23 <?python 24 linkto=True 25 if tab[0] == tabv: 26 status='current' 27 linkto=False 28 else: status='hidden' 29 ?> 30 <li class="$status"><span class="pagetab"> 31 </span></li> 32 </span> 33 </ul> 14 <div py:def="header()" id="header"> 15 <div py:if="c.heading" id="heading"> 16 <h1>${c.heading}</h1> 34 17 </div> 35 <div class="line"/> 36 <div class="clear"/> 18 <div py:if="c.leftLogo" id="logo"> 19 <img src="${c.leftLogo}" alt="${c.leftAlt}" /> 20 </div> 37 21 </div> 38 22 39 23 <!-- Page Footer follows --> 40 24 <div py:def="footer(showLoginStatus=False)" id="Footer"> 41 < center><table><tbody>25 <table width="100%"><tbody> 42 26 <tr> 43 27 <td align="left" width="60%"> 44 <table><tbody> 45 <tr> 46 <td><span py:replace="linkimage(c.ndgLink,c.ndgImage,'NDG')"/></td> 47 <td>OpenID Provider Site for <a href="http://ndg.nerc.ac.uk">NERC DataGrid</a> 48 ${c.disclaimer}</td> 49 </tr> 50 </tbody></table> 28 <table> 29 <tbody> 30 <tr> 31 <td py:if="c.leftImage and c.leftLink"><span py:replace="linkimage(c.leftLink, c.leftImage, c.leftAlt)"/></td> 32 <td py:if="c.footerText">${HTML(c.footerText)}</td> 33 </tr> 34 </tbody> 35 </table> 51 36 </td> 52 <td width="40%" align="center"> 53 <div py:if="c.loginStatus" id="loginStatus"> 54 <!--! now we choose one of the next two (logged in or not) --> 55 <div py:if="c.loggedIn" id="loggedIn"> 56 <table><tbody><tr><td> 57 Logged in as ${c.session['username']}. 58 [<a href="$c.logOutURI">Log out</a>] 59 </td></tr></tbody></table> 60 </div> 61 </div> 62 </td> 63 <td align="right"><span py:replace="linkimage(c.stfcLink,c.stfcImage,'Hosted by the STFC CEDA')"/></td> 37 <td align="right" width="40%"><span py:replace="linkimage(c.rightLink, c.rightImage, c.rightAlt)"/></td> 64 38 </tr> 65 </tbody></table> </center>39 </tbody></table> 66 40 </div> 67 41 … … 72 46 <a href="$linkref"><image src="$imageref" alt="$alttext" title="$alttext"/></a> 73 47 </span> 74 75 <!-- Help Icons -->76 <span py:def="helpIcon(value)">77 <span>78 <a href="javascript:;" title="Toggle help" onclick="toggleDiv(1,'$value','shown','hidden','div'); return false;">79 <img src="${g['helpIcon']}" alt="Toggle help" class="helpicon"/></a>80 81 </span>82 </span>83 48 </html> -
TI12-security/trunk/python/ndg_security_server/ndg/security/server/wsgi/openid/relyingparty/signin_interface/genshi/templates/signin.html
r5984 r6107 3 3 xmlns="http://www.w3.org/1999/xhtml" 4 4 xmlns:py="http://genshi.edgewall.org/"> 5 <div py:def="openIDSignin()" class="openIDSignin" style="text-indent:5px">5 <div py:def="openIDSignin()" id="openIDSignin"> 6 6 <form action="$c.baseURL/verify" method="post"> 7 7 <table cellspacing="0" border="0" cellpadding="5" style="align: left"> 8 8 <tr align="left"> 9 <td>OpenID:</td> 10 <td align="left"> 11 <input type="text" 12 name="openid" 13 value="$c.initialOpenID" 14 class='openid-identifier' 15 size="48" 16 /> 17 </td> 18 <td align="right"> 19 <input type="submit" name="authform" value="Go"/> 20 </td> 21 <td> 22 <a href="http://openid.net/what/" target="_blank"><small>What's this?</small></a> 23 </td> 9 <td>OpenID:</td> 10 <td align="left"> 11 <input type="text" 12 name="openid" 13 value="$c.initialOpenID" 14 class='openid-identifier' 15 size="48" 16 /> 17 </td> 18 <td align="right"> 19 <input type="submit" name="authform" value="Go"/> 20 </td> 24 21 </tr> 22 <tr> 23 <td colspan="3"> 24 <div id="message"> 25 $$message 26 </div> 27 </td> 28 </tr> 25 29 </table> 26 30 </form> 27 <div id="message">28 $$message29 </div>30 31 </div> 31 32 … … 43 44 </head> 44 45 <body> 45 <div py:replace="header()"/> 46 <replace py:replace="openIDSignin()"/> 47 <div py:replace="footer(showLoginStatus=False)"/> 46 <div id="main"> 47 <div py:replace="header()"/> 48 <replace py:replace="openIDSignin()"/> 49 <div py:replace="footer(showLoginStatus=False)"/> 50 </div> 48 51 </body> 49 52 </html> -
TI12-security/trunk/python/ndg_security_test/ndg/security/test/integration/authz_lite/openidrelyingparty/public/layout/ndg2.css
r5447 r6107 240 240 241 241 /* And now the footer */ 242 #Footer { color: #999999; background-color: #eeeeee; margin-bottom: 25px; padding-top: 3px; padding-right: 10px; padding-left: 10px; clear: both; border-top: 2px solid #333333; margin-top:10px; font-size:80%; border-bottom: 2px solid #333333;} 242 #Footer { 243 color: #ffffff; 244 background-color: #003153; 245 margin-bottom: 25px; 246 padding-top: 3px; 247 padding-right: 10px; 248 padding-left: 10px; 249 clear: both; 250 margin-top:10px; 251 font-size: smaller; 252 } 243 253 244 254 /* Footer not yet checked */ -
TI12-security/trunk/python/ndg_security_test/ndg/security/test/integration/authz_lite/securityservices.ini
r6067 r6107 127 127 openid.relyingparty.providerWhitelistFilePath = 128 128 openid.relyingparty.signinInterfaceMiddlewareClass = ndg.security.server.wsgi.openid.relyingparty.signin_interface.genshi.GenshiSigninTemplate 129 openid.relyingparty.signinInterface.staticContentRootDir = %(here)s/openidrelyingparty/public129 #openid.relyingparty.signinInterface.staticContentRootDir = %(here)s/openidrelyingparty/public 130 130 openid.relyingparty.signinInterface.baseURL = %(openid.relyingparty.baseURL)s 131 131 openid.relyingparty.signinInterface.initialOpenID = %(openIDProviderIDSelectURI)s 132 openid.relyingparty.signinInterface.leftLogo = %(openid.relyingparty.signinInterface.baseURL)s/layout/NERC_Logo.gif 133 openid.relyingparty.signinInterface.leftAlt = Natural Environment Research Council 134 openid.relyingparty.signinInterface.ndgLink = http://ndg.nerc.ac.uk/ 135 openid.relyingparty.signinInterface.ndgImage = %(openid.relyingparty.signinInterface.baseURL)s/layout/ndg_logo_circle.gif 136 openid.relyingparty.signinInterface.disclaimer = This site is for test purposes only and is under active development. 137 openid.relyingparty.signinInterface.stfcLink = http://www.stfc.ac.uk/ 138 openid.relyingparty.signinInterface.stfcImage = %(openid.relyingparty.signinInterface.baseURL)s/layout/stfc-circle-sm.gif 132 openid.relyingparty.signinInterface.heading = OpenID Sign-in 133 #openid.relyingparty.signinInterface.leftLogo = %(openid.relyingparty.signinInterface.baseURL)s/layout/NERC_Logo.gif 134 #openid.relyingparty.signinInterface.leftAlt = Natural Environment Research Council 135 #openid.relyingparty.signinInterface.leftLink = http://ndg.nerc.ac.uk/ 136 #openid.relyingparty.signinInterface.leftImage = %(openid.relyingparty.signinInterface.baseURL)s/layout/ndg_logo_circle.gif 137 openid.relyingparty.signinInterface.footerText = This site is for test purposes only. <a class="FooterLink" href="http://openid.net/what/" target="_blank"><small>What is OpenID?</small></a> 138 openid.relyingparty.signinInterface.rightLink = http://ceda.ac.uk/ 139 openid.relyingparty.signinInterface.rightImage = %(openid.relyingparty.signinInterface.baseURL)s/layout/CEDA_RightButton60.png 140 openid.relyingparty.signinInterface.rightAlt = Centre for Environmental Data Archival 139 141 openid.relyingparty.signinInterface.helpIcon = %(openid.relyingparty.signinInterface.baseURL)s/layout/icons/help.png 140 142 … … 448 450 449 451 [formatter_generic] 450 format = %(asctime)s ,%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s451 datefmt = % H:%M:%S452 452 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s:%(lineno)s] %(message)s 453 datefmt = %Y-%m-%d %H:%M:%S 454 -
TI12-security/trunk/python/ndg_security_test/ndg/security/test/unit/wsgi/myproxy/test.ini
r5843 r6107 23 23 http.auth.basic.rePathMatchList = .* 24 24 myproxy.logonFuncEnvKeyName = myProxyLogon 25 myproxy.client.hostname = localhost 25 #myproxy.client.hostname = localhost 26 myproxy.client.hostname = glue.badc.rl.ac.uk 27 myproxy.client.serverDN = /O=NDG/OU=BADC/CN=glue.badc.rl.ac.uk -
TI12-security/trunk/python/ndg_security_test/ndg/security/test/unit/wsgi/myproxy/test_myproxy.py
r6069 r6107 217 217 if __name__ == "__main__": 218 218 #import sys;sys.argv = ['', 'Test.testName'] 219 import unittest 219 220 unittest.main()
Note: See TracChangeset
for help on using the changeset viewer.