Forked from
DM / dm-docs
261 commits behind, 824 commits ahead of the upstream repository.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
authRouteDescriptor.py 1.46 KiB
#!/usr/bin/env python
#
# Auth route descriptor.
#
from dm.common.utility.configurationManager import ConfigurationManager
from authSessionController import AuthSessionController
class AuthRouteDescriptor:
@classmethod
def getRoutes(cls):
contextRoot = ConfigurationManager.getInstance().getContextRoot()
authSessionController = AuthSessionController()
routes = [
# Get authorization principal
{
'name' : 'getAuthorizationPrincipal',
'path' : '%s/authorizationPrincipals/:(username)' % contextRoot,
'controller' : authSessionController,
'action' : 'getAuthorizationPrincipal',
'method' : [ 'GET' ]
},
# Add session
{
'name' : 'addSession',
'path' : '%s/sessions/:(sessionId)' % contextRoot,
'controller' : authSessionController,
'action' : 'addSession',
'method' : [ 'POST' ]
},
# Check session
{
'name' : 'checkSession',
'path' : '%s/sessions/:(sessionId)' % contextRoot,
'controller' : authSessionController,
'action' : 'checkSession',
'method' : [ 'PUT' ]
},
]
return routes