moved filter_creds_by_caller() from auth.py to credential.py
authorTony Mack <tmack@cs.princeton.edu>
Fri, 20 Aug 2010 22:29:27 +0000 (22:29 +0000)
committerTony Mack <tmack@cs.princeton.edu>
Fri, 20 Aug 2010 22:29:27 +0000 (22:29 +0000)
sfa/trust/auth.py
sfa/trust/credential.py

index 8570c78..8832639 100644 (file)
@@ -17,22 +17,6 @@ from sfa.util.sfaticket import *
 from sfa.util.sfalogging import logger
 import sys
 
-def filter_creds_by_caller(self, creds, caller_hrn):
-        """
-        Returns a list of creds who's gid caller matches the
-        specified caller hrn
-        """
-        if not isinstance(creds, list): creds = [creds]
-        caller_creds = []
-        for cred in creds:
-            try:
-                tmp_cred = Credential(string=cred)
-                if tmp_cred.get_gid_caller().get_hrn() == caller_hrn:
-                    caller_creds.append(cred)
-            except: pass
-        return caller_creds
-
-
 class Auth:
     """
     Credential based authentication
index 4735a69..de5fbae 100644 (file)
@@ -171,6 +171,21 @@ class Signature(object):
 # not be changed else the signature is no longer valid.  So, once
 # you have loaded an existing signed credential, do not call encode() or sign() on it.
 
+def filter_creds_by_caller(self, creds, caller_hrn):
+        """
+        Returns a list of creds who's gid caller matches the
+        specified caller hrn
+        """
+        if not isinstance(creds, list): creds = [creds]
+        caller_creds = []
+        for cred in creds:
+            try:
+                tmp_cred = Credential(string=cred)
+                if tmp_cred.get_gid_caller().get_hrn() == caller_hrn:
+                    caller_creds.append(cred)
+            except: pass
+        return caller_creds
+
 class Credential(object):
 
     ##