forked from n8n-io/n8n
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core): Force-upgrade
http-cache-semantics
to address CVE-2022-2…
…5881 (n8n-io#5733) [GitHub Advisory](GHSA-rc47-6667-2j5j)
- Loading branch information
Showing
23 changed files
with
126 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* eslint-disable @typescript-eslint/ban-types */ | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
import { CONTROLLER_AUTH_ROLES } from './constants'; | ||
import type { AuthRoleMetadata } from './types'; | ||
|
||
export function Authorized(authRole: AuthRoleMetadata[string] = 'any'): Function { | ||
return function (target: Function | Object, handlerName?: string) { | ||
const controllerClass = handlerName ? target.constructor : target; | ||
const authRoles = (Reflect.getMetadata(CONTROLLER_AUTH_ROLES, controllerClass) ?? | ||
{}) as AuthRoleMetadata; | ||
authRoles[handlerName ?? '*'] = authRole; | ||
Reflect.defineMetadata(CONTROLLER_AUTH_ROLES, authRoles, controllerClass); | ||
}; | ||
} | ||
|
||
export const NoAuthRequired = () => Authorized('none'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
import { CONTROLLER_BASE_PATH } from './constants'; | ||
import type { RequestHandler } from 'express'; | ||
import { CONTROLLER_BASE_PATH, CONTROLLER_MIDDLEWARES } from './constants'; | ||
|
||
export const RestController = | ||
(basePath: `/${string}` = '/'): ClassDecorator => | ||
(basePath: `/${string}` = '/', ...middlewares: RequestHandler[]): ClassDecorator => | ||
(target: object) => { | ||
Reflect.defineMetadata(CONTROLLER_BASE_PATH, basePath, target); | ||
Reflect.defineMetadata(CONTROLLER_MIDDLEWARES, middlewares, target); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export const CONTROLLER_ROUTES = 'CONTROLLER_ROUTES'; | ||
export const CONTROLLER_BASE_PATH = 'CONTROLLER_BASE_PATH'; | ||
export const CONTROLLER_MIDDLEWARES = 'CONTROLLER_MIDDLEWARES'; | ||
export const CONTROLLER_AUTH_ROLES = 'CONTROLLER_AUTH_ROLES'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.