1 | #!/usr/local/bin/python |
---|
2 | |
---|
3 | from fedd_access import fedd_access |
---|
4 | from fedd_experiment_control import fedd_experiment_control_local |
---|
5 | from fedd_split import fedd_split_local |
---|
6 | |
---|
7 | class fedd_deter_impl: |
---|
8 | """ |
---|
9 | The implementation of access control based on mapping users to projects. |
---|
10 | |
---|
11 | Users can be mapped to existing projects or have projects created |
---|
12 | dynamically. This implements both direct requests and proxies. |
---|
13 | """ |
---|
14 | # Used by the SOAP caller |
---|
15 | soap_namespaces = ('http://www.isi.edu/faber/fedd.wsdl', |
---|
16 | 'http://www.isi.edu/faber/fedd_internal.wsdl') |
---|
17 | |
---|
18 | def __init__(self, config=None): |
---|
19 | """ |
---|
20 | Initializer. Parses a configuration if one is given. |
---|
21 | """ |
---|
22 | self.soap_services = { } |
---|
23 | self.xmlrpc_services = { } |
---|
24 | |
---|
25 | if config: |
---|
26 | self.cert_file = config.get("globals", "cert_file"); |
---|
27 | self.cert_pwd = config.get("globals", "cert_pwd"); |
---|
28 | self.trusted_certs = config.get("globals", "trusted_certs"); |
---|
29 | |
---|
30 | if config.has_section("access"): |
---|
31 | self.access = fedd_access(config) |
---|
32 | self.soap_services.update(self.access.soap_services) |
---|
33 | self.xmlrpc_services.update(self.access.xmlrpc_services) |
---|
34 | |
---|
35 | if config.has_section("experiment_control"): |
---|
36 | self.experiment = fedd_experiment_control_local(config) |
---|
37 | self.soap_services.update(self.experiment.soap_services) |
---|
38 | self.xmlrpc_services.update(self.experiment.xmlrpc_services) |
---|
39 | |
---|
40 | if config.has_section("splitter"): |
---|
41 | self.splitter = fedd_split_local(config) |
---|
42 | self.soap_services.update(self.splitter.soap_services) |
---|
43 | self.xmlrpc_services.update(self.splitter.xmlrpc_services) |
---|
44 | |
---|
45 | def new_feddservice(config): |
---|
46 | return fedd_deter_impl(config) |
---|