Back to index

nordugrid-arc-nox  1.1.0~rc6
Classes | Functions | Variables
arcom.security Namespace Reference

Classes

class  AuthRequest
class  AuthPolicy

Functions

def make_decision
def parse_ssl_config

Variables

list storage_actions = ['read', 'addEntry', 'removeEntry', 'delete', 'modifyPolicy', 'modifyStates', 'modifyMetadata']
string identity_type = 'http://www.nordugrid.org/schemas/policy-arc/types/tls/identity'
string ca_type = 'http://www.nordugrid.org/schemas/policy-arc/types/tls/ca'
string vomsattribute_type = 'http://www.nordugrid.org/schemas/policy-arc/types/tls/vomsattribute'
string storage_action_type = 'http://www.nordugrid.org/schemas/policy-arc/types/storage/action'
string request_ns = 'http://www.nordugrid.org/schemas/request-arc'
string all_user = 'ALL'
string anonymous_user = 'ANONYMOUS'
tuple log = get_logger('arcom.security')

Function Documentation

def arcom.security.make_decision (   policy,
  request 
)

Definition at line 100 of file security.py.

00100 
00101 def make_decision(policy, request):
00102     import arc
00103     loader = arc.EvaluatorLoader()
00104     evaluator = loader.getEvaluator('arc.evaluator')
00105     p = loader.getPolicy('arc.policy', arc.Source(str(policy)))
00106     evaluator.addPolicy(p)
00107     r = loader.getRequest('arc.request', arc.Source(str(request)))
00108     response = evaluator.evaluate(r)
00109     responses = response.getResponseItems()
00110     response_list = [responses.getItem(i).res for i in range(responses.size())]
00111     #print 'RESPONSE_LIST = ', response_list
00112     return response_list[0]
00113     # if response_list.count(arc.DECISION_DENY) > 0:
00114     #     return 'deny'
00115     # if response_list.count(arc.DECISION_PERMIT) > 0:
00116     #     return 'permit'
00117     # if response_list.count(arc.DECISION_NOT_APPLICABLE) > 0:
00118     #     return 'not_applicable'
00119     # return 'indeterminate'

Here is the caller graph for this function:

Definition at line 120 of file security.py.

00120 
00121 def parse_ssl_config(cfg):
00122     try:
00123         client_ssl_node = cfg.Get('ClientSSLConfig')
00124         fromFile = str(client_ssl_node.Attribute('FromFile'))
00125         if fromFile:
00126             try:
00127                 xml_string = file(fromFile).read()
00128                 import arc
00129                 client_ssl_node = arc.XMLNode(xml_string)
00130             except:
00131                 log.msg()
00132                 pass
00133         if client_ssl_node.Size() == 0:
00134             return {}
00135         ssl_config = {}
00136         ssl_config['key_file'] = str(client_ssl_node.Get('KeyPath'))
00137         ssl_config['cert_file'] = str(client_ssl_node.Get('CertificatePath'))
00138         ca_file = str(client_ssl_node.Get('CACertificatePath'))
00139         if ca_file:
00140             ssl_config['ca_file'] = ca_file
00141         else:
00142             ssl_config['ca_dir'] = str(client_ssl_node.Get('CACertificatesDir'))
00143         return ssl_config
00144     except:
00145         log.msg()
00146         return {}

Variable Documentation

string arcom.security.all_user = 'ALL'

Definition at line 7 of file security.py.

string arcom.security.anonymous_user = 'ANONYMOUS'

Definition at line 8 of file security.py.

string arcom.security.ca_type = 'http://www.nordugrid.org/schemas/policy-arc/types/tls/ca'

Definition at line 3 of file security.py.

string arcom.security.identity_type = 'http://www.nordugrid.org/schemas/policy-arc/types/tls/identity'

Definition at line 2 of file security.py.

tuple arcom.security.log = get_logger('arcom.security')

Definition at line 11 of file security.py.

string arcom.security.request_ns = 'http://www.nordugrid.org/schemas/request-arc'

Definition at line 6 of file security.py.

string arcom.security.storage_action_type = 'http://www.nordugrid.org/schemas/policy-arc/types/storage/action'

Definition at line 5 of file security.py.

list arcom.security.storage_actions = ['read', 'addEntry', 'removeEntry', 'delete', 'modifyPolicy', 'modifyStates', 'modifyMetadata']

Definition at line 1 of file security.py.

string arcom.security.vomsattribute_type = 'http://www.nordugrid.org/schemas/policy-arc/types/tls/vomsattribute'

Definition at line 4 of file security.py.