mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-12 05:17:28 -08:00
ci: Fix linting issues on master (no-changelog) (#5740)
This commit is contained in:
parent
469ce32957
commit
34d7fcc27e
|
@ -207,7 +207,7 @@ export function hasPackageLoaded(packageName: string): boolean {
|
||||||
|
|
||||||
export function removePackageFromMissingList(packageName: string): void {
|
export function removePackageFromMissingList(packageName: string): void {
|
||||||
try {
|
try {
|
||||||
const failedPackages = (config.get('nodes.packagesMissing') as string).split(' ');
|
const failedPackages = config.get('nodes.packagesMissing').split(' ');
|
||||||
|
|
||||||
const packageFailedToLoad = failedPackages.filter(
|
const packageFailedToLoad = failedPackages.filter(
|
||||||
(packageNameAndVersion) =>
|
(packageNameAndVersion) =>
|
||||||
|
|
|
@ -158,9 +158,8 @@ export class MessageEventBusLogWriter {
|
||||||
sentMessages: [],
|
sentMessages: [],
|
||||||
unfinishedExecutions: {},
|
unfinishedExecutions: {},
|
||||||
};
|
};
|
||||||
const logCount = logHistory
|
const configLogCount = config.get('eventBus.logWriter.keepLogCount');
|
||||||
? Math.min(config.get('eventBus.logWriter.keepLogCount') as number, logHistory)
|
const logCount = logHistory ? Math.min(configLogCount, logHistory) : configLogCount;
|
||||||
: (config.get('eventBus.logWriter.keepLogCount') as number);
|
|
||||||
for (let i = logCount; i >= 0; i--) {
|
for (let i = logCount; i >= 0; i--) {
|
||||||
const logFileName = this.getLogFileName(i);
|
const logFileName = this.getLogFileName(i);
|
||||||
if (logFileName) {
|
if (logFileName) {
|
||||||
|
@ -255,9 +254,8 @@ export class MessageEventBusLogWriter {
|
||||||
logHistory?: number,
|
logHistory?: number,
|
||||||
): Promise<EventMessageTypes[]> {
|
): Promise<EventMessageTypes[]> {
|
||||||
const result: EventMessageTypes[] = [];
|
const result: EventMessageTypes[] = [];
|
||||||
const logCount = logHistory
|
const configLogCount = config.get('eventBus.logWriter.keepLogCount');
|
||||||
? Math.min(config.get('eventBus.logWriter.keepLogCount') as number, logHistory)
|
const logCount = logHistory ? Math.min(configLogCount, logHistory) : configLogCount;
|
||||||
: (config.get('eventBus.logWriter.keepLogCount') as number);
|
|
||||||
for (let i = 0; i < logCount; i++) {
|
for (let i = 0; i < logCount; i++) {
|
||||||
const logFileName = this.getLogFileName(i);
|
const logFileName = this.getLogFileName(i);
|
||||||
if (logFileName) {
|
if (logFileName) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import type { RequestHandler } from 'express';
|
import type { RequestHandler } from 'express';
|
||||||
import type { AuthenticatedRequest } from '../../../requests';
|
import type { AuthenticatedRequest } from '@/requests';
|
||||||
import { isSamlLicensed, isSamlLicensedAndEnabled } from '../samlHelpers';
|
import { isSamlLicensed, isSamlLicensedAndEnabled } from '../samlHelpers';
|
||||||
|
|
||||||
export const samlLicensedOwnerMiddleware: RequestHandler = (
|
export const samlLicensedOwnerMiddleware: RequestHandler = (
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import express from 'express';
|
import express from 'express';
|
||||||
import { Get, Post, RestController } from '../../../decorators';
|
import { Get, Post, RestController } from '@/decorators';
|
||||||
import { SamlUrls } from '../constants';
|
import { SamlUrls } from '../constants';
|
||||||
import {
|
import {
|
||||||
samlLicensedAndEnabledMiddleware,
|
samlLicensedAndEnabledMiddleware,
|
||||||
|
@ -8,15 +8,14 @@ import {
|
||||||
} from '../middleware/samlEnabledMiddleware';
|
} from '../middleware/samlEnabledMiddleware';
|
||||||
import { SamlService } from '../saml.service.ee';
|
import { SamlService } from '../saml.service.ee';
|
||||||
import { SamlConfiguration } from '../types/requests';
|
import { SamlConfiguration } from '../types/requests';
|
||||||
import { AuthError, BadRequestError } from '../../../ResponseHelper';
|
import { AuthError, BadRequestError } from '@/ResponseHelper';
|
||||||
import { getInitSSOFormView } from '../views/initSsoPost';
|
import { getInitSSOFormView } from '../views/initSsoPost';
|
||||||
import { getInitSSOPostView } from '../views/initSsoRedirect';
|
import { issueCookie } from '@/auth/jwt';
|
||||||
import { issueCookie } from '../../../auth/jwt';
|
|
||||||
import { validate } from 'class-validator';
|
import { validate } from 'class-validator';
|
||||||
import type { PostBindingContext } from 'samlify/types/src/entity';
|
import type { PostBindingContext } from 'samlify/types/src/entity';
|
||||||
import { isSamlLicensedAndEnabled } from '../samlHelpers';
|
import { isSamlLicensedAndEnabled } from '../samlHelpers';
|
||||||
import type { SamlLoginBinding } from '../types';
|
import type { SamlLoginBinding } from '../types';
|
||||||
import { AuthenticatedRequest } from '../../../requests';
|
import { AuthenticatedRequest } from '@/requests';
|
||||||
|
|
||||||
@RestController('/sso/saml')
|
@RestController('/sso/saml')
|
||||||
export class SamlController {
|
export class SamlController {
|
||||||
|
@ -136,8 +135,6 @@ export class SamlController {
|
||||||
private async handleInitSSO(res: express.Response) {
|
private async handleInitSSO(res: express.Response) {
|
||||||
const result = this.samlService.getLoginRequestUrl();
|
const result = this.samlService.getLoginRequestUrl();
|
||||||
if (result?.binding === 'redirect') {
|
if (result?.binding === 'redirect') {
|
||||||
// forced client side redirect through the use of a javascript redirect
|
|
||||||
// return res.send(getInitSSOPostView(result.context));
|
|
||||||
// Return the redirect URL directly
|
// Return the redirect URL directly
|
||||||
return res.send(result.context.context);
|
return res.send(result.context.context);
|
||||||
} else if (result?.binding === 'post') {
|
} else if (result?.binding === 'post') {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { AuthenticatedRequest } from '../../../requests';
|
import type { AuthenticatedRequest } from '@/requests';
|
||||||
import type { SamlPreferences } from './samlPreferences';
|
import type { SamlPreferences } from './samlPreferences';
|
||||||
|
|
||||||
export declare namespace SamlConfiguration {
|
export declare namespace SamlConfiguration {
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
import type { BindingContext } from 'samlify/types/src/entity';
|
|
||||||
|
|
||||||
export function getInitSSOPostView(context: BindingContext): string {
|
|
||||||
return `
|
|
||||||
<html></html>
|
|
||||||
<script type="text/javascript">
|
|
||||||
// Automatic redirect
|
|
||||||
(function(){
|
|
||||||
location.href = "${context.context}";
|
|
||||||
})();
|
|
||||||
</script>`;
|
|
||||||
}
|
|
Loading…
Reference in a new issue