exodus-framework 2.0.767 → 2.0.769
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/lib/middlewares/authentication.d.ts +1 -1
- package/lib/middlewares/authentication.d.ts.map +1 -1
- package/lib/middlewares/authentication.js +10 -7
- package/lib/models/Application.d.ts +1 -0
- package/lib/models/Application.d.ts.map +1 -1
- package/lib/models/Application.js +4 -0
- package/package.json +1 -1
@@ -1,7 +1,7 @@
|
|
1
1
|
import { RequestHandler } from 'express';
|
2
2
|
import HttpController from '../app/controller';
|
3
3
|
declare class AuthenticationMiddleware extends HttpController {
|
4
|
-
decryptToken: RequestHandler;
|
4
|
+
decryptToken(required?: boolean): RequestHandler;
|
5
5
|
}
|
6
6
|
export default AuthenticationMiddleware;
|
7
7
|
//# sourceMappingURL=authentication.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"authentication.d.ts","sourceRoot":"","sources":["../../src/middlewares/authentication.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAG/C,cAAM,wBAAyB,SAAQ,cAAc;IACnD,YAAY,
|
1
|
+
{"version":3,"file":"authentication.d.ts","sourceRoot":"","sources":["../../src/middlewares/authentication.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAG/C,cAAM,wBAAyB,SAAQ,cAAc;IACnD,YAAY,CAAC,QAAQ,GAAE,OAAc,GAAG,cAAc;CAUvD;AAED,eAAe,wBAAwB,CAAC"}
|
@@ -10,12 +10,15 @@ var _controller = _interopRequireDefault(require("../app/controller"));
|
|
10
10
|
var _security = _interopRequireDefault(require("../services/security"));
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
12
12
|
class AuthenticationMiddleware extends _controller.default {
|
13
|
-
decryptToken =
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
13
|
+
decryptToken(required = true) {
|
14
|
+
return (0, _expressJwt.expressjwt)({
|
15
|
+
secret: async () => {
|
16
|
+
return _security.default.singleton().getServicePublicKey().toPEM(false);
|
17
|
+
},
|
18
|
+
issuer: _app.Core.settings.getAuthentication().serviceIssuer,
|
19
|
+
algorithms: ['RS256'],
|
20
|
+
credentialsRequired: required // Controla se o token é obrigatório
|
21
|
+
});
|
22
|
+
}
|
20
23
|
}
|
21
24
|
var _default = exports.default = AuthenticationMiddleware;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Application.d.ts","sourceRoot":"","sources":["../../src/models/Application.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAEhB,eAAe,EACf,uBAAuB,EACvB,KAAK,EACN,MAAM,WAAW,CAAC;AAGnB,qBAAa,WAAY,SAAQ,KAAK,CACpC,eAAe,CAAC,WAAW,CAAC,EAC5B,uBAAuB,CAAC,WAAW,CAAC,CACrC;IACS,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;CACvD"}
|
1
|
+
{"version":3,"file":"Application.d.ts","sourceRoot":"","sources":["../../src/models/Application.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAEhB,eAAe,EACf,uBAAuB,EACvB,KAAK,EACN,MAAM,WAAW,CAAC;AAGnB,qBAAa,WAAY,SAAQ,KAAK,CACpC,eAAe,CAAC,WAAW,CAAC,EAC5B,uBAAuB,CAAC,WAAW,CAAC,CACrC;IACS,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;CACvD"}
|