[19cc408] | 1 | #!/usr/local/bin/python |
---|
| 2 | |
---|
| 3 | from fedd_access import * |
---|
| 4 | from fedd_experiment_control import * |
---|
| 5 | from fedd_config_file import * |
---|
| 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_path=None): |
---|
| 19 | """ |
---|
| 20 | Initializer. Parses a configuration if one is given. |
---|
| 21 | """ |
---|
| 22 | if config_path: |
---|
| 23 | self.soap_methods = { } |
---|
| 24 | self.xmlrpc_methods = { } |
---|
| 25 | config = config_file(config_path) |
---|
| 26 | |
---|
| 27 | self.cert_file = config.cert_file; |
---|
| 28 | self.cert_pwd = config.cert_pwd; |
---|
| 29 | self.trusted_certs = config.trusted_certs; |
---|
| 30 | |
---|
| 31 | self.access = fedd_access(config) |
---|
| 32 | self.experiment = fedd_experiment_control_local(config) |
---|
| 33 | |
---|
| 34 | self.soap_methods.update(self.access.get_soap_services()) |
---|
| 35 | self.soap_methods.update(self.experiment.get_soap_services()) |
---|
| 36 | |
---|
| 37 | self.xmlrpc_methods.update(self.access.get_xmlrpc_services()) |
---|
| 38 | self.xmlrpc_methods.update(self.experiment.get_xmlrpc_services()) |
---|
| 39 | |
---|
| 40 | def get_soap_services(self): |
---|
| 41 | return self.soap_methods |
---|
| 42 | |
---|
| 43 | def get_xmlrpc_services(self): |
---|
| 44 | return self.xmlrpc_methods |
---|
| 45 | |
---|
| 46 | def new_feddservice(configfile): |
---|
| 47 | return fedd_deter_impl(configfile) |
---|