mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
parent
fcac1ddd9f
commit
3a9c257f55
|
@ -513,6 +513,7 @@ export interface IN8nUISettings {
|
||||||
enterprise: {
|
enterprise: {
|
||||||
sharing: boolean;
|
sharing: boolean;
|
||||||
ldap: boolean;
|
ldap: boolean;
|
||||||
|
saml: boolean;
|
||||||
logStreaming: boolean;
|
logStreaming: boolean;
|
||||||
};
|
};
|
||||||
hideUsagePage: boolean;
|
hideUsagePage: boolean;
|
||||||
|
|
|
@ -102,6 +102,10 @@ export class License {
|
||||||
return this.isFeatureEnabled(LICENSE_FEATURES.LDAP);
|
return this.isFeatureEnabled(LICENSE_FEATURES.LDAP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isSamlEnabled() {
|
||||||
|
return this.isFeatureEnabled(LICENSE_FEATURES.SAML);
|
||||||
|
}
|
||||||
|
|
||||||
getCurrentEntitlements() {
|
getCurrentEntitlements() {
|
||||||
return this.manager?.getCurrentEntitlements() ?? [];
|
return this.manager?.getCurrentEntitlements() ?? [];
|
||||||
}
|
}
|
||||||
|
|
10
packages/cli/src/Saml/helpers.ts
Normal file
10
packages/cli/src/Saml/helpers.ts
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
import { getLicense } from '../License';
|
||||||
|
import { isUserManagementEnabled } from '../UserManagement/UserManagementHelper';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check whether the SAML feature is licensed and enabled in the instance
|
||||||
|
*/
|
||||||
|
export function isSamlEnabled(): boolean {
|
||||||
|
const license = getLicense();
|
||||||
|
return isUserManagementEnabled() && license.isSamlEnabled();
|
||||||
|
}
|
|
@ -145,6 +145,7 @@ import { AbstractServer } from './AbstractServer';
|
||||||
import { configureMetrics } from './metrics';
|
import { configureMetrics } from './metrics';
|
||||||
import { setupBasicAuth } from './middlewares/basicAuth';
|
import { setupBasicAuth } from './middlewares/basicAuth';
|
||||||
import { setupExternalJWTAuth } from './middlewares/externalJWTAuth';
|
import { setupExternalJWTAuth } from './middlewares/externalJWTAuth';
|
||||||
|
import { isSamlEnabled } from './Saml/helpers';
|
||||||
|
|
||||||
const exec = promisify(callbackExec);
|
const exec = promisify(callbackExec);
|
||||||
|
|
||||||
|
@ -275,6 +276,7 @@ class Server extends AbstractServer {
|
||||||
enterprise: {
|
enterprise: {
|
||||||
sharing: false,
|
sharing: false,
|
||||||
ldap: false,
|
ldap: false,
|
||||||
|
saml: false,
|
||||||
logStreaming: config.getEnv('enterprise.features.logStreaming'),
|
logStreaming: config.getEnv('enterprise.features.logStreaming'),
|
||||||
},
|
},
|
||||||
hideUsagePage: config.getEnv('hideUsagePage'),
|
hideUsagePage: config.getEnv('hideUsagePage'),
|
||||||
|
@ -303,6 +305,7 @@ class Server extends AbstractServer {
|
||||||
sharing: isSharingEnabled(),
|
sharing: isSharingEnabled(),
|
||||||
logStreaming: isLogStreamingEnabled(),
|
logStreaming: isLogStreamingEnabled(),
|
||||||
ldap: isLdapEnabled(),
|
ldap: isLdapEnabled(),
|
||||||
|
saml: isSamlEnabled(),
|
||||||
});
|
});
|
||||||
|
|
||||||
if (isLdapEnabled()) {
|
if (isLdapEnabled()) {
|
||||||
|
|
|
@ -985,6 +985,10 @@ export const schema = {
|
||||||
format: Boolean,
|
format: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
saml: {
|
||||||
|
format: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
logStreaming: {
|
logStreaming: {
|
||||||
format: Boolean,
|
format: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
|
|
|
@ -69,6 +69,7 @@ export const SETTINGS_LICENSE_CERT_KEY = 'license.cert';
|
||||||
export enum LICENSE_FEATURES {
|
export enum LICENSE_FEATURES {
|
||||||
SHARING = 'feat:sharing',
|
SHARING = 'feat:sharing',
|
||||||
LDAP = 'feat:ldap',
|
LDAP = 'feat:ldap',
|
||||||
|
SAML = 'feat:saml',
|
||||||
LOG_STREAMING = 'feat:logStreaming',
|
LOG_STREAMING = 'feat:logStreaming',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue