From: Tony Mack Date: Sat, 21 Aug 2010 01:00:38 +0000 (+0000) Subject: added getDelegatedCred() method X-Git-Tag: sfa-1.0-0~28 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=bf4711fdb1ded478e134234e497bd36ebbe36626;p=sfa.git added getDelegatedCred() method --- diff --git a/sfa/plc/api.py b/sfa/plc/api.py index 8a2567dd..380ca6b4 100644 --- a/sfa/plc/api.py +++ b/sfa/plc/api.py @@ -124,11 +124,22 @@ class SfaAPI(BaseAPI): return shell def getCredential(self): + """ + Retrun a valid credential for this interface. + """ if self.interface in ['registry']: return self.getCredentialFromLocalRegistry() else: return self.getCredentialFromRegistry() - + + def getDelegatedCredential(self, creds): + """ + Attempt to find a credential delegated to us in + the specified list of creds. + """ + if creds and not isinstance(creds, list): creds = [creds] + return filter_creds_by_caller(creds,self.hrn) + def getCredentialFromRegistry(self): """ Get our credential from a remote registry