source: TI12-security/trunk/python/ndg.security.test/ndg/security/test/integration/openidrelyingparty_withapp/attributeinterface.py @ 5541

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/python/ndg.security.test/ndg/security/test/integration/openidrelyingparty_withapp/attributeinterface.py@5541
Revision 5541, 1.3 KB checked in by pjkersha, 11 years ago (diff)

New integration test for trying out OpenID Relying Party running in the application code stack instead of the separate services stack.

Line 
1"""NDG Attribute Authority attribute interface class - acts as an interface
2between the data centre's user roles configuration and the Attribute Authority
3
4Use an alternative config here to
5ndg.security.test.config.attributeauthority.sitea.siteAUserRoles.TestUserRoles
6to test multi user access
7                                                                               
8NERC DataGrid Project
9"""
10__author__ = "P J Kershaw"
11__date__ = "01/07/2009"
12__copyright__ = "(C) 2009 Science and Technology Facilities Council"
13__license__ = "BSD - see LICENSE file in top-level directory"
14__contact__ = "Philip.Kershaw@stfc.ac.uk"
15__revision__ = '$Id$'
16from ndg.security.server.attributeauthority import AttributeInterface
17
18class TestUserRoles(AttributeInterface):
19    """Test User Roles class dynamic import for Attribute Authority"""
20
21    def __init__(self, propertiesFilePath=None):
22        pass
23
24    def getRoles(self, userId):
25        if userId.endswith("/openid/PhilipKershaw"):
26            return [
27                'urn:siteA:security:authz:1.0:attr:postdoc',
28                'urn:siteA:security:authz:1.0:attr:staff', 
29                'urn:siteA:security:authz:1.0:attr:undergrad', 
30                'urn:siteA:security:authz:1.0:attr:coapec'
31            ]
32        else:
33            return ['urn:siteA:security:authz:1.0:attr:guest']
Note: See TracBrowser for help on using the repository browser.