Skip to content
This repository was archived by the owner on Jul 9, 2019. It is now read-only.

Commit 51172ae

Browse files
committed
Emergency fixes
1 parent fb4ca86 commit 51172ae

22 files changed

+22
-1
lines changed

__tests__/config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
23
require("jest");
34
describe("foo", function () {
45
it("bars", function () {

__tests__/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
23
describe("foo", function () {
34
it("bars", function () {
45
expect(true).toBe((true));

__tests__/logger.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
23
describe("foo", function () {
34
it("bars", function () {
45
expect(true).toBe((true));

__tests__/on_ready.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
23
describe("foo", function () {
34
it("bars", function () {
45
expect(true).toBe((true));

__tests__/security/authenticate.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
23
var verify_token_1 = require("../../app/security/verify_token");
34
var fetch_real_token_1 = require("../../support/fetch_real_token");
45
var EMAIL = "[email protected]";

__tests__/security/authorize_publish.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
23
describe("foo", function () {
34
it("bars", function () {
45
expect(true).toBe((true));

__tests__/security/authorize_subscribe.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
23
describe("foo", function () {
34
it("bars", function () {
45
expect(true).toBe((true));

__tests__/security/can_use_topic.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
23
describe("foo", function () {
34
it("bars", function () {
45
expect(true).toBe((true));

__tests__/security/verify_token.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
23
var verify_token_1 = require("../../app/security/verify_token");
34
var fetch_real_token_1 = require("../../support/fetch_real_token");
45
var EMAIL = "[email protected]";

app/authentication/authenticate.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
23
// test@test.com password123
34
var verify_token_1 = require("../security/verify_token");
45
var logger_1 = require("../logger");

app/authentication/authenticate_no.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
23
var logger_1 = require("../logger");
34
/** Creates a function that is triggered when a JWT is invalid. */
45
function authenticateNo(client, callback, username) {

app/authentication/authenticate_ok.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
23
var logger_1 = require("../logger");
34
/** Creates a function that is triggered when a JWT is invalid. */
45
function authenticateOk(client, callback, username) {

app/authorization/authorize_publish.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
23
var can_use_topic_1 = require("./can_use_topic");
34
/** Determines if a user is allowed to publish to a particular topic. */
45
function authorizePublish(client, topic, payload, callback) {

app/authorization/authorize_subscribe.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
23
var can_use_topic_1 = require("./can_use_topic");
34
/** Determines if a user is allowed to listen to a particular topic. */
45
function authorizeSubscribe(client, topic, callback) {

app/authorization/can_use_topic.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
23
var logger_1 = require("../logger");
34
/** If a user has a bot of id XYZ, then they may access any topic
45
* following pattern bot/XYZ/# */

app/config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
23
var logger_1 = require("./logger");
34
exports.webAppUrl = process.env.WEB_API_URL || "http://localhost:3000";
45
logger_1.log("Using " + exports.webAppUrl + " as API URL");

app/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
23
var mosca_1 = require("mosca");
34
var config_1 = require("./config");
45
var on_ready_1 = require("./on_ready");

app/logger.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
23
function log(args) {
34
if (!process.env.DISABLE_LOGS) {
45
console.log.apply(this, arguments);

app/on_ready.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
23
var authenticate_1 = require("./authentication/authenticate");
34
var authorize_publish_1 = require("./authorization/authorize_publish");
45
var authorize_subscribe_1 = require("./authorization/authorize_subscribe");

app/security/verify_token.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
23
var config_1 = require("../config");
34
var axios_1 = require("axios");
45
var jwt = require("jsonwebtoken");

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "MQTT gateway for Farmbot",
55
"main": "app/index.js",
66
"scripts": {
7-
"start": "nodemon --exec ./node_modules/.bin/ts-node -- ./app/index.ts",
7+
"start": "nodemon ./app/index.js",
88
"test": "jest --coverage --no-cache",
99
"dev": "WEB_API_URL=http://127.0.0.1:3000 npm start"
1010
},

support/fetch_real_token.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
23
var axios_1 = require("axios");
34
var p = axios_1.default.post("http://localhost:3000/api/tokens", {
45
user: {

0 commit comments

Comments
 (0)