From: Tony Mack Date: Mon, 24 Oct 2011 21:06:36 +0000 (-0400) Subject: load delegated creds against auth hierarchy X-Git-Tag: sfa-1.1-1~50 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=1e51441243c7927f56f192febb331f9a30924fdc;p=sfa.git load delegated creds against auth hierarchy --- diff --git a/sfa/plc/api.py b/sfa/plc/api.py index 9891410a..cad22671 100644 --- a/sfa/plc/api.py +++ b/sfa/plc/api.py @@ -179,12 +179,17 @@ class SfaAPI(BaseAPI): Attempt to find a credential delegated to us in the specified list of creds. """ + from sfa.trust.hierarchy import Hierarchy if creds and not isinstance(creds, list): creds = [creds] - delegated_creds = filter_creds_by_caller(creds, [self.hrn, self.hrn + '.slicemanager']) - if not delegated_creds: - return None - return delegated_creds[0] + hierarchy = Hierarchy() + + delegated_cred = None + for cred in creds: + if hierarchy.auth_exists(Credential(string=cred).get_gid_caller().get_hrn()): + delegated_cred = cred + break + return delegated_cred def __getCredential(self): """