Пример #1
0
    def do_POST(self):
        #print self.server
        if self.path == '/stop':
            raise 'foobar'
        length = self.headers.get('Content-Length')
        data = self.rfile.read(int(length))
        data = urllib.unquote(data)
        if not data.startswith('['):
            return
        message = transports.createMessage(data)
        if message.header == 'AskLatestCDD':
            answer = self.issuer.giveLatestCDD(message)
        elif message.header == 'FetchMintKeys':
            answer = self.issuer.giveMintKeys(message)
        elif message.header == 'TransferRequest':
            answer = self.issuer.handleTransferRequest(self.mint,
                                                       self.authorizer,
                                                       message)
        elif message.header == 'TransferResume':
            answer = self.issuer.resumeTransfer(message)

        self.send_response(200)
        self.send_header("Content-type", "text/plain")
        self.wfile.write('\r\n')
        self.wfile.write(answer.toString(True))
Пример #2
0
    def do_POST(self):
        
        wallet = self.server.wallet
        client = self.server.walletclient
        
        if self.path == '/stop':
            raise 'foobar'
        length = self.headers.get('Content-Length')
        data = self.rfile.read(int(length))
        data = urllib.unquote(data)
        message = transports.createMessage(data)
        
        if message.header == 'SpendRequest':
            protocol = protocols.SpendListen(wallet,client)
 
        answer = protocol.run(message)
        self.send_response(200)
        self.send_header("Content-type", "text/plain")
        self.wfile.write('\r\n')
        self.wfile.write(answer.toString(True))
Пример #3
0
    def do_POST(self):

        wallet = self.server.wallet
        client = self.server.walletclient

        if self.path == '/stop':
            raise 'foobar'
        length = self.headers.get('Content-Length')
        data = self.rfile.read(int(length))
        data = urllib.unquote(data)
        message = transports.createMessage(data)

        if message.header == 'SpendRequest':
            protocol = protocols.SpendListen(wallet, client)

        answer = protocol.run(message)
        self.send_response(200)
        self.send_header("Content-type", "text/plain")
        self.wfile.write('\r\n')
        self.wfile.write(answer.toString(True))
    def do_POST(self):
        #print self.server
        if self.path == '/stop':
            raise 'foobar'
        length = self.headers.get('Content-Length')
        data = self.rfile.read(int(length))
        data = urllib.unquote(data)
        message = transports.createMessage(data)
        if message.header == 'AskLatestCDD':
            protocol = protocols.GiveLatestCDD(self.issuer)
        elif message.header == 'FetchMintKeys':
            protocol = protocols.GiveMintKeys(self.issuer)
        elif message.header == 'TransferRequest':
            protocol = protocols.TransferHandling(self.mint,self.authorizer)
        elif message.header == 'TransferResume':
            protocol = protocols.TransferResumeHandling(self.issuer)
 
        answer = protocol.run(message)
        self.send_response(200)
        self.send_header("Content-type", "text/plain")
        self.wfile.write('\r\n')
        self.wfile.write(answer.toString(True))
    def do_POST(self):
        #print self.server
        if self.path == '/stop':
            raise 'foobar'
        length = self.headers.get('Content-Length')
        data = self.rfile.read(int(length))
        data = urllib.unquote(data)
        message = transports.createMessage(data)
        if message.header == 'AskLatestCDD':
            protocol = protocols.GiveLatestCDD(self.issuer)
        elif message.header == 'FetchMintKeys':
            protocol = protocols.GiveMintKeys(self.issuer)
        elif message.header == 'TransferRequest':
            protocol = protocols.TransferHandling(self.mint, self.authorizer)
        elif message.header == 'TransferResume':
            protocol = protocols.TransferResumeHandling(self.issuer)

        answer = protocol.run(message)
        self.send_response(200)
        self.send_header("Content-type", "text/plain")
        self.wfile.write('\r\n')
        self.wfile.write(answer.toString(True))
Пример #6
0
    def do_POST(self):
        #print self.server
        if self.path == '/stop':
            raise 'foobar'            
        length = self.headers.get('Content-Length')
        data = self.rfile.read(int(length))
        data = urllib.unquote(data)
        if not data.startswith('['):
            return
        message = transports.createMessage(data)
        if message.header == 'AskLatestCDD':
            answer = self.issuer.giveLatestCDD(message)
        elif message.header == 'FetchMintKeys':
            answer = self.issuer.giveMintKeys(message)
        elif message.header == 'TransferRequest':
            answer = self.issuer.handleTransferRequest(self.mint,self.authorizer,message)
        elif message.header == 'TransferResume':
            answer = self.issuer.resumeTransfer(message)
 
        self.send_response(200)
        self.send_header("Content-type", "text/plain")
        self.wfile.write('\r\n')
        self.wfile.write(answer.toString(True))