mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
perf(core): Cache roles (#6803)
* refactor: Create `RoleService` * refactor: Refactor to use service * refactor: Move `getUserRoleForWorkflow` * refactor: Clear out old `RoleService` * refactor: Consolidate utils into service * refactor: Remove unused methods * test: Add tests * refactor: Remove redundant return types * refactor: Missing utility * chore: Remove commented out bit * refactor: Make `Db.collections.Repository` inaccessible * chore: Cleanup * feat: Prepopulate cache * chore: Remove logging * fix: Account for tests where roles are undefined * fix: Restore `prettier.prettierPath` * test: Account for cache enabled and disabled * fix: Restore `Role` in `Db.collections` * refactor: Simplify by removing `orFail` * refactor: Rename for clarity * refactor: Use `cacheKey` for readability * refactor: Validate role before creation * refacator: Remove redundant `cache` prefix * ci: Lint fix * test: Fix e2e
This commit is contained in:
@@ -50,6 +50,7 @@ import { AUTHLESS_ENDPOINTS, PUBLIC_API_REST_PATH_SEGMENT, REST_PATH_SEGMENT } f
|
||||
import type { EndpointGroup, SetupProps, TestServer } from '../types';
|
||||
import { mockInstance } from './mocking';
|
||||
import { JwtService } from '@/services/jwt.service';
|
||||
import { RoleService } from '@/services/role.service';
|
||||
|
||||
/**
|
||||
* Plugin to prefix a path segment into a request URL pathname.
|
||||
@@ -264,6 +265,7 @@ export const setupTestServer = ({
|
||||
activeWorkflowRunner: Container.get(ActiveWorkflowRunner),
|
||||
logger,
|
||||
jwtService,
|
||||
roleService: Container.get(RoleService),
|
||||
}),
|
||||
);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user