c2-http 1.0.137 → 1.0.139
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.
|
@@ -8,8 +8,10 @@ const __1 = require("../..");
|
|
|
8
8
|
const AddInContextFlowItem_1 = __importDefault(require("./item/AddInContextFlowItem"));
|
|
9
9
|
const GetTokenFlowItem_1 = __importDefault(require("./item/GetTokenFlowItem"));
|
|
10
10
|
const ValidateTokenFlowItem_1 = __importDefault(require("./item/ValidateTokenFlowItem"));
|
|
11
|
+
const c2_util_1 = require("c2-util");
|
|
11
12
|
class MiddlewareCheckTokenFlow {
|
|
12
13
|
config = async (request, response, next) => {
|
|
14
|
+
(0, c2_util_1.log)("LOG_CHECK_TOKEN", "Checking token");
|
|
13
15
|
try {
|
|
14
16
|
if ((request.path === "/metrics" ||
|
|
15
17
|
request.path.startsWith("/metrics") ||
|
package/dist/model/Server.js
CHANGED
|
@@ -40,13 +40,13 @@ class Server {
|
|
|
40
40
|
// this.app.use("/docs", swaggerUI.serve, swaggerUI.setup((global as any).OPEN_API_DOC))
|
|
41
41
|
(0, c2_util_1.log)("LOG", "Rotas abertas OK");
|
|
42
42
|
//middlewares de checagem de token obrigatorio
|
|
43
|
-
|
|
43
|
+
this.app.use(MiddlewareJwt_1.default.config);
|
|
44
44
|
//middlewares de checagem de token opcional
|
|
45
45
|
// this.config.middlewaresCloseControllers?.forEach((middl: RequestHandler) => {
|
|
46
46
|
// this.app.use(middl)
|
|
47
47
|
// })
|
|
48
48
|
for (const closeRouter of this.config.closeControllers.map(c => c.router)) {
|
|
49
|
-
closeRouter.use(
|
|
49
|
+
// closeRouter.use(MiddlewareJwt.config, ...(this.config.middlewaresCloseControllers?.map(m => m) ?? []))
|
|
50
50
|
this.app.use(closeRouter);
|
|
51
51
|
}
|
|
52
52
|
(0, c2_util_1.log)("LOG", "Rotas fechadas OK");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "c2-http",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.139",
|
|
4
4
|
"description": "Biblioteca Typescript para API NodeJS",
|
|
5
5
|
"repository": "https://cabralsilva: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@github.com/cabralsilva/c2-http.git",
|
|
6
6
|
"author": "Daniel Cabral <cabralconsultoriaemsoftware@gmail.com>",
|