mirror of
https://github.com/n8n-io/n8n.git
synced 2026-08-30 18:01:23 +08:00
feat(core): Remove n8n packages license check (#32317)
This commit is contained in:
@@ -45,7 +45,6 @@ export const LICENSE_FEATURES = {
|
||||
PERSONAL_SPACE_POLICY: 'feat:personalSpacePolicy',
|
||||
TOKEN_EXCHANGE: 'feat:tokenExchange',
|
||||
DATA_REDACTION: 'feat:dataRedaction',
|
||||
N8N_PACKAGES: 'feat:n8nPackages',
|
||||
OTEL_CUSTOM_SPAN_ATTRIBUTES: 'feat:otel:customSpanAttributes',
|
||||
} as const;
|
||||
|
||||
|
||||
@@ -132,7 +132,6 @@ export class E2EController {
|
||||
[LICENSE_FEATURES.PERSONAL_SPACE_POLICY]: false,
|
||||
[LICENSE_FEATURES.TOKEN_EXCHANGE]: false,
|
||||
[LICENSE_FEATURES.DATA_REDACTION]: false,
|
||||
[LICENSE_FEATURES.N8N_PACKAGES]: false,
|
||||
[LICENSE_FEATURES.OTEL_CUSTOM_SPAN_ATTRIBUTES]: false,
|
||||
};
|
||||
|
||||
|
||||
@@ -49,10 +49,6 @@ describe('n8n-packages export', () => {
|
||||
.getControllerMetadata(N8nPackagesController as never)
|
||||
.routes.get('exportWorkflows');
|
||||
|
||||
it('is gated by the feat:n8nPackages license', () => {
|
||||
expect(route?.licenseFeature).toBe('feat:n8nPackages');
|
||||
});
|
||||
|
||||
it('has no @ProjectScope or @GlobalScope decorator', () => {
|
||||
expect(route?.accessScope).toBeUndefined();
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ExportWorkflowsRequestDto } from '@n8n/api-types';
|
||||
import { AuthenticatedRequest } from '@n8n/db';
|
||||
import { Body, Licensed, Post, RestController } from '@n8n/decorators';
|
||||
import { Body, Post, RestController } from '@n8n/decorators';
|
||||
import type { Response } from 'express';
|
||||
import type { Readable } from 'node:stream';
|
||||
|
||||
@@ -11,7 +11,6 @@ export class N8nPackagesController {
|
||||
constructor(private readonly packagesService: N8nPackagesService) {}
|
||||
|
||||
@Post('/export')
|
||||
@Licensed('feat:n8nPackages')
|
||||
async exportWorkflows(
|
||||
req: AuthenticatedRequest,
|
||||
res: Response,
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import { LICENSE_FEATURES } from '@n8n/constants';
|
||||
import type { ModuleInterface } from '@n8n/decorators';
|
||||
import { BackendModule } from '@n8n/decorators';
|
||||
|
||||
@BackendModule({
|
||||
name: 'n8n-packages',
|
||||
licenseFlag: LICENSE_FEATURES.N8N_PACKAGES,
|
||||
})
|
||||
export class N8nPackagesModule implements ModuleInterface {
|
||||
async init() {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { ExportWorkflowsRequestDto, ImportPackageRequestDto } from '@n8n/api-types';
|
||||
import { GlobalConfig } from '@n8n/config';
|
||||
import { LICENSE_FEATURES } from '@n8n/constants';
|
||||
import type { AuthenticatedRequest } from '@n8n/db';
|
||||
import { Container } from '@n8n/di';
|
||||
import type { Response } from 'express';
|
||||
@@ -12,7 +11,7 @@ import { N8nPackagesService } from '@/modules/n8n-packages/n8n-packages.service'
|
||||
|
||||
import type { PackageRequest } from '../../../types';
|
||||
import type { PublicAPIEndpoint } from '../../shared/handler.types';
|
||||
import { isLicensed, publicApiScope } from '../../shared/middlewares/global.middleware';
|
||||
import { publicApiScope } from '../../shared/middlewares/global.middleware';
|
||||
|
||||
type ExportWorkflowsRequest = AuthenticatedRequest<{}, {}, { workflowIds: string[] }>;
|
||||
|
||||
@@ -27,7 +26,6 @@ type N8nPackagesHandlers = {
|
||||
|
||||
const n8nPackagesHandlers: N8nPackagesHandlers = {
|
||||
exportWorkflows: [
|
||||
isLicensed(LICENSE_FEATURES.N8N_PACKAGES),
|
||||
publicApiScope('workflow:export'),
|
||||
async (req, res) => {
|
||||
if (!Container.get(GlobalConfig).publicApi.packagesEnabled) {
|
||||
@@ -59,7 +57,6 @@ const n8nPackagesHandlers: N8nPackagesHandlers = {
|
||||
},
|
||||
],
|
||||
importPackage: [
|
||||
isLicensed(LICENSE_FEATURES.N8N_PACKAGES),
|
||||
publicApiScope('workflow:import'),
|
||||
async (req, res) => {
|
||||
if (!Container.get(GlobalConfig).publicApi.packagesEnabled) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { mockInstance, testDb } from '@n8n/backend-test-utils';
|
||||
import { CredentialTypes } from '@/credential-types';
|
||||
import { GlobalConfig } from '@n8n/config';
|
||||
import { LICENSE_FEATURES } from '@n8n/constants';
|
||||
import type { Project, User } from '@n8n/db';
|
||||
import { ProjectRepository } from '@n8n/db';
|
||||
import { Container } from '@n8n/di';
|
||||
@@ -40,7 +39,6 @@ beforeAll(async () => {
|
||||
beforeEach(async () => {
|
||||
await testDb.truncate(['WorkflowEntity', 'SharedWorkflow']);
|
||||
authOwnerAgent = testServer.publicApiAgentFor(owner);
|
||||
testServer.license.enable(LICENSE_FEATURES.N8N_PACKAGES);
|
||||
Container.get(GlobalConfig).publicApi.packagesEnabled = true;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user