refactor(core): Use an IoC container to manage singleton classes [Part-2] (no-changelog) (#5690)
* use typedi for UserManagementMailer * use typedi for SamlService * fix typos * use typedi for Queue * use typedi for License * convert some more code to use typedi
This commit is contained in:
committed by
GitHub
parent
c07f838ce6
commit
9bd7529193
@@ -1,4 +1,5 @@
|
||||
import type express from 'express';
|
||||
import { Service } from 'typedi';
|
||||
import * as Db from '@/Db';
|
||||
import type { User } from '@/databases/entities/User';
|
||||
import { jsonParse, LoggerProxy } from 'n8n-workflow';
|
||||
@@ -26,9 +27,8 @@ import type { SamlLoginBinding } from './types';
|
||||
import type { BindingContext, PostBindingContext } from 'samlify/types/src/entity';
|
||||
import { validateMetadata, validateResponse } from './samlValidator';
|
||||
|
||||
@Service()
|
||||
export class SamlService {
|
||||
private static instance: SamlService;
|
||||
|
||||
private identityProviderInstance: IdentityProviderInstance | undefined;
|
||||
|
||||
private _samlPreferences: SamlPreferences = {
|
||||
@@ -65,13 +65,6 @@ export class SamlService {
|
||||
};
|
||||
}
|
||||
|
||||
static getInstance(): SamlService {
|
||||
if (!SamlService.instance) {
|
||||
SamlService.instance = new SamlService();
|
||||
}
|
||||
return SamlService.instance;
|
||||
}
|
||||
|
||||
async init(): Promise<void> {
|
||||
await this.loadFromDbAndApplySamlPreferences();
|
||||
setSchemaValidator({
|
||||
|
||||
Reference in New Issue
Block a user