예제 #1
0
 def _check_subscriber(self, request, subid):
     """Check that there was an API key, and republish"""
     if len(subid) == 1:
         # send the object to the republisher
         public = subid[0][1]
         subid = subid[0][0]
         obj = transfer.read(request)
         self.republisher.republish(request.prepath[-1], public, obj)
         util.push_metadata(obj)
         return subid, obj
     else:
         raise SmapException("Invalid key\n", 404)
예제 #2
0
파일: server.py 프로젝트: rraabb/smap
 def _check_subscriber(self, request, subid):
     """Check that there was an API key, and republish"""
     if len(subid) == 1:
         # send the object to the republisher
         public = subid[0][1]
         subid = subid[0][0]
         obj = transfer.read(request)
         self.republisher(request.prepath[-1], public, obj)
         util.push_metadata(obj)
         return subid, obj
     else:
         raise SmapException("Invalid key\n", 404)
예제 #3
0
    def _check_subscriber(self, request, subid):
        """Check that there was an API key, and republish"""
        if len(subid) == 1:
            # send the object to the republisher
            public = subid[0][1]
            subid = subid[0][0]
            obj = transfer.read(request)

            # we want to republish the non-munged version of the data,
            # but then if that fails it may kill further processing.
            d = self.republisher(request.prepath[-1], public, obj)
            util.push_metadata(obj)
            d.addCallback(lambda _: (subid, obj))

            return d
        else:
            raise SmapException("Invalid key\n", 404)
예제 #4
0
    def _check_subscriber(self, request, subid):
        """Check that there was an API key, and republish"""
        if len(subid) == 1:
            # send the object to the republisher
            public = subid[0][1]
            subid = subid[0][0]
            obj = transfer.read(request)

            # we want to republish the non-munged version of the data,
            # but then if that fails it may kill further processing.
            d = self.republisher(request.prepath[-1], public, obj)
            util.push_metadata(obj)
            d.addCallback(lambda _: (subid, obj))

            return d
        else:
            raise SmapException("Invalid key\n", 404)