remove dependency of Config module from trustedroots module
[sfa.git] / sfa / trust / auth.py
index f0574d9..83cded0 100644 (file)
@@ -24,10 +24,10 @@ class Auth:
     def __init__(self, peer_cert = None, config = None ):
         self.peer_cert = peer_cert
         self.hierarchy = Hierarchy()
-        self.trusted_cert_list = TrustedRootList().get_list() 
         if not config:
-            self.config = Config() 
-    
+            self.config = Config()
+        self.trusted_cert_list = TrustedRootList(self.config.get_trustedroots_dir()).get_list()
+
 
     def check(self, cred, operation):
         """
@@ -96,6 +96,7 @@ class Auth:
         @param auth_name human readable name of authority
         """
 
+        # get auth info will throw an exception if the authority doesnt exist
         self.get_auth_info(name)
 
 
@@ -108,9 +109,9 @@ class Auth:
         @param name human readable name of object        
         """
         auth_name = self.get_authority(name)
-        if not auth_name or name == self.config.SFA_INTERFACE_HRN:
-            # the root authority belongs to the registry by default?
-            # TODO: is this true?
+        if not auth_name:
+            auth_name = name 
+        if name == self.config.SFA_INTERFACE_HRN:
             return
         self.verify_auth_belongs_to_me(auth_name)