getDelegatedCred returns a single credential or None, not a list of credentials.
authorTony Mack <tmack@cs.princeton.edu>
Sat, 21 Aug 2010 01:04:41 +0000 (01:04 +0000)
committerTony Mack <tmack@cs.princeton.edu>
Sat, 21 Aug 2010 01:04:41 +0000 (01:04 +0000)
sfa/plc/api.py

index 380ca6b..25df830 100644 (file)
@@ -137,8 +137,12 @@ class SfaAPI(BaseAPI):
         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)
+        if creds and not isinstance(creds, list): 
+            creds = [creds]
+        delegated_creds = filter_creds_by_caller(creds,self.hrn)
+        if not delegated_creds:
+            return None
+        return delegated_creds[0]
  
     def getCredentialFromRegistry(self):
         """