Changeset 353db8c for fedd/federation/authorizer.py
- Timestamp:
- Nov 23, 2010 5:00:48 PM (13 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master
- Children:
- 6e63513
- Parents:
- 3ff5e2a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/authorizer.py
r3ff5e2a r353db8c 11 11 from remote_service import service_caller 12 12 from service_error import service_error 13 from util import abac_pem_type, abac_split_cert 13 14 14 15 … … 192 193 attribute_error = authorizer_base.attribute_error 193 194 class no_file(RuntimeError): pass 194 195 def __init__(self, certs=None, me=None, key=None, load=None): 195 class bad_cert(RuntimeError): pass 196 197 def __init__(self, certs=None, me=None, key=None, load=None, save=None): 196 198 self.creddy = '/usr/local/bin/creddy' 197 199 self.globals = set() 198 200 self.lock = Lock() 199 201 self.me = me 200 self.key = key 202 self.save_dir = load or save 203 # If the me parameter is a combination certificate, split it into the 204 # abac_authorizer save directory (if any) for use with creddy. 205 if abac_pem_type(self.me) == 'both': 206 if self.save_dir: 207 self.key, self.me = abac_split_cert(self.me, 208 keyfile="%s/key.pem" % self.save_dir, 209 certfile = "%s/cert.pem" % self.save_dir) 210 else: 211 raise abac_authorizer.bad_cert("Combination certificate " + \ 212 "and nowhere to split it"); 213 else: 214 self.key = key 201 215 self.context = ABAC.Context() 202 216 if me: … … 216 230 217 231 if load: 218 self.save_dir = load219 232 self.load(load) 220 else:221 self.save_dir = None222 233 223 234 @staticmethod … … 453 464 st = pickle.load(f) 454 465 f.close() 455 # C poy the useful attributes from the pickled state466 # Copy the useful attributes from the pickled state 456 467 for a in ('globals', 'key', 'me', 'cert', 'fedid'): 457 468 setattr(self, a, getattr(st, a, None))
Note: See TracChangeset
for help on using the changeset viewer.