backtrace-service
Advanced tools
Comparing version 3.4.0-alpha.0 to 3.4.0-alpha.1
import { NextFunction, Request, Response } from 'express'; | ||
import { Logger } from '../log/logger'; | ||
import { ApiError } from '../model/apiError'; | ||
import { IServiceDescriptor } from '../model/serviceDescriptor'; | ||
@@ -65,3 +64,3 @@ import { IAuthRequest } from './model/authRequest'; | ||
roles?: BacktraceRole | BacktraceRole[]; | ||
}): (request: Request, _: Response, next: NextFunction) => Promise<void | ApiError>; | ||
}): (request: Request, response: Response, next: NextFunction) => Promise<void>; | ||
isAuthenticatedRequest(request: Request): request is IAuthRequest; | ||
@@ -74,3 +73,3 @@ /** | ||
*/ | ||
authenticateRequest(): (request: Request, response: Response, next: NextFunction) => Promise<void | ApiError>; | ||
authenticateRequest(): (request: Request, response: Response, next: NextFunction) => Promise<void>; | ||
private verifyProjectAccess; | ||
@@ -77,0 +76,0 @@ /** |
@@ -278,3 +278,3 @@ "use strict"; | ||
var manager = this; | ||
function authorizeBacktraceUser(request, _, next) { | ||
function authorizeBacktraceUser(request, response, next) { | ||
var _a, _b, _c; | ||
@@ -286,5 +286,7 @@ return __awaiter(this, void 0, void 0, function () { | ||
case 0: | ||
// This function checks project access, so we can bypass the project check | ||
manager.bypassProjectAccessCheck(response); | ||
if (!manager.isAuthenticatedRequest(request)) { | ||
(_a = manager._logger) === null || _a === void 0 ? void 0 : _a.warn("Request not authenticated!"); | ||
return [2 /*return*/, new apiError_1.ApiError("Access denied", 403)]; | ||
return [2 /*return*/, next(new apiError_1.ApiError("Access denied", 403))]; | ||
} | ||
@@ -291,0 +293,0 @@ configuration = request.coronerAuth.cfg; |
{ | ||
"name": "backtrace-service", | ||
"version": "3.4.0-alpha.0", | ||
"version": "3.4.0-alpha.1", | ||
"description": "Common tools for Backtrace Node services", | ||
@@ -5,0 +5,0 @@ "author": "Backtrace", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
228782
3350