diff --git a/dist/src/auth.js b/dist/src/auth.js index cb70b8abd..5d5eb528d 100644 --- a/dist/src/auth.js +++ b/dist/src/auth.js @@ -125,7 +125,8 @@ function no_auth(path) { path == '/connect_peer' || path == '/peered' || path == '/request_transport_key' || - path == '/webhook'); + path == '/webhook' || + path == '/has_admin'); } function ownerMiddleware(req, res, next) { return __awaiter(this, void 0, void 0, function* () { diff --git a/dist/src/auth.js.map b/dist/src/auth.js.map index 7cd015ab3..99b169733 100644 --- a/dist/src/auth.js.map +++ b/dist/src/auth.js.map @@ -1 +1 @@ -{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/auth.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iCAAgC;AAChC,qCAAgD;AAChD,sCAAqC;AACrC,qCAA4D;AAC5D,+CAAsD;AACtD,2CAA2C;AAC3C,yCAAuC;AACvC,wCAAuC;AACvC,qCAA2C;AAC3C,sCAAqC;AAErC,yBAAwB;AACxB,uCAA0D;AAC1D,iCAAiC;AAEjC,MAAM,MAAM,GAAG,IAAA,mBAAU,GAAE,CAAA;AAE3B;;;EAGE;AAEF,SAAsB,QAAQ,CAAC,GAAQ,EAAE,GAAG;;QAC1C,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAC,IAAI,CAAA;QAC7B,IAAI,CAAC,QAAQ,EAAE;YACb,IAAA,aAAO,EAAC,GAAG,EAAE,aAAa,CAAC,CAAA;YAC3B,OAAO,KAAK,CAAA;SACb;QAED,MAAM,UAAU,GAAG,MAAM,CAAC,uBAAuB,CAAA;QACjD,IAAI,CAAC,UAAU,EAAE;YACf,IAAA,aAAO,EAAC,GAAG,EAAE,kBAAkB,CAAC,CAAA;YAChC,OAAO,KAAK,CAAA;SACb;QAED,IAAI,MAAc,CAAA;QAElB,IAAI;YACF,MAAM,MAAM,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAAA;YACtE,IAAI,CAAC,MAAM,EAAE;gBACX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C,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAA;KAC7C;IACD,OAAO,MAAM,CAAC,WAAW,EAAE,CAAA;AAC7B,CAAC;AARD,kCAQC;AAED,MAAM,IAAI,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;AAE/D,SAAe,KAAK,CAAC,EAAE;;QACrB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAA;IAC1D,CAAC;CAAA;AAED,MAAM,QAAQ,GAAG,8DAA8D,CAAA"} \ No newline at end of file diff --git a/dist/src/controllers/admin.js b/dist/src/controllers/admin.js index cb8e0f5cf..e67cdc7a8 100644 --- a/dist/src/controllers/admin.js +++ b/dist/src/controllers/admin.js @@ -9,10 +9,29 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.listUsers = exports.addProxyUser = void 0; +exports.listUsers = exports.addProxyUser = exports.hasAdmin = void 0; const res_1 = require("../utils/res"); const proxy_1 = require("../utils/proxy"); const models_1 = require("../models"); +function hasAdmin(req, res) { + return __awaiter(this, void 0, void 0, function* () { + if (!(0, proxy_1.isProxy)()) + return (0, res_1.failure)(res, 'not proxy'); + try { + const admin = (yield models_1.models.Contact.findOne({ + where: { + isOwner: true, + isAdmin: true, + }, + })); + (0, res_1.success)(res, admin ? true : false); + } + catch (e) { + (0, res_1.failure)(res, e); + } + }); +} +exports.hasAdmin = hasAdmin; function addProxyUser(req, res) { return __awaiter(this, void 0, void 0, function* () { if (!req.owner) diff --git a/dist/src/controllers/admin.js.map b/dist/src/controllers/admin.js.map index c1048b116..27b22b1eb 100644 --- a/dist/src/controllers/admin.js.map +++ b/dist/src/controllers/admin.js.map @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AAE;YAAE,OAAO,IAAA,aAAO,EAAC,GAAG,EAAE,WAAW,CAAC,CAAA;QAEhD,IAAI;YACF,MAAM,GAAG,GAAG,MAAM,IAAA,0BAAkB,GAAE,CAAA;YACtC,MAAM,OAAO,GAAG,MAAM,IAAA,uBAAe,EAAC,GAAG,CAAC,CAAA;YAC1C,IAAA,aAAO,EAAC,GAAG,EAAE,OAAO,CAAC,CAAA;SACtB;QAAC,OAAO,CAAC,EAAE;YACV,IAAA,aAAO,EAAC,GAAG,EAAE,CAAC,CAAC,CAAA;SAChB;IACH,CAAC;CAAA;AAZD,oCAYC;AAED,SAAsB,SAAS,CAAC,GAAQ,EAAE,GAAQ;;QAChD,IAAI,CAAC,GAAG,CAAC,KAAK;YAAE,OAAO,IAAA,aAAO,EAAC,GAAG,EAAE,UAAU,CAAC,CAAA;QAC/C,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO;YAAE,OAAO,IAAA,aAAO,EAAC,GAAG,EAAE,WAAW,CAAC,CAAA;QACxD,IAAI,CAAC,IAAA,eAAO,GAAE;YAAE,OAAO,IAAA,aAAO,EAAC,GAAG,EAAE,WAAW,CAAC,CAAA;QAEhD,IAAI;YACF,MAAM,KAAK,GAAoB,CAAC,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC;gBAC3D,KAAK,EAAE;oBACL,OAAO,EAAE,IAAI;iBACd;aACF,CAAC,CAAoB,CAAA;YACtB,IAAA,aAAO,EAAC,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,CAAA;SACxB;QAAC,OAAO,CAAC,EAAE;YACV,IAAA,aAAO,EAAC,GAAG,EAAE,CAAC,CAAC,CAAA;SAChB;IACH,CAAC;CAAA;AAfD,8BAeC"} \ No newline at end of file diff --git a/dist/src/controllers/index.js b/dist/src/controllers/index.js index 252b37519..be213429a 100644 --- a/dist/src/controllers/index.js +++ b/dist/src/controllers/index.js @@ -137,6 +137,7 @@ function set(app) { app.get('/healthcheck', confirmations.healthcheck); app.get('/add_user', admin.addProxyUser); app.get('/list_users', admin.listUsers); + app.get('/has_admin', admin.hasAdmin); app.get('/version', function (req, res) { return __awaiter(this, void 0, void 0, function* () { res.send({ version: gitinfo.tag }); diff --git a/dist/src/controllers/index.js.map b/dist/src/controllers/index.js.map index 2b27c6e1d..47ed29306 100644 --- a/dist/src/controllers/index.js.map +++ b/dist/src/controllers/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/controllers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sCAA2C;AAC3C,iCAAgC;AAChC,2CAA0C;AAC1C,+BAA8B;AAC9B,qCAAoC;AACpC,uCAAsC;AACtC,qCAAoC;AACpC,uCAAsC;AACtC,iCAAgC;AAChC,uCAAsC;AACtC,sCAAqC;AACrC,gDAA+C;AAC/C,qCAAoC;AACpC,iDAAgD;AAChD,oCAAmC;AACnC,qCAAoC;AACpC,4CAA2C;AAC3C,0CAAyC;AACzC,0CAAyC;AACzC,iCAAgC;AAChC,4CAAoC;AACpC,+BAA8B;AAC9B,sCAAsC;AACtC,+BAA8B;AAC9B,2CAA0C;AAC1C,iCAAgC;AAEhC,0CAAyC;AACzC,oCAAmC;AAEnC,SAAsB,GAAG,CAAC,GAAG;;QAC3B,WAAW,CAAC,IAAI,EAAE,CAAA;QAElB,IAAI,eAAM,IAAI,eAAM,CAAC,YAAY,EAAE;YACjC,YAAY,CAAC,kBAAkB,EAAE,CAAA;SAClC;QAED,0BAA0B;QAE1B,MAAM,CAAC,YAAY,EAAE,CAAA;QAErB,gCAAgC;QAEhC,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;QACjC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,eAAe,CAAC,CAAA;QACzC,GAAG,CAAC,GAAG,CAAC,YAAY,EAAE,KAAK,CAAC,UAAU,CAAC,CAAA;QACvC,GAAG,CAAC,IAAI,CAAC,8BA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,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa;IACtC,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,CAAC,gBAAgB;IACpD,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,aAAa,CAAC,4BAA4B;IAC7E,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,YAAY;IACvC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,YAAY;IACtC,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,oBAAoB;CACxD,CAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/controllers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sCAA2C;AAC3C,iCAAgC;AAChC,2CAA0C;AAC1C,+BAA8B;AAC9B,qCAAoC;AACpC,uCAAsC;AACtC,qCAAoC;AACpC,uCAAsC;AACtC,iCAAgC;AAChC,uCAAsC;AACtC,sCAAqC;AACrC,gDAA+C;AAC/C,qCAAoC;AACpC,iDAAgD;AAChD,oCAAmC;AACnC,qCAAoC;AACpC,4CAA2C;AAC3C,0CAAyC;AACzC,0CAAyC;AACzC,iCAAgC;AAChC,4CAAoC;AACpC,+BAA8B;AAC9B,sCAAsC;AACtC,+BAA8B;AAC9B,2CAA0C;AAC1C,iCAAgC;AAEhC,0CAAyC;AACzC,oCAAmC;AAEnC,SAAsB,GAAG,CAAC,GAAG;;QAC3B,WAAW,CAAC,IAAI,EAAE,CAAA;QAElB,IAAI,eAAM,IAAI,eAAM,CAAC,YAAY,EAAE;YACjC,YAAY,CAAC,kBAAkB,EAAE,CAAA;SAClC;QAED,0BAA0B;QAE1B,MAAM,CAAC,YAAY,EAAE,CAAA;QAErB,gCAAgC;QAEhC,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;QACjC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,KAA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xD,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,UAAU,CAAC,kBAAkB;IACtD,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,iBAAiB;IAC9C,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa;IACtC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa;IACtC,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,CAAC,gBAAgB;IACpD,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,aAAa,CAAC,4BAA4B;IAC7E,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,YAAY;IACvC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,YAAY;IACtC,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,oBAAoB;CACxD,CAAA"} \ No newline at end of file diff --git a/src/auth.ts b/src/auth.ts index a8e91c578..d287e3725 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -119,7 +119,8 @@ function no_auth(path) { path == '/connect_peer' || path == '/peered' || path == '/request_transport_key' || - path == '/webhook' + path == '/webhook' || + path == '/has_admin' ) } diff --git a/src/controllers/admin.ts b/src/controllers/admin.ts index 5e50de607..7810e4924 100644 --- a/src/controllers/admin.ts +++ b/src/controllers/admin.ts @@ -3,6 +3,21 @@ import { Req, Res } from '../types' import { generateNewUser, getProxyRootPubkey, isProxy } from '../utils/proxy' import { models, ContactRecord } from '../models' +export async function hasAdmin(req: Req, res: Res): Promise { + if (!isProxy()) return failure(res, 'not proxy') + try { + const admin: ContactRecord = (await models.Contact.findOne({ + where: { + isOwner: true, + isAdmin: true, + }, + })) as ContactRecord + success(res, admin ? true : false) + } catch (e) { + failure(res, e) + } +} + export async function addProxyUser(req: Req, res: Res): Promise { if (!req.owner) return failure(res, 'no owner') if (!req.owner.isAdmin) return failure(res, 'not admin') diff --git a/src/controllers/index.ts b/src/controllers/index.ts index a2c08fdbd..f21c1a2d8 100644 --- a/src/controllers/index.ts +++ b/src/controllers/index.ts @@ -154,6 +154,7 @@ export async function set(app) { app.get('/add_user', admin.addProxyUser) app.get('/list_users', admin.listUsers) + app.get('/has_admin', admin.hasAdmin) app.get('/version', async function (req: Req, res) { res.send({ version: gitinfo.tag })