mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(core): Stop enforcing max numbers of API keys limit (no-changelog) (#13631)
This commit is contained in:
@@ -4,7 +4,6 @@ import { Container } from '@n8n/di';
|
||||
|
||||
import type { User } from '@/databases/entities/user';
|
||||
import { ApiKeyRepository } from '@/databases/repositories/api-key.repository';
|
||||
import { License } from '@/license';
|
||||
import { PublicApiKeyService } from '@/services/public-api-key.service';
|
||||
import { mockInstance } from '@test/mocking';
|
||||
|
||||
@@ -14,10 +13,6 @@ import * as testDb from './shared/test-db';
|
||||
import type { SuperAgentTest } from './shared/types';
|
||||
import * as utils from './shared/utils/';
|
||||
|
||||
const license = mockInstance(License);
|
||||
|
||||
license.getApiKeysPerUserLimit.mockImplementation(() => 2);
|
||||
|
||||
const testServer = utils.setupTestServer({ endpointGroups: ['apiKeys'] });
|
||||
let publicApiKeyService: PublicApiKeyService;
|
||||
|
||||
@@ -119,17 +114,6 @@ describe('Owner shell', () => {
|
||||
expect(newApiKey.rawApiKey).toBeDefined();
|
||||
});
|
||||
|
||||
test('POST /api-keys should fail if max number of API keys reached', async () => {
|
||||
await testServer.authAgentFor(ownerShell).post('/api-keys').send({ label: 'My API Key' });
|
||||
|
||||
const secondApiKey = await testServer
|
||||
.authAgentFor(ownerShell)
|
||||
.post('/api-keys')
|
||||
.send({ label: 'My API Key' });
|
||||
|
||||
expect(secondApiKey.statusCode).toBe(400);
|
||||
});
|
||||
|
||||
test('GET /api-keys should fetch the api key redacted', async () => {
|
||||
const expirationDateInTheFuture = Date.now() + 1000;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user