Skip to content

Commit

Permalink
ci: Fix linting issues on master (no-changelog) (#5740)
Browse files Browse the repository at this point in the history
  • Loading branch information
netroy authored Mar 21, 2023
1 parent 469ce32 commit 34d7fcc
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 28 deletions.
2 changes: 1 addition & 1 deletion packages/cli/src/CommunityNodes/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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 = (
Expand Down
11 changes: 4 additions & 7 deletions packages/cli/src/sso/saml/routes/saml.controller.ee.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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 {
Expand Down Expand Up @@ -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') {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/sso/saml/types/requests.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { AuthenticatedRequest } from '../../../requests';
import type { AuthenticatedRequest } from '@/requests';
import type { SamlPreferences } from './samlPreferences';

export declare namespace SamlConfiguration {
Expand Down
12 changes: 0 additions & 12 deletions packages/cli/src/sso/saml/views/initSsoRedirect.ts

This file was deleted.

0 comments on commit 34d7fcc

Please sign in to comment.