From 0b5ac19d9a672e69e8e604aa107be3f55efea420 Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Thu, 11 Jan 2024 15:08:59 +0530 Subject: [PATCH] chore: align the system user defined in `core.ts` with the one created in the migration (#5845) This change adjusts the exported `SYSTEM_USER` constant in `core.ts` to match the one created in the migration in `src/migrations/20231222071533-unleash-system-user.js` The slight discrepancy between these two caused me some minor headache when trying to write a test in enterprise. It also removes the email because we have no inbox at that address (and we probably don't want one). For reference, the migration looks like this: ``` sql ALTER TABLE users ADD COLUMN IF NOT EXISTS is_system BOOLEAN NOT NULL DEFAULT FALSE; INSERT INTO users (id, name, username, email, created_by_user_id, is_system) VALUES (-1337, 'Unleash System', 'unleash_system_user', 'system@getunleash.io', -1337, true); ``` --- src/lib/types/core.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/types/core.ts b/src/lib/types/core.ts index 1475d07972..09b2b14c99 100644 --- a/src/lib/types/core.ts +++ b/src/lib/types/core.ts @@ -22,12 +22,14 @@ export interface IUnleash { version: string; } +// Used by unleash internally for performing system actions that have +// no user export const SYSTEM_USER: IUser = { - email: 'systemuser@getunleash.io', + email: '', id: -1337, imageUrl: '', isAPI: false, - name: 'Used by unleash internally for performing system actions that have no user', + name: 'Unleash System', permissions: [], username: 'unleash_system_user', };