refactor(core): Mark all backend Enterprise Edition files and dirs (#12350)
Some checks failed
Test Master / install-and-build (push) Has been cancelled
Test Master / Unit tests (18.x) (push) Has been cancelled
Test Master / Unit tests (20.x) (push) Has been cancelled
Test Master / Unit tests (22.4) (push) Has been cancelled
Test Master / Lint (push) Has been cancelled
Test Master / Notify Slack on failure (push) Has been cancelled

This commit is contained in:
Iván Ovejero 2024-12-24 13:02:05 +01:00 committed by GitHub
parent 471d7b9420
commit f754b22a3f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
194 changed files with 161 additions and 153 deletions

View file

@ -3,9 +3,11 @@
Portions of this software are licensed as follows:
- Content of branches other than the main branch (i.e. "master") are not licensed.
- Source code files that contain ".ee." in their filename are NOT licensed under the Sustainable Use License.
To use source code files that contain ".ee." in their filename you must hold a valid n8n Enterprise License
specifically allowing you access to such source code files and as defined in "LICENSE_EE.md".
- Source code files that contain ".ee." in their filename or ".ee" in their dirname are NOT licensed under
the Sustainable Use License.
To use source code files that contain ".ee." in their filename or ".ee" in their dirname you must hold a
valid n8n Enterprise License specifically allowing you access to such source code files and as defined
in "LICENSE_EE.md".
- All third party components incorporated into the n8n Software are licensed under the original license
provided by the owner of the applicable component.
- Content outside of the above mentioned files or restrictions is available under the "Sustainable Use

View file

@ -1,4 +1,4 @@
import type { Scope, ScopeLevels, GlobalScopes, MaskLevels } from './types';
import type { Scope, ScopeLevels, GlobalScopes, MaskLevels } from './types.ee';
export function combineScopes(userScopes: GlobalScopes, masks?: MaskLevels): Set<Scope>;
export function combineScopes(userScopes: ScopeLevels, masks?: MaskLevels): Set<Scope>;

View file

@ -1,5 +1,5 @@
import { combineScopes } from './combineScopes';
import type { Scope, ScopeLevels, GlobalScopes, ScopeOptions, MaskLevels } from './types';
import { combineScopes } from './combineScopes.ee';
import type { Scope, ScopeLevels, GlobalScopes, ScopeOptions, MaskLevels } from './types.ee';
export function hasScope(
scope: Scope | Scope[],

View file

@ -1,4 +1,4 @@
export type * from './types';
export * from './constants';
export * from './hasScope';
export * from './combineScopes';
export type * from './types.ee';
export * from './constants.ee';
export * from './hasScope.ee';
export * from './combineScopes.ee';

View file

@ -1,4 +1,4 @@
import type { RESOURCES } from './constants';
import type { RESOURCES } from './constants.ee';
export type Resource = keyof typeof RESOURCES;

View file

@ -1,5 +1,5 @@
import { hasScope } from '@/hasScope';
import type { Scope } from '@/types';
import { hasScope } from '@/hasScope.ee';
import type { Scope } from '@/types.ee';
const ownerPermissions: Scope[] = [
'workflow:create',

View file

@ -15,10 +15,10 @@ import { CredentialsHelper } from '@/credentials-helper';
import type { WorkflowEntity } from '@/databases/entities/workflow-entity';
import { ExecutionRepository } from '@/databases/repositories/execution.repository';
import { WorkflowRepository } from '@/databases/repositories/workflow.repository';
import { VariablesService } from '@/environments/variables/variables.service.ee';
import { VariablesService } from '@/environments.ee/variables/variables.service.ee';
import { EventService } from '@/events/event.service';
import { ExternalHooks } from '@/external-hooks';
import { SecretsHelper } from '@/secrets-helpers';
import { SecretsHelper } from '@/secrets-helpers.ee';
import { WorkflowStatisticsService } from '@/services/workflow-statistics.service';
import { SubworkflowPolicyChecker } from '@/subworkflows/subworkflow-policy-checker.service';
import { Telemetry } from '@/telemetry';

View file

@ -4,7 +4,7 @@ import type { User } from '@/databases/entities/user';
import { UserRepository } from '@/databases/repositories/user.repository';
import { AuthError } from '@/errors/response-errors/auth.error';
import { EventService } from '@/events/event.service';
import { isLdapLoginEnabled } from '@/ldap/helpers.ee';
import { isLdapLoginEnabled } from '@/ldap.ee/helpers.ee';
import { PasswordUtility } from '@/services/password.utility';
export const handleEmailLogin = async (

View file

@ -10,8 +10,8 @@ import {
mapLdapAttributesToUser,
createLdapAuthIdentity,
updateLdapUserOnLocalDb,
} from '@/ldap/helpers.ee';
import { LdapService } from '@/ldap/ldap.service.ee';
} from '@/ldap.ee/helpers.ee';
import { LdapService } from '@/ldap.ee/ldap.service.ee';
export const handleLdapLogin = async (
loginId: string,

View file

@ -23,13 +23,13 @@ import { MessageEventBus } from '@/eventbus/message-event-bus/message-event-bus'
import { TelemetryEventRelay } from '@/events/relays/telemetry.event-relay';
import { initExpressionEvaluator } from '@/expression-evaluator';
import { ExternalHooks } from '@/external-hooks';
import { ExternalSecretsManager } from '@/external-secrets/external-secrets-manager.ee';
import { ExternalSecretsManager } from '@/external-secrets.ee/external-secrets-manager.ee';
import { License } from '@/license';
import { LoadNodesAndCredentials } from '@/load-nodes-and-credentials';
import { NodeTypes } from '@/node-types';
import { PostHogClient } from '@/posthog';
import { ShutdownService } from '@/shutdown/shutdown.service';
import { WorkflowHistoryManager } from '@/workflows/workflow-history/workflow-history-manager.ee';
import { WorkflowHistoryManager } from '@/workflows/workflow-history.ee/workflow-history-manager.ee';
export abstract class BaseCommand extends Command {
protected logger = Container.get(Logger);

View file

@ -14,7 +14,7 @@ import { SettingsRepository } from '@/databases/repositories/settings.repository
import { SharedCredentialsRepository } from '@/databases/repositories/shared-credentials.repository';
import { SharedWorkflowRepository } from '@/databases/repositories/shared-workflow.repository';
import { UserRepository } from '@/databases/repositories/user.repository';
import { LDAP_DEFAULT_CONFIGURATION, LDAP_FEATURE_NAME } from '@/ldap/constants';
import { LDAP_DEFAULT_CONFIGURATION, LDAP_FEATURE_NAME } from '@/ldap.ee/constants';
import { WorkflowService } from '@/workflows/workflow.service';
import { BaseCommand } from '../base-command';

View file

@ -4,7 +4,7 @@ import type { User } from '@/databases/entities/user';
import type { UserRepository } from '@/databases/repositories/user.repository';
import type { EventService } from '@/events/event.service';
import type { AuthenticatedRequest } from '@/requests';
import type { ProjectService } from '@/services/project.service';
import type { ProjectService } from '@/services/project.service.ee';
import { UsersController } from '../users.controller';

View file

@ -23,7 +23,7 @@ import {
getCurrentAuthenticationMethod,
isLdapCurrentAuthenticationMethod,
isSamlCurrentAuthenticationMethod,
} from '@/sso/sso-helpers';
} from '@/sso.ee/sso-helpers';
@RestController()
export class AuthController {

View file

@ -17,7 +17,7 @@ import { PostHogClient } from '@/posthog';
import { UserRequest } from '@/requests';
import { PasswordUtility } from '@/services/password.utility';
import { UserService } from '@/services/user.service';
import { isSamlLicensedAndEnabled } from '@/sso/saml/saml-helpers';
import { isSamlLicensedAndEnabled } from '@/sso.ee/saml/saml-helpers';
@RestController('/invitations')
export class InvitationController {

View file

@ -21,7 +21,7 @@ import { MfaService } from '@/mfa/mfa.service';
import { AuthenticatedRequest, MeRequest } from '@/requests';
import { PasswordUtility } from '@/services/password.utility';
import { UserService } from '@/services/user.service';
import { isSamlLicensedAndEnabled } from '@/sso/saml/saml-helpers';
import { isSamlLicensedAndEnabled } from '@/sso.ee/saml/saml-helpers';
import { PersonalizationSurveyAnswersV4 } from './survey-answers.dto';
@RestController('/me')

View file

@ -13,12 +13,12 @@ import type { CredentialsEntity } from '@/databases/entities/credentials-entity'
import type { User } from '@/databases/entities/user';
import { CredentialsRepository } from '@/databases/repositories/credentials.repository';
import { SharedCredentialsRepository } from '@/databases/repositories/shared-credentials.repository';
import { VariablesService } from '@/environments/variables/variables.service.ee';
import { VariablesService } from '@/environments.ee/variables/variables.service.ee';
import { BadRequestError } from '@/errors/response-errors/bad-request.error';
import { NotFoundError } from '@/errors/response-errors/not-found.error';
import { ExternalHooks } from '@/external-hooks';
import type { OAuthRequest } from '@/requests';
import { SecretsHelper } from '@/secrets-helpers';
import { SecretsHelper } from '@/secrets-helpers.ee';
import { mockInstance } from '@test/mocking';
describe('OAuth1CredentialController', () => {

View file

@ -13,12 +13,12 @@ import type { CredentialsEntity } from '@/databases/entities/credentials-entity'
import type { User } from '@/databases/entities/user';
import { CredentialsRepository } from '@/databases/repositories/credentials.repository';
import { SharedCredentialsRepository } from '@/databases/repositories/shared-credentials.repository';
import { VariablesService } from '@/environments/variables/variables.service.ee';
import { VariablesService } from '@/environments.ee/variables/variables.service.ee';
import { BadRequestError } from '@/errors/response-errors/bad-request.error';
import { NotFoundError } from '@/errors/response-errors/not-found.error';
import { ExternalHooks } from '@/external-hooks';
import type { OAuthRequest } from '@/requests';
import { SecretsHelper } from '@/secrets-helpers';
import { SecretsHelper } from '@/secrets-helpers.ee';
import { mockInstance } from '@test/mocking';
describe('OAuth2CredentialController', () => {

View file

@ -18,7 +18,7 @@ import { MfaService } from '@/mfa/mfa.service';
import { PasswordResetRequest } from '@/requests';
import { PasswordUtility } from '@/services/password.utility';
import { UserService } from '@/services/user.service';
import { isSamlCurrentAuthenticationMethod } from '@/sso/sso-helpers';
import { isSamlCurrentAuthenticationMethod } from '@/sso.ee/sso-helpers';
import { UserManagementMailer } from '@/user-management/email';
@RestController()

View file

@ -23,7 +23,7 @@ import {
ProjectService,
TeamProjectOverQuotaError,
UnlicensedProjectRoleError,
} from '@/services/project.service';
} from '@/services/project.service.ee';
import { RoleService } from '@/services/role.service';
@RestController('/projects')

View file

@ -21,7 +21,7 @@ import { ExternalHooks } from '@/external-hooks';
import type { PublicUser } from '@/interfaces';
import { listQueryMiddleware } from '@/middlewares';
import { AuthenticatedRequest, ListQuery, UserRequest } from '@/requests';
import { ProjectService } from '@/services/project.service';
import { ProjectService } from '@/services/project.service.ee';
import { UserService } from '@/services/user.service';
import { WorkflowService } from '@/workflows/workflow.service';

View file

@ -11,7 +11,7 @@ import { SharedCredentialsRepository } from '@/databases/repositories/shared-cre
import { NotFoundError } from '@/errors/response-errors/not-found.error';
import { TransferCredentialError } from '@/errors/response-errors/transfer-credential.error';
import { OwnershipService } from '@/services/ownership.service';
import { ProjectService } from '@/services/project.service';
import { ProjectService } from '@/services/project.service.ee';
import { RoleService } from '@/services/role.service';
import { CredentialsService } from './credentials.service';

View file

@ -33,11 +33,11 @@ import { NotFoundError } from '@/errors/response-errors/not-found.error';
import { ExternalHooks } from '@/external-hooks';
import { validateEntity } from '@/generic-helpers';
import type { ICredentialsDb } from '@/interfaces';
import { userHasScopes } from '@/permissions/check-access';
import { userHasScopes } from '@/permissions.ee/check-access';
import type { CredentialRequest, ListQuery } from '@/requests';
import { CredentialsTester } from '@/services/credentials-tester.service';
import { OwnershipService } from '@/services/ownership.service';
import { ProjectService } from '@/services/project.service';
import { ProjectService } from '@/services/project.service.ee';
import { RoleService } from '@/services/role.service';
export type CredentialsGetSharedOptions =

View file

@ -18,7 +18,7 @@ import {
GLOBAL_OWNER_SCOPES,
GLOBAL_MEMBER_SCOPES,
GLOBAL_ADMIN_SCOPES,
} from '@/permissions/global-roles';
} from '@/permissions.ee/global-roles';
import { NoUrl } from '@/validators/no-url.validator';
import { NoXss } from '@/validators/no-xss.validator';

View file

@ -1,5 +1,5 @@
import type { MigrationContext, ReversibleMigration } from '@/databases/types';
import { LDAP_DEFAULT_CONFIGURATION, LDAP_FEATURE_NAME } from '@/ldap/constants';
import { LDAP_DEFAULT_CONFIGURATION, LDAP_FEATURE_NAME } from '@/ldap.ee/constants';
export class CreateLdapEntities1674509946020 implements ReversibleMigration {
async up({ escape, dbType, isMysql, runQuery }: MigrationContext) {

View file

@ -7,7 +7,7 @@ import type { CredentialsEntity } from '@/databases/entities/credentials-entity'
import { SharedCredentials } from '@/databases/entities/shared-credentials';
import type { User } from '@/databases/entities/user';
import { SharedCredentialsRepository } from '@/databases/repositories/shared-credentials.repository';
import { GLOBAL_MEMBER_SCOPES, GLOBAL_OWNER_SCOPES } from '@/permissions/global-roles';
import { GLOBAL_MEMBER_SCOPES, GLOBAL_OWNER_SCOPES } from '@/permissions.ee/global-roles';
import { mockEntityManager } from '@test/mocking';
describe('SharedCredentialsRepository', () => {

View file

@ -3,7 +3,7 @@ import { ErrorReporter } from 'n8n-core';
import { Service } from 'typedi';
import config from '@/config';
import { EXTERNAL_SECRETS_DB_KEY } from '@/external-secrets/constants';
import { EXTERNAL_SECRETS_DB_KEY } from '@/external-secrets.ee/constants';
import { Settings } from '../entities/settings';

View file

@ -11,7 +11,7 @@ import { inProduction, RESPONSE_ERROR_MESSAGES } from '@/constants';
import { UnauthenticatedError } from '@/errors/response-errors/unauthenticated.error';
import type { BooleanLicenseFeature } from '@/interfaces';
import { License } from '@/license';
import { userHasScopes } from '@/permissions/check-access';
import { userHasScopes } from '@/permissions.ee/check-access';
import type { AuthenticatedRequest } from '@/requests';
import { send } from '@/response-helper'; // TODO: move `ResponseHelper.send` to this file

View file

@ -6,7 +6,7 @@ import Container from 'typedi';
import {
SOURCE_CONTROL_SSH_FOLDER,
SOURCE_CONTROL_GIT_FOLDER,
} from '@/environments/source-control/constants';
} from '@/environments.ee/source-control/constants';
import {
generateSshKeyPair,
getRepoType,
@ -14,10 +14,10 @@ import {
getTrackingInformationFromPrePushResult,
getTrackingInformationFromPullResult,
sourceControlFoldersExistCheck,
} from '@/environments/source-control/source-control-helper.ee';
import { SourceControlPreferencesService } from '@/environments/source-control/source-control-preferences.service.ee';
import type { SourceControlPreferences } from '@/environments/source-control/types/source-control-preferences';
import type { SourceControlledFile } from '@/environments/source-control/types/source-controlled-file';
} from '@/environments.ee/source-control/source-control-helper.ee';
import { SourceControlPreferencesService } from '@/environments.ee/source-control/source-control-preferences.service.ee';
import type { SourceControlPreferences } from '@/environments.ee/source-control/types/source-control-preferences';
import type { SourceControlledFile } from '@/environments.ee/source-control/types/source-controlled-file';
import { License } from '@/license';
import { mockInstance } from '@test/mocking';

View file

@ -2,8 +2,8 @@ import { mock } from 'jest-mock-extended';
import { InstanceSettings } from 'n8n-core';
import { Container } from 'typedi';
import { SourceControlPreferencesService } from '@/environments/source-control/source-control-preferences.service.ee';
import { SourceControlService } from '@/environments/source-control/source-control.service.ee';
import { SourceControlPreferencesService } from '@/environments.ee/source-control/source-control-preferences.service.ee';
import { SourceControlService } from '@/environments.ee/source-control/source-control.service.ee';
describe('SourceControlService', () => {
const preferencesService = new SourceControlPreferencesService(

View file

@ -6,7 +6,7 @@ import { NotFoundError } from '@/errors/response-errors/not-found.error';
import {
testMetricCreateRequestBodySchema,
testMetricPatchRequestBodySchema,
} from '@/evaluation/metric.schema';
} from '@/evaluation.ee/metric.schema';
import { getSharedWorkflowIds } from '@/public-api/v1/handlers/workflows/workflows.service';
import { TestDefinitionService } from './test-definition.service.ee';

View file

@ -7,8 +7,8 @@ import { NotFoundError } from '@/errors/response-errors/not-found.error';
import {
testDefinitionCreateRequestBodySchema,
testDefinitionPatchRequestBodySchema,
} from '@/evaluation/test-definition.schema';
import { TestRunnerService } from '@/evaluation/test-runner/test-runner.service.ee';
} from '@/evaluation.ee/test-definition.schema';
import { TestRunnerService } from '@/evaluation.ee/test-runner/test-runner.service.ee';
import { listQueryMiddleware } from '@/middlewares';
import { getSharedWorkflowIds } from '@/public-api/v1/handlers/workflows/workflows.service';

View file

@ -1,7 +1,7 @@
import { TestRunRepository } from '@/databases/repositories/test-run.repository.ee';
import { Delete, Get, RestController } from '@/decorators';
import { NotFoundError } from '@/errors/response-errors/not-found.error';
import { TestRunsRequest } from '@/evaluation/test-definitions.types.ee';
import { TestRunsRequest } from '@/evaluation.ee/test-definitions.types.ee';
import { listQueryMiddleware } from '@/middlewares';
import { getSharedWorkflowIds } from '@/public-api/v1/handlers/workflows/workflows.service';

View file

@ -14,7 +14,7 @@ import type {
import Container from 'typedi';
import { CredentialsHelper } from '@/credentials-helper';
import * as SecretsHelpers from '@/external-secrets/external-secrets-helper.ee';
import * as SecretsHelpers from '@/external-secrets.ee/external-secrets-helper.ee';
import { MessageEventBusDestination } from './message-event-bus-destination.ee';
import { eventMessageGenericDestinationTestEvent } from '../event-message-classes/event-message-generic';

View file

@ -3,8 +3,8 @@ import { Cipher } from 'n8n-core';
import { Container } from 'typedi';
import { SettingsRepository } from '@/databases/repositories/settings.repository';
import { ExternalSecretsManager } from '@/external-secrets/external-secrets-manager.ee';
import { ExternalSecretsProviders } from '@/external-secrets/external-secrets-providers.ee';
import { ExternalSecretsManager } from '@/external-secrets.ee/external-secrets-manager.ee';
import { ExternalSecretsProviders } from '@/external-secrets.ee/external-secrets-providers.ee';
import type { ExternalSecretsSettings } from '@/interfaces';
import { License } from '@/license';
import {

View file

@ -3,7 +3,7 @@ import type { INodeProperties } from 'n8n-workflow';
import Container from 'typedi';
import { UnknownAuthTypeError } from '@/errors/unknown-auth-type.error';
import { DOCS_HELP_NOTICE, EXTERNAL_SECRETS_NAME_REGEX } from '@/external-secrets/constants';
import { DOCS_HELP_NOTICE, EXTERNAL_SECRETS_NAME_REGEX } from '@/external-secrets.ee/constants';
import type { SecretsProvider, SecretsProviderState } from '@/interfaces';
import { AwsSecretsClient } from './aws-secrets-client';

View file

@ -4,7 +4,7 @@ import { ensureError } from 'n8n-workflow';
import type { INodeProperties } from 'n8n-workflow';
import Container from 'typedi';
import { DOCS_HELP_NOTICE, EXTERNAL_SECRETS_NAME_REGEX } from '@/external-secrets/constants';
import { DOCS_HELP_NOTICE, EXTERNAL_SECRETS_NAME_REGEX } from '@/external-secrets.ee/constants';
import type { SecretsProvider, SecretsProviderState } from '@/interfaces';
import type { AzureKeyVaultContext } from './types';

Some files were not shown because too many files have changed in this diff Show more