X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fmethods%2Fget_ticket.py;h=314e35950e1bd380d8e3baff58fbcd6edb89f008;hb=3d7237fa0b5f2b4a60cb97c7fb3b6aecfd94558a;hp=62e0d30d91abecf469c84f7fbb96d1fb7d441566;hpb=ed16d55a2f364c83b2cd94fa70f9da3ba3fa4e2e;p=sfa.git diff --git a/sfa/methods/get_ticket.py b/sfa/methods/get_ticket.py index 62e0d30d..314e3595 100644 --- a/sfa/methods/get_ticket.py +++ b/sfa/methods/get_ticket.py @@ -7,7 +7,7 @@ from sfa.util.parameter import Parameter, Mixed from sfa.trust.auth import Auth from sfa.util.config import Config from sfa.trust.credential import Credential -from sfa.util.genitable import GeniTable +from sfa.util.table import SfaTable from sfa.util.sfaticket import SfaTicket from sfa.plc.slices import Slices from sfatables.runtime import SFATablesRules @@ -36,21 +36,21 @@ class get_ticket(Method): Parameter(str, "Credential string"), Parameter(str, "Human readable name of slice to retrive a ticket for (hrn)"), Parameter(str, "Resource specification (rspec)"), - Mixed(Parameter(str, "Request hash"), - Parameter(None, "Request hash not specified")) + Mixed(Parameter(str, "Human readable name of the original caller"), + Parameter(None, "Origin hrn not specified")) ] returns = Parameter(str, "String represeneation of a ticket object") - def call(self, cred, hrn, rspec, request_hash=None): + def call(self, cred, hrn, rspec, origin_hrn=None): user_cred = Credential(string=cred) #log the call - gid_origin_caller = user_cred.get_gid_origin_caller() - origin_hrn = gid_origin_caller.get_hrn() + if not origin_hrn: + origin_hrn = user_cred.get_gid_caller().get_hrn() self.api.logger.info("interface: %s\tcaller-hrn: %s\ttarget-hrn: %s\tmethod-name: %s"%(self.api.interface, origin_hrn, hrn, self.name)) - self.api.auth.authenticateCred(cred, [cred, hrn, rspec], request_hash) + # validate the cred self.api.auth.check(cred, "getticket") # set the right outgoing rules @@ -81,7 +81,7 @@ class get_ticket(Method): rspec_object = RSpec(xml=rspec) rspec_object.filter(tagname='NodeSpec', attribute='name', whitelist=valid_hostnames) rspec = rspec_object.toxml() - ticket = manager.get_ticket(self.api, hrn, rspec, gid_origin_caller) + ticket = manager.get_ticket(self.api, hrn, rspec, origin_hrn) return ticket