blixify-server 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/apis/index.d.ts
CHANGED
package/dist/apis/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/apis/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/apis/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/apis/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MongoWrapper=exports.FirebaseWrapper=void 0;var fbWrapper_1=require("./fbWrapper"),mongoWrapper_1=(Object.defineProperty(exports,"FirebaseWrapper",{enumerable:!0,get:function(){return fbWrapper_1.FirebaseWrapper}}),require("./mongoWrapper"))
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SecurityMiddleware=exports.MongoWrapper=exports.FirebaseWrapper=void 0;var fbWrapper_1=require("./fbWrapper"),mongoWrapper_1=(Object.defineProperty(exports,"FirebaseWrapper",{enumerable:!0,get:function(){return fbWrapper_1.FirebaseWrapper}}),require("./mongoWrapper")),security_1=(Object.defineProperty(exports,"MongoWrapper",{enumerable:!0,get:function(){return mongoWrapper_1.MongoWrapper}}),require("./security"));Object.defineProperty(exports,"SecurityMiddleware",{enumerable:!0,get:function(){return security_1.SecurityMiddleware}});
|
package/dist/apis/security.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* 3. Basic helmet security configurations
|
|
6
6
|
* 4. Prevent DDOS from rate limiting
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export declare class SecurityMiddleware {
|
|
9
9
|
checkAuthentication: (token: string) => string;
|
|
10
10
|
checkRole: (userId: string) => string;
|
|
11
11
|
checkAPIToken: (apiToken: string) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../../src/apis/security.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,
|
|
1
|
+
{"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../../src/apis/security.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,qBAAa,kBAAkB;IAE7B,mBAAmB,UAAW,MAAM,YAElC;IACF,SAAS,WAAY,MAAM,YAEzB;IACF,aAAa,aAAc,MAAM,aAE/B;gBAIA,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,EAC9C,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,EACrC,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO;IAO9C;;;;OAIG;IACH,IAAI,UAG8C,GAAG,OAAO,GAAG,QAAQ,GAAG;CA2B3E"}
|
package/dist/apis/security.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __awaiter=this&&this.__awaiter||function(e,r,u,
|
|
1
|
+
"use strict";var __awaiter=this&&this.__awaiter||function(e,r,u,d){return new(u=u||Promise)(function(o,t){function i(e){try{c(d.next(e))}catch(e){t(e)}}function n(e){try{c(d.throw(e))}catch(e){t(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof u?t:new u(function(e){e(t)})).then(i,n)}c((d=d.apply(e,r||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.SecurityMiddleware=void 0;class SecurityMiddleware{constructor(e,t,o){this.checkAuthentication=e=>"",this.checkRole=e=>"",this.checkAPIToken=e=>!1,this.checkAuthentication=e,this.checkRole=t,this.checkAPIToken=o}init(){const i=this;return function(t,e,o){return __awaiter(this,void 0,void 0,function*(){var e;delete t.body.bm_userId,delete t.body.bm_userRole,delete t.body.bm_apiToken,t.body.userToken&&(e=i.checkAuthentication(t.body.userToken))&&(t.body.bm_userId=e,e=i.checkRole(e))&&(t.body.bm_userRole=e),t.body.apiToken&&(e=t.body.apiToken,e=i.checkAPIToken(e),t.body.bm_apiToken=e),o()})}}}exports.SecurityMiddleware=SecurityMiddleware;
|