REmoved modifications in auth.py and sfa-start.py.
authorSandrine Avakian <sandrine.avakian@inria.fr>
Fri, 13 Jan 2012 12:06:31 +0000 (13:06 +0100)
committerSandrine Avakian <sandrine.avakian@inria.fr>
Fri, 13 Jan 2012 12:06:31 +0000 (13:06 +0100)
sfa/server/sfa-start.py
sfa/trust/auth.py

index 59de885..c5e39bd 100755 (executable)
@@ -105,10 +105,11 @@ def install_peer_certs(server_key_file, server_cert_file):
       
             trusted_gids = interface.get_trusted_certs()
             print>>sys.stderr, " \r\n \r\n \t=============================================== install_peer_certs  TRUSTED_GIDS %s   " %(trusted_gids)
-            if trusted_gids and not isinstance(trusted_gids,list):
+            if trusted_gids:
+                 #and not isinstance(trusted_gids,list):
                 # the gid we want should be the first one in the list,
                 # but lets make sure
-                trusted_gids = [trusted_gids]
+                #trusted_gids = [trusted_gids]
                 print>>sys.stderr, " \r\n \r\n \t=============================================== install_peer_certs  TRUSTED_GIDS %s   " %(trusted_gids)
                 for trusted_gid in trusted_gids: 
                     print>>sys.stderr, " \r\n \r\n \t=============================================== install_peer_certs  trusted_gids%s   " %(trusted_gid)
@@ -117,12 +118,13 @@ def install_peer_certs(server_key_file, server_cert_file):
                     message += "unable to install trusted gid for %s" % \
                                (new_hrn) 
                     print>>sys.stderr, " \r\n \r\n \t=============================================== install_peer_certs   message %s   " %(message)
-                    gid = GID(string=trusted_gid['value'][0])
+                    gid = GID(string=trusted_gid[0])
+                    #gid = GID(string=trusted_gid['value'][0])
                     print>>sys.stderr, " \r\n \r\n \t=============================================== install_peer_certs   gid %s   " %(gid)
                     peer_gids.append(gid)
                     if gid.get_hrn() == new_hrn:
                         gid_filename = os.path.join(trusted_certs_dir, '%s.gid' % new_hrn)
-                        #gid.save_to_file(gid_filename, save_parents=True)
+                        gid.save_to_file(gid_filename, save_parents=True)
                         message = "installed trusted cert for %s" % new_hrn
                     # log the message
                     api.logger.info(message)
@@ -168,7 +170,7 @@ def update_cert_records(gids):
             }
             record = SfaRecord(dict=record)
             print>>sys.stderr, " \r\n \r\rn record %s "%(record)
-            #table.insert(record)
+            table.insert(record)
         
 def main():
     # Generate command line parser
index 8e86eb4..11b8dd7 100644 (file)
@@ -232,15 +232,16 @@ class Auth:
         @param name human readable name to test  
         """
         object_hrn = self.object_gid.get_hrn()
-       strname = str(name).strip("['']")
-       
-        if object_hrn == strname:
-            return
-        if strname.startswith((object_hrn + ".")) is True:
+       #strname = str(name).strip("['']")
+       if object_hrn == name:
+        #if object_hrn == strname:
+            return 
+        if name.startswith(object_hrn + ".") :
+        #if strname.startswith((object_hrn + ".")) is True:
             return
         #if name.startswith(get_authority(name)):
             #return
-       #print>>sys.stderr, " \r\n \t AUTH.PY  verify_object_permission GROSECHECDELENFER "
+
         raise PermissionError(name)
 
     def determine_user_rights(self, caller_hrn, record):