Changeset 73ded03 for fedd


Ignore:
Timestamp:
Oct 28, 2009 6:38:39 PM (15 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-2.00, version-3.01, version-3.02
Children:
a31b94d
Parents:
bda8351
Message:

global parameters to configure ABAC authorizer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/deter_impl.py

    rbda8351 r73ded03  
    66from split import split_local
    77from util import read_simple_accessdb
     8from fedid import fedid
    89
    9 from authorizer import authorizer
     10from authorizer import authorizer, abac_authorizer
    1011
    1112class deter_impl:
     
    2728        self.soap_services = { }
    2829        self.xmlrpc_services = { }
    29         self.auth = authorizer()
     30        self.auth = None
    3031
    3132        if config:
     
    3435            self.trusted_certs = config.get("globals", "trusted_certs");
    3536            self.access_type = config.get("globals", "access_type", "emulab")
     37            self.auth_type = config.get("globals", "auth_type", "legacy")
     38
     39            if self.auth_type == 'legacy':
     40                self.auth = authorizer()
     41            elif self.auth_type == 'abac':
     42                auth_url = config.get('globals', 'auth_url')
     43                if not auth_url:
     44                    raise RuntimeError("auth_url required for ABAC " + \
     45                            "authorization")
     46                if self.cert_file:
     47                    me = fedid(file=self.cert_file)
     48                else:
     49                    raise RuntimeError("ABAC authorization needs a " +\
     50                            "certificate file")
     51                self.auth= abac_authorizer(url=auth_url,
     52                        cert_file=self.cert_file, cert_pwd=self.cert_pwd,
     53                        trusted_certs=self.trusted_certs, me=me)
     54            else:
     55                raise RuntimeError("Unknown authorizer type %s" % \
     56                        self.auth_type)
    3657
    3758            access_db = config.get("globals", "accessdb")
Note: See TracChangeset for help on using the changeset viewer.