ci: Fix linting issues on master (no-changelog) (#5740)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2023-03-21 12:11:59 +01:00 committed by GitHub
parent 469ce32957
commit 34d7fcc27e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 28 deletions

View file

@ -207,7 +207,7 @@ export function hasPackageLoaded(packageName: string): boolean {
export function removePackageFromMissingList(packageName: string): void {
try {
const failedPackages = (config.get('nodes.packagesMissing') as string).split(' ');
const failedPackages = config.get('nodes.packagesMissing').split(' ');
const packageFailedToLoad = failedPackages.filter(
(packageNameAndVersion) =>

View file

@ -158,9 +158,8 @@ export class MessageEventBusLogWriter {
sentMessages: [],
unfinishedExecutions: {},
};
const logCount = logHistory
? Math.min(config.get('eventBus.logWriter.keepLogCount') as number, logHistory)
: (config.get('eventBus.logWriter.keepLogCount') as number);
const configLogCount = config.get('eventBus.logWriter.keepLogCount');
const logCount = logHistory ? Math.min(configLogCount, logHistory) : configLogCount;
for (let i = logCount; i >= 0; i--) {
const logFileName = this.getLogFileName(i);
if (logFileName) {
@ -255,9 +254,8 @@ export class MessageEventBusLogWriter {
logHistory?: number,
): Promise<EventMessageTypes[]> {
const result: EventMessageTypes[] = [];
const logCount = logHistory
? Math.min(config.get('eventBus.logWriter.keepLogCount') as number, logHistory)
: (config.get('eventBus.logWriter.keepLogCount') as number);
const configLogCount = config.get('eventBus.logWriter.keepLogCount');
const logCount = logHistory ? Math.min(configLogCount, logHistory) : configLogCount;
for (let i = 0; i < logCount; i++) {
const logFileName = this.getLogFileName(i);
if (logFileName) {

View file

@ -1,5 +1,5 @@
import type { RequestHandler } from 'express';
import type { AuthenticatedRequest } from '../../../requests';
import type { AuthenticatedRequest } from '@/requests';
import { isSamlLicensed, isSamlLicensedAndEnabled } from '../samlHelpers';
export const samlLicensedOwnerMiddleware: RequestHandler = (

View file

@ -1,5 +1,5 @@
import express from 'express';
import { Get, Post, RestController } from '../../../decorators';
import { Get, Post, RestController } from '@/decorators';
import { SamlUrls } from '../constants';
import {
samlLicensedAndEnabledMiddleware,
@ -8,15 +8,14 @@ import {
} from '../middleware/samlEnabledMiddleware';
import { SamlService } from '../saml.service.ee';
import { SamlConfiguration } from '../types/requests';
import { AuthError, BadRequestError } from '../../../ResponseHelper';
import { AuthError, BadRequestError } from '@/ResponseHelper';
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 type { PostBindingContext } from 'samlify/types/src/entity';
import { isSamlLicensedAndEnabled } from '../samlHelpers';
import type { SamlLoginBinding } from '../types';
import { AuthenticatedRequest } from '../../../requests';
import { AuthenticatedRequest } from '@/requests';
@RestController('/sso/saml')
export class SamlController {
@ -136,8 +135,6 @@ export class SamlController {
private async handleInitSSO(res: express.Response) {
const result = this.samlService.getLoginRequestUrl();
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 res.send(result.context.context);
} else if (result?.binding === 'post') {

View file

@ -1,4 +1,4 @@
import type { AuthenticatedRequest } from '../../../requests';
import type { AuthenticatedRequest } from '@/requests';
import type { SamlPreferences } from './samlPreferences';
export declare namespace SamlConfiguration {

View file

@ -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>`;
}