pass options to auth.check()
authorTony Mack <tmack@paris.CS.Princeton.EDU>
Thu, 22 May 2014 02:02:04 +0000 (22:02 -0400)
committerTony Mack <tmack@paris.CS.Princeton.EDU>
Thu, 22 May 2014 02:02:04 +0000 (22:02 -0400)
sfa/methods/CreateSliver.py
sfa/methods/DeleteSliver.py
sfa/methods/ListResources.py
sfa/methods/RenewSliver.py
sfa/methods/SliverStatus.py

index bc9bf96..47647da 100644 (file)
@@ -34,10 +34,8 @@ class CreateSliver(Method):
 
         self.api.logger.info("interface: %s\ttarget-hrn: %s\tmethod-name: %s"%(self.api.interface, hrn, self.name))
 
-        (speaking_for, _) = urn_to_hrn(options.get('geni_speaking_for'))
-    
         # Find the valid credentials
-        valid_creds = self.api.auth.checkCredentials(creds, 'createsliver', hrn, speaking_for)
+        valid_creds = self.api.auth.checkCredentials(creds, 'createsliver', hrn, options=options)
         origin_hrn = Credential(string=valid_creds[0]).get_gid_caller().get_hrn()
 
         # make sure users info is specified
index caa3694..66726aa 100644 (file)
@@ -26,8 +26,7 @@ class DeleteSliver(Method):
     
     def call(self, xrn, creds, options):
         (hrn, type) = urn_to_hrn(xrn)
-        (speaking_for, _) = urn_to_hrn(options.get('geni_speaking_for'))
-        valid_creds = self.api.auth.checkCredentials(creds, 'deletesliver', hrn, speaking_for)
+        valid_creds = self.api.auth.checkCredentials(creds, 'deletesliver', hrn, options=options)
 
         #log the call
         origin_hrn = Credential(string=valid_creds[0]).get_gid_caller().get_hrn()
index 4fb0faf..03d904d 100644 (file)
@@ -36,10 +36,9 @@ class ListResources(Method):
         # get slice's hrn from options    
         xrn = options.get('geni_slice_urn', '')
         (hrn, _) = urn_to_hrn(xrn)
-        (speaking_for, _) = urn_to_hrn(options.get('geni_speaking_for'))
 
         # Find the valid credentials
-        valid_creds = self.api.auth.checkCredentials(creds, 'listnodes', hrn, speaking_for)
+        valid_creds = self.api.auth.checkCredentials(creds, 'listnodes', hrn, options=options)
 
         # get hrn of the original caller 
         origin_hrn = options.get('origin_hrn', None)
index 735a566..27257b6 100644 (file)
@@ -32,10 +32,8 @@ class RenewSliver(Method):
 
         self.api.logger.info("interface: %s\ttarget-hrn: %s\tcaller-creds: %s\tmethod-name: %s"%(self.api.interface, hrn, creds, self.name))
 
-        (speaking_for, _) = urn_to_hrn(options.get('geni_speaking_for'))
-        
         # Find the valid credentials
-        valid_creds = self.api.auth.checkCredentials(creds, 'renewsliver', hrn, speaking_for)
+        valid_creds = self.api.auth.checkCredentials(creds, 'renewsliver', hrn, options=options)
 
         # Validate that the time does not go beyond the credential's expiration time
         requested_time = utcparse(expiration_time)
index bf9b4d4..4eb892e 100644 (file)
@@ -25,7 +25,7 @@ class SliverStatus(Method):
 
         self.api.logger.info("interface: %s\ttarget-hrn: %s\tmethod-name: %s"%(self.api.interface, hrn, self.name))
     
-        status = self.api.manager.SliverStatus(self.api, hrn, valid_creds, options)
+        status = self.api.manager.SliverStatus(self.api, hrn, valid_creds, options=options)
 
         return status