From 1e51441243c7927f56f192febb331f9a30924fdc Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Mon, 24 Oct 2011 17:06:36 -0400 Subject: [PATCH] load delegated creds against auth hierarchy --- sfa/plc/api.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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): """ -- 2.47.0