Ignore:
Timestamp:
Dec 14, 2010 6:58:28 PM (13 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master
Children:
c092b7f
Parents:
2627eb3
Message:

Move proofs around. Lots of changes, including fault handling.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/dragon_access.py

    r2627eb3 re83f2f2  
    418418        return (repo, alloc_log)
    419419
    420     def finalize_experiment(self, topo, vlan_no, gri, aid, alloc_id):
     420    def finalize_experiment(self, topo, vlan_no, gri, aid, alloc_id, proof):
    421421        """
    422422        Place the relevant information in the global state block, and prepare
     
    442442                    'topdldescription': rtopo.to_dict()
    443443                    },
     444                'proof': proof.to_dict(),
    444445                }
    445446        retval = copy.deepcopy(self.state[aid]['started'])
     
    462463        aid = "%s" % auth_attr
    463464        attrs = req.get('fedAttr', [])
    464         if not self.auth.check_attribute(fid, auth_attr):
     465        access_ok, proof = self.auth.check_attribute(fid, auth_attr,
     466                with_proof=True)
     467        if not access_ok:
    465468            raise service_error(service_error.access, "Access denied")
    466469        else:
     
    508511        if gri:
    509512            return self.finalize_experiment(topo, vlan_no, gri, aid,
    510                     req['allocID'])
     513                    req['allocID'], proof)
    511514        elif err:
    512515            raise service_error(service_error.federant,
     
    526529        self.log.debug("Terminate request for %s" %aid)
    527530        attrs = req.get('fedAttr', [])
    528         if not self.auth.check_attribute(fid, auth_attr):
     531        access_ok, proof = self.auth.check_attribute(fid, auth_attr,
     532                with_proof=True)
     533        if not access_ok:
    529534            raise service_error(service_error.access, "Access denied")
    530535
     
    549554        self.log.debug("Stop segment for GRI: %s" %gri)
    550555        self.stop_segment(user, gri)
    551         return { 'allocID': req['allocID'] }
     556        return { 'allocID': req['allocID'], 'proof': proof.to_dict() }
Note: See TracChangeset for help on using the changeset viewer.