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/protogeni_access.py

    r2627eb3 re83f2f2  
    215215            return (None, None)
    216216
    217     def build_access_response(self, alloc_id, services):
     217    def build_access_response(self, alloc_id, services, proof):
    218218        """
    219219        Create the SOAP response.
     
    230230                'fedAttr': [
    231231                    { 'attribute': 'domain', 'value': self.domain } ,
    232                 ]
     232                ],
     233                'proof': proof.to_dict()
    233234            }
    234235        if self.dragon_endpoint:
     
    262263
    263264        # Request for this fedd
    264         found, match, owners = self.lookup_access(req, fid)
     265        found, match, owners, proof = self.lookup_access(req, fid)
    265266        services, svc_state = self.export_services(req.get('service',[]),
    266267                None, None)
     
    288289            raise service_error(service_error.internal,
    289290                    "Can't open %s/%s : %s" % (self.certdir, aid, e))
    290         return self.build_access_response({ 'fedid': allocID }, None)
     291        return self.build_access_response({ 'fedid': allocID }, None, proof)
    291292
    292293
     
    312313
    313314        self.log.debug("[access] deallocation requested for %s", aid)
    314         if not self.auth.check_attribute(fid, auth_attr):
     315        access_ok , proof = self.auth.check_attribute(fid, auth_attr,
     316                with_proof=True)
     317        if not access_ok:
    315318            self.log.debug("[access] deallocation denied for %s", aid)
    316319            raise service_error(service_error.access, "Access Denied")
     
    327330            self.log.debug("Removing %s" % cf)
    328331            os.remove(cf)
    329             return { 'allocID': req['allocID'] }
     332            return { 'allocID': req['allocID'], 'proof': proof.to_dict() }
    330333        else:
    331334            self.state_lock.release()
     
    12511254                cpw, alloc_log)
    12521255
    1253     def finalize_experiment(self, topo, nodes, aid, alloc_id):
     1256    def finalize_experiment(self, topo, nodes, aid, alloc_id, proof):
    12541257        # Copy the assigned names into the return topology
    12551258        rvtopo = topo.clone()
     
    12731276                    'topdldescription': rvtopo.to_dict() },
    12741277                'embedding': embedding,
     1278                'proof': proof.to_dict(),
    12751279                }
    12761280        retval = copy.deepcopy(self.allocation[aid]['started'])
     
    12951299        aid = "%s" % auth_attr
    12961300        attrs = req.get('fedAttr', [])
    1297         if not self.auth.check_attribute(fid, auth_attr):
     1301        access_ok, proof = self.auth.check_attribute(fid, auth_attr,
     1302                with_proof=True)
     1303        if not access_ok:
    12981304            raise service_error(service_error.access, "Access denied")
    12991305        else:
     
    13561362
    13571363        if rv:
    1358             return self.finalize_experiment(topo, nodes, aid, req['allocID'])
     1364            return self.finalize_experiment(topo, nodes, aid, req['allocID'],
     1365                    proof)
    13591366        elif err:
    13601367            raise service_error(service_error.federant,
     
    13921399        aid = "%s" % auth_attr
    13931400        attrs = req.get('fedAttr', [])
    1394         if not self.auth.check_attribute(fid, auth_attr):
     1401        access_ok, proof = self.auth.check_attribute(fid, auth_attr,
     1402                with_proof=True)
     1403        if not access_ok:
    13951404            raise service_error(service_error.access, "Access denied")
    13961405
     
    14191428        self.stop_segment(segment_commands, user, staging, slice_cred,
    14201429                slice_urn, cf, cpw)
    1421         return { 'allocID': req['allocID'] }
     1430        return { 'allocID': req['allocID'], 'proof': proof.to_dict() }
    14221431
    14231432    def renew_segment(self, segment_commands, name, scred, slice_urn, interval,
Note: See TracChangeset for help on using the changeset viewer.