Browse Source

sign the mqtt bot_res payload

push-params
Evan Feenstra 4 years ago
parent
commit
8ec48389be
  1. 9
      api/controllers/actions.ts
  2. 10
      dist/api/controllers/actions.js
  3. 2
      dist/api/controllers/actions.js.map

9
api/controllers/actions.ts

@ -6,7 +6,6 @@ import * as rsa from '../crypto/rsa'
import * as jsonUtils from '../utils/json' import * as jsonUtils from '../utils/json'
import * as socket from '../utils/socket' import * as socket from '../utils/socket'
import { success, failure } from '../utils/res' import { success, failure } from '../utils/res'
import * as tribes from '../utils/tribes'
/* /*
@ -92,9 +91,11 @@ export async function finalAction(a:Action, bot_id:string){
bot_id, bot_id,
sender:{pub_key: owner.publicKey}, // for verify sig sender:{pub_key: owner.publicKey}, // for verify sig
} }
await tribes.publish(topic, data, function(){ try {
console.log('=> bbot res forwarded back to tribe admin') await network.signAndSend({dest,data}, topic)
}) } catch(e) {
console.log('=> couldnt mqtt publish')
}
return return
} }

10
dist/api/controllers/actions.js

@ -17,7 +17,6 @@ const rsa = require("../crypto/rsa");
const jsonUtils = require("../utils/json"); const jsonUtils = require("../utils/json");
const socket = require("../utils/socket"); const socket = require("../utils/socket");
const res_1 = require("../utils/res"); const res_1 = require("../utils/res");
const tribes = require("../utils/tribes");
/* /*
hexdump -n 8 -e '4/4 "%08X" 1 "\n"' /dev/random hexdump -n 8 -e '4/4 "%08X" 1 "\n"' /dev/random
hexdump -n 16 -e '4/4 "%08X" 1 "\n"' /dev/random hexdump -n 16 -e '4/4 "%08X" 1 "\n"' /dev/random
@ -94,9 +93,12 @@ function finalAction(a, bot_id) {
bot_id, bot_id,
sender: { pub_key: owner.publicKey }, sender: { pub_key: owner.publicKey },
}; };
yield tribes.publish(topic, data, function () { try {
console.log('=> bbot res forwarded back to tribe admin'); yield network.signAndSend({ dest, data }, topic);
}); }
catch (e) {
console.log('=> couldnt mqtt publish');
}
return; return;
} }
if (action === 'keysend') { if (action === 'keysend') {

2
dist/api/controllers/actions.js.map

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save