feat(core): Convert saml controller to decorator style (#5653) (no-changelog)

This commit is contained in:
Michael Auerswald
2023-03-10 19:19:52 +01:00
committed by GitHub
parent 90afa5e55f
commit c6ba0bd8de
9 changed files with 180 additions and 173 deletions

View File

@@ -153,9 +153,8 @@ import {
isAdvancedExecutionFiltersEnabled,
} from './executions/executionHelpers';
import { getSamlLoginLabel, isSamlLoginEnabled, isSamlLicensed } from './sso/saml/samlHelpers';
import { samlControllerPublic } from './sso/saml/routes/saml.controller.public.ee';
import { SamlController } from './sso/saml/routes/saml.controller.ee';
import { SamlService } from './sso/saml/saml.service.ee';
import { samlControllerProtected } from './sso/saml/routes/saml.controller.protected.ee';
import { LdapManager } from './Ldap/LdapManager.ee';
const exec = promisify(callbackExec);
@@ -370,6 +369,7 @@ class Server extends AbstractServer {
const internalHooks = Container.get(InternalHooks);
const mailer = getMailerInstance();
const postHog = this.postHog;
const samlService = SamlService.getInstance();
const controllers: object[] = [
new AuthController({ config, internalHooks, repositories, logger, postHog }),
@@ -389,6 +389,7 @@ class Server extends AbstractServer {
logger,
postHog,
}),
new SamlController(samlService),
];
if (isLdapEnabled()) {
@@ -514,9 +515,6 @@ class Server extends AbstractServer {
}
}
this.app.use(`/${this.restEndpoint}/sso/saml`, samlControllerPublic);
this.app.use(`/${this.restEndpoint}/sso/saml`, samlControllerProtected);
// ----------------------------------------
// Returns parameter values which normally get loaded from an external API or
// get generated dynamically