From 363702047a96076178e0536de172e8060cb1c512 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Wed, 21 May 2014 22:02:04 -0400 Subject: [PATCH] pass options to auth.check() --- sfa/methods/CreateSliver.py | 4 +--- sfa/methods/DeleteSliver.py | 3 +-- sfa/methods/ListResources.py | 3 +-- sfa/methods/RenewSliver.py | 4 +--- sfa/methods/SliverStatus.py | 2 +- 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/sfa/methods/CreateSliver.py b/sfa/methods/CreateSliver.py index bc9bf961..47647dae 100644 --- a/sfa/methods/CreateSliver.py +++ b/sfa/methods/CreateSliver.py @@ -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 diff --git a/sfa/methods/DeleteSliver.py b/sfa/methods/DeleteSliver.py index caa3694f..66726aab 100644 --- a/sfa/methods/DeleteSliver.py +++ b/sfa/methods/DeleteSliver.py @@ -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() diff --git a/sfa/methods/ListResources.py b/sfa/methods/ListResources.py index 4fb0fafc..03d904d9 100644 --- a/sfa/methods/ListResources.py +++ b/sfa/methods/ListResources.py @@ -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) diff --git a/sfa/methods/RenewSliver.py b/sfa/methods/RenewSliver.py index 735a566c..27257b69 100644 --- a/sfa/methods/RenewSliver.py +++ b/sfa/methods/RenewSliver.py @@ -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) diff --git a/sfa/methods/SliverStatus.py b/sfa/methods/SliverStatus.py index bf9b4d4d..4eb892e1 100644 --- a/sfa/methods/SliverStatus.py +++ b/sfa/methods/SliverStatus.py @@ -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 -- 2.43.0