ToolJet/server/test/controllers/org_environment_variables.e2e-spec.ts

313 lines
11 KiB
TypeScript
Raw Normal View History

[Feature] Organisation level environment variables 🚀 (#3068) * Added new page for env vars * Changed a field name * Added some backend files - Entity, Dto, services * Started working with api endpoints - implmented create - added ability * Added fields validation - Added env variables into module * Added update, delete, get apis - Also implemented delete feature in frontend * Implemented update operation on frontend - Solved an api problem * Added encryption * Added encryption to update operation - Exposed env vars to editor - working on viewer * Exposed env vars in viewer also - Resolved a bug * Updated edit & delete icon sizes * Added specs - Resolved issues that occurred while testing * removed logout code * Changed api endpoint * splitted page into 3 different parts, Form & table * Now, non-admin users can see all org env vars * Resolved divider missing issue * Added variable_type field * Now secret server values will be shown as 'SecureValue' * Now you can't update variable_type * Now server will resolve the secret env values * Resolved variable name issue * Added unique constraints * Resolved some frontend bugs * Changed error text * Fixed failing specs * Added group permissions for org env vars * Added permission checking in the backend * Implemented permission checking in the frontend * Edited spec for new changes * Changed some specs and fixed failing specs * Resolved failing case that showed up after merging with the latest develop * Added default admin seed permissions * Refactored some code * Changed value to organization_id * Fixed a bug * Resolved a failing case * Resolved PR changes - Changed permission name - Changed column type to enum - Fixed some errors - Refactored the code * minor code change * added scope * Fixed: hide table when 0 no of vars available * Fixed table dark theme issues * Fixed encryption switch style * Fixed failing cases and updated a spec * Added %% for environment variables * Added code to resolve single variable * Fixed multi-variable usage * resolved an issue * removed extra divider * Suggestions will also show up for %% too * now, suggestions dropdown will only show env variables results * env vars suggestions will not be included in js search results * You can't resolve env variables from js code - Also, we can't resolve js code from env variable enclosures * added an info text * Resolved variables issue * fixed Viewer issue * Resolved a bug - client variable was not working on query preview and run actions * Update error message while using server variable on canvas * Revert "Update error message while using server variable on canvas" This reverts commit 081e1c9e295509a2db1010ddce0841c60e57387a. * Resolved all PR changes - removed prefix 'environmentVariable' - redefined variable evaluation - removed environmentVariable object from inspector - fixed a small bug * Fixed a server side issue Co-authored-by: Sherfin Shamsudeen <sherfin94@gmail.com>
2022-07-01 10:50:37 +00:00
/* eslint-disable @typescript-eslint/no-unused-vars */
import * as request from 'supertest';
import { INestApplication } from '@nestjs/common';
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
import { clearDB, createUser, createNestAppInstance, createGroupPermission, authenticateUser } from '../test.helper';
[Feature] Organisation level environment variables 🚀 (#3068) * Added new page for env vars * Changed a field name * Added some backend files - Entity, Dto, services * Started working with api endpoints - implmented create - added ability * Added fields validation - Added env variables into module * Added update, delete, get apis - Also implemented delete feature in frontend * Implemented update operation on frontend - Solved an api problem * Added encryption * Added encryption to update operation - Exposed env vars to editor - working on viewer * Exposed env vars in viewer also - Resolved a bug * Updated edit & delete icon sizes * Added specs - Resolved issues that occurred while testing * removed logout code * Changed api endpoint * splitted page into 3 different parts, Form & table * Now, non-admin users can see all org env vars * Resolved divider missing issue * Added variable_type field * Now secret server values will be shown as 'SecureValue' * Now you can't update variable_type * Now server will resolve the secret env values * Resolved variable name issue * Added unique constraints * Resolved some frontend bugs * Changed error text * Fixed failing specs * Added group permissions for org env vars * Added permission checking in the backend * Implemented permission checking in the frontend * Edited spec for new changes * Changed some specs and fixed failing specs * Resolved failing case that showed up after merging with the latest develop * Added default admin seed permissions * Refactored some code * Changed value to organization_id * Fixed a bug * Resolved a failing case * Resolved PR changes - Changed permission name - Changed column type to enum - Fixed some errors - Refactored the code * minor code change * added scope * Fixed: hide table when 0 no of vars available * Fixed table dark theme issues * Fixed encryption switch style * Fixed failing cases and updated a spec * Added %% for environment variables * Added code to resolve single variable * Fixed multi-variable usage * resolved an issue * removed extra divider * Suggestions will also show up for %% too * now, suggestions dropdown will only show env variables results * env vars suggestions will not be included in js search results * You can't resolve env variables from js code - Also, we can't resolve js code from env variable enclosures * added an info text * Resolved variables issue * fixed Viewer issue * Resolved a bug - client variable was not working on query preview and run actions * Update error message while using server variable on canvas * Revert "Update error message while using server variable on canvas" This reverts commit 081e1c9e295509a2db1010ddce0841c60e57387a. * Resolved all PR changes - removed prefix 'environmentVariable' - redefined variable evaluation - removed environmentVariable object from inspector - fixed a small bug * Fixed a server side issue Co-authored-by: Sherfin Shamsudeen <sherfin94@gmail.com>
2022-07-01 10:50:37 +00:00
import { getManager } from 'typeorm';
import { GroupPermission } from 'src/entities/group_permission.entity';
import { OrgEnvironmentVariable } from 'src/entities/org_envirnoment_variable.entity';
const createVariable = async (app: INestApplication, adminUserData: any, body: any) => {
return await request(app.getHttpServer())
.post(`/api/organization-variables/`)
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
.set('tj-workspace-id', adminUserData.user.defaultOrganizationId)
.set('Cookie', adminUserData['tokenCookie'])
[Feature] Organisation level environment variables 🚀 (#3068) * Added new page for env vars * Changed a field name * Added some backend files - Entity, Dto, services * Started working with api endpoints - implmented create - added ability * Added fields validation - Added env variables into module * Added update, delete, get apis - Also implemented delete feature in frontend * Implemented update operation on frontend - Solved an api problem * Added encryption * Added encryption to update operation - Exposed env vars to editor - working on viewer * Exposed env vars in viewer also - Resolved a bug * Updated edit & delete icon sizes * Added specs - Resolved issues that occurred while testing * removed logout code * Changed api endpoint * splitted page into 3 different parts, Form & table * Now, non-admin users can see all org env vars * Resolved divider missing issue * Added variable_type field * Now secret server values will be shown as 'SecureValue' * Now you can't update variable_type * Now server will resolve the secret env values * Resolved variable name issue * Added unique constraints * Resolved some frontend bugs * Changed error text * Fixed failing specs * Added group permissions for org env vars * Added permission checking in the backend * Implemented permission checking in the frontend * Edited spec for new changes * Changed some specs and fixed failing specs * Resolved failing case that showed up after merging with the latest develop * Added default admin seed permissions * Refactored some code * Changed value to organization_id * Fixed a bug * Resolved a failing case * Resolved PR changes - Changed permission name - Changed column type to enum - Fixed some errors - Refactored the code * minor code change * added scope * Fixed: hide table when 0 no of vars available * Fixed table dark theme issues * Fixed encryption switch style * Fixed failing cases and updated a spec * Added %% for environment variables * Added code to resolve single variable * Fixed multi-variable usage * resolved an issue * removed extra divider * Suggestions will also show up for %% too * now, suggestions dropdown will only show env variables results * env vars suggestions will not be included in js search results * You can't resolve env variables from js code - Also, we can't resolve js code from env variable enclosures * added an info text * Resolved variables issue * fixed Viewer issue * Resolved a bug - client variable was not working on query preview and run actions * Update error message while using server variable on canvas * Revert "Update error message while using server variable on canvas" This reverts commit 081e1c9e295509a2db1010ddce0841c60e57387a. * Resolved all PR changes - removed prefix 'environmentVariable' - redefined variable evaluation - removed environmentVariable object from inspector - fixed a small bug * Fixed a server side issue Co-authored-by: Sherfin Shamsudeen <sherfin94@gmail.com>
2022-07-01 10:50:37 +00:00
.send(body);
};
describe('organization environment variables controller', () => {
let app: INestApplication;
beforeEach(async () => {
await clearDB();
});
beforeAll(async () => {
app = await createNestAppInstance();
});
describe('GET /api/organization-variables', () => {
it('should allow only authenticated users to list org users', async () => {
await request(app.getHttpServer()).get('/api/organization-variables/').expect(401);
});
it('should list decrypted organization environment variables', async () => {
const adminUserData = await createUser(app, {
email: 'admin@tooljet.io',
groups: ['admin', 'all_users'],
});
const organization = adminUserData.organization;
const developerUserData = await createUser(app, {
email: 'developer@tooljet.io',
groups: ['developer', 'all_users'],
organization,
});
const viewerUserData = await createUser(app, {
email: 'viewer@tooljet.io',
groups: ['viewer', 'all_users'],
organization,
});
const bodyArray = [
{
variable_name: 'email',
variable_type: 'server',
value: 'test@tooljet.io',
encrypted: true,
},
{
variable_name: 'name',
variable_type: 'client',
value: 'demo_user',
encrypted: false,
},
];
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
let loggedUser = await authenticateUser(app);
adminUserData['tokenCookie'] = loggedUser.tokenCookie;
loggedUser = await authenticateUser(app, 'developer@tooljet.io');
developerUserData['tokenCookie'] = loggedUser.tokenCookie;
loggedUser = await authenticateUser(app, 'viewer@tooljet.io');
viewerUserData['tokenCookie'] = loggedUser.tokenCookie;
[Feature] Organisation level environment variables 🚀 (#3068) * Added new page for env vars * Changed a field name * Added some backend files - Entity, Dto, services * Started working with api endpoints - implmented create - added ability * Added fields validation - Added env variables into module * Added update, delete, get apis - Also implemented delete feature in frontend * Implemented update operation on frontend - Solved an api problem * Added encryption * Added encryption to update operation - Exposed env vars to editor - working on viewer * Exposed env vars in viewer also - Resolved a bug * Updated edit & delete icon sizes * Added specs - Resolved issues that occurred while testing * removed logout code * Changed api endpoint * splitted page into 3 different parts, Form & table * Now, non-admin users can see all org env vars * Resolved divider missing issue * Added variable_type field * Now secret server values will be shown as 'SecureValue' * Now you can't update variable_type * Now server will resolve the secret env values * Resolved variable name issue * Added unique constraints * Resolved some frontend bugs * Changed error text * Fixed failing specs * Added group permissions for org env vars * Added permission checking in the backend * Implemented permission checking in the frontend * Edited spec for new changes * Changed some specs and fixed failing specs * Resolved failing case that showed up after merging with the latest develop * Added default admin seed permissions * Refactored some code * Changed value to organization_id * Fixed a bug * Resolved a failing case * Resolved PR changes - Changed permission name - Changed column type to enum - Fixed some errors - Refactored the code * minor code change * added scope * Fixed: hide table when 0 no of vars available * Fixed table dark theme issues * Fixed encryption switch style * Fixed failing cases and updated a spec * Added %% for environment variables * Added code to resolve single variable * Fixed multi-variable usage * resolved an issue * removed extra divider * Suggestions will also show up for %% too * now, suggestions dropdown will only show env variables results * env vars suggestions will not be included in js search results * You can't resolve env variables from js code - Also, we can't resolve js code from env variable enclosures * added an info text * Resolved variables issue * fixed Viewer issue * Resolved a bug - client variable was not working on query preview and run actions * Update error message while using server variable on canvas * Revert "Update error message while using server variable on canvas" This reverts commit 081e1c9e295509a2db1010ddce0841c60e57387a. * Resolved all PR changes - removed prefix 'environmentVariable' - redefined variable evaluation - removed environmentVariable object from inspector - fixed a small bug * Fixed a server side issue Co-authored-by: Sherfin Shamsudeen <sherfin94@gmail.com>
2022-07-01 10:50:37 +00:00
const variableArray = [];
for (const body in bodyArray) {
const result = await createVariable(app, adminUserData, body);
variableArray.push(result.body.variable);
}
await request(app.getHttpServer())
.get(`/api/organization-variables/`)
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
.set('tj-workspace-id', developerUserData.user.defaultOrganizationId)
.set('Cookie', developerUserData['tokenCookie'])
[Feature] Organisation level environment variables 🚀 (#3068) * Added new page for env vars * Changed a field name * Added some backend files - Entity, Dto, services * Started working with api endpoints - implmented create - added ability * Added fields validation - Added env variables into module * Added update, delete, get apis - Also implemented delete feature in frontend * Implemented update operation on frontend - Solved an api problem * Added encryption * Added encryption to update operation - Exposed env vars to editor - working on viewer * Exposed env vars in viewer also - Resolved a bug * Updated edit & delete icon sizes * Added specs - Resolved issues that occurred while testing * removed logout code * Changed api endpoint * splitted page into 3 different parts, Form & table * Now, non-admin users can see all org env vars * Resolved divider missing issue * Added variable_type field * Now secret server values will be shown as 'SecureValue' * Now you can't update variable_type * Now server will resolve the secret env values * Resolved variable name issue * Added unique constraints * Resolved some frontend bugs * Changed error text * Fixed failing specs * Added group permissions for org env vars * Added permission checking in the backend * Implemented permission checking in the frontend * Edited spec for new changes * Changed some specs and fixed failing specs * Resolved failing case that showed up after merging with the latest develop * Added default admin seed permissions * Refactored some code * Changed value to organization_id * Fixed a bug * Resolved a failing case * Resolved PR changes - Changed permission name - Changed column type to enum - Fixed some errors - Refactored the code * minor code change * added scope * Fixed: hide table when 0 no of vars available * Fixed table dark theme issues * Fixed encryption switch style * Fixed failing cases and updated a spec * Added %% for environment variables * Added code to resolve single variable * Fixed multi-variable usage * resolved an issue * removed extra divider * Suggestions will also show up for %% too * now, suggestions dropdown will only show env variables results * env vars suggestions will not be included in js search results * You can't resolve env variables from js code - Also, we can't resolve js code from env variable enclosures * added an info text * Resolved variables issue * fixed Viewer issue * Resolved a bug - client variable was not working on query preview and run actions * Update error message while using server variable on canvas * Revert "Update error message while using server variable on canvas" This reverts commit 081e1c9e295509a2db1010ddce0841c60e57387a. * Resolved all PR changes - removed prefix 'environmentVariable' - redefined variable evaluation - removed environmentVariable object from inspector - fixed a small bug * Fixed a server side issue Co-authored-by: Sherfin Shamsudeen <sherfin94@gmail.com>
2022-07-01 10:50:37 +00:00
.send()
.expect(200);
await request(app.getHttpServer())
.get(`/api/organization-variables/`)
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
.set('tj-workspace-id', viewerUserData.user.defaultOrganizationId)
.set('Cookie', viewerUserData['tokenCookie'])
[Feature] Organisation level environment variables 🚀 (#3068) * Added new page for env vars * Changed a field name * Added some backend files - Entity, Dto, services * Started working with api endpoints - implmented create - added ability * Added fields validation - Added env variables into module * Added update, delete, get apis - Also implemented delete feature in frontend * Implemented update operation on frontend - Solved an api problem * Added encryption * Added encryption to update operation - Exposed env vars to editor - working on viewer * Exposed env vars in viewer also - Resolved a bug * Updated edit & delete icon sizes * Added specs - Resolved issues that occurred while testing * removed logout code * Changed api endpoint * splitted page into 3 different parts, Form & table * Now, non-admin users can see all org env vars * Resolved divider missing issue * Added variable_type field * Now secret server values will be shown as 'SecureValue' * Now you can't update variable_type * Now server will resolve the secret env values * Resolved variable name issue * Added unique constraints * Resolved some frontend bugs * Changed error text * Fixed failing specs * Added group permissions for org env vars * Added permission checking in the backend * Implemented permission checking in the frontend * Edited spec for new changes * Changed some specs and fixed failing specs * Resolved failing case that showed up after merging with the latest develop * Added default admin seed permissions * Refactored some code * Changed value to organization_id * Fixed a bug * Resolved a failing case * Resolved PR changes - Changed permission name - Changed column type to enum - Fixed some errors - Refactored the code * minor code change * added scope * Fixed: hide table when 0 no of vars available * Fixed table dark theme issues * Fixed encryption switch style * Fixed failing cases and updated a spec * Added %% for environment variables * Added code to resolve single variable * Fixed multi-variable usage * resolved an issue * removed extra divider * Suggestions will also show up for %% too * now, suggestions dropdown will only show env variables results * env vars suggestions will not be included in js search results * You can't resolve env variables from js code - Also, we can't resolve js code from env variable enclosures * added an info text * Resolved variables issue * fixed Viewer issue * Resolved a bug - client variable was not working on query preview and run actions * Update error message while using server variable on canvas * Revert "Update error message while using server variable on canvas" This reverts commit 081e1c9e295509a2db1010ddce0841c60e57387a. * Resolved all PR changes - removed prefix 'environmentVariable' - redefined variable evaluation - removed environmentVariable object from inspector - fixed a small bug * Fixed a server side issue Co-authored-by: Sherfin Shamsudeen <sherfin94@gmail.com>
2022-07-01 10:50:37 +00:00
.send()
.expect(200);
const listResponse = await request(app.getHttpServer())
.get(`/api/organization-variables/`)
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
.set('tj-workspace-id', adminUserData.user.defaultOrganizationId)
.set('Cookie', adminUserData['tokenCookie'])
[Feature] Organisation level environment variables 🚀 (#3068) * Added new page for env vars * Changed a field name * Added some backend files - Entity, Dto, services * Started working with api endpoints - implmented create - added ability * Added fields validation - Added env variables into module * Added update, delete, get apis - Also implemented delete feature in frontend * Implemented update operation on frontend - Solved an api problem * Added encryption * Added encryption to update operation - Exposed env vars to editor - working on viewer * Exposed env vars in viewer also - Resolved a bug * Updated edit & delete icon sizes * Added specs - Resolved issues that occurred while testing * removed logout code * Changed api endpoint * splitted page into 3 different parts, Form & table * Now, non-admin users can see all org env vars * Resolved divider missing issue * Added variable_type field * Now secret server values will be shown as 'SecureValue' * Now you can't update variable_type * Now server will resolve the secret env values * Resolved variable name issue * Added unique constraints * Resolved some frontend bugs * Changed error text * Fixed failing specs * Added group permissions for org env vars * Added permission checking in the backend * Implemented permission checking in the frontend * Edited spec for new changes * Changed some specs and fixed failing specs * Resolved failing case that showed up after merging with the latest develop * Added default admin seed permissions * Refactored some code * Changed value to organization_id * Fixed a bug * Resolved a failing case * Resolved PR changes - Changed permission name - Changed column type to enum - Fixed some errors - Refactored the code * minor code change * added scope * Fixed: hide table when 0 no of vars available * Fixed table dark theme issues * Fixed encryption switch style * Fixed failing cases and updated a spec * Added %% for environment variables * Added code to resolve single variable * Fixed multi-variable usage * resolved an issue * removed extra divider * Suggestions will also show up for %% too * now, suggestions dropdown will only show env variables results * env vars suggestions will not be included in js search results * You can't resolve env variables from js code - Also, we can't resolve js code from env variable enclosures * added an info text * Resolved variables issue * fixed Viewer issue * Resolved a bug - client variable was not working on query preview and run actions * Update error message while using server variable on canvas * Revert "Update error message while using server variable on canvas" This reverts commit 081e1c9e295509a2db1010ddce0841c60e57387a. * Resolved all PR changes - removed prefix 'environmentVariable' - redefined variable evaluation - removed environmentVariable object from inspector - fixed a small bug * Fixed a server side issue Co-authored-by: Sherfin Shamsudeen <sherfin94@gmail.com>
2022-07-01 10:50:37 +00:00
.send()
.expect(200);
listResponse.body.variables.map((variable: any, index: any) => {
expect(variable).toStrictEqual({
variableName: bodyArray[index].variable_name,
value: variable.variableType === 'server' ? undefined : bodyArray[index].value,
variableType: bodyArray[index].variable_type,
encrypted: bodyArray[index].encrypted,
});
});
});
});
describe('POST /api/organization-variables/', () => {
it('should be able to create a new variable if group is admin or has create permission in the same organization', async () => {
const adminUserData = await createUser(app, {
email: 'admin@tooljet.io',
groups: ['all_users', 'admin'],
});
const developerUserData = await createUser(app, {
email: 'dev@tooljet.io',
groups: ['all_users', 'developer'],
organization: adminUserData.organization,
});
const viewerUserData = await createUser(app, {
email: 'viewer@tooljet.io',
groups: ['viewer', 'all_users'],
organization: adminUserData.organization,
});
const developerGroup = await getManager().findOneOrFail(GroupPermission, {
where: { group: 'developer' },
});
await getManager().update(GroupPermission, developerGroup.id, {
orgEnvironmentVariableCreate: true,
});
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
let loggedUser = await authenticateUser(app);
adminUserData['tokenCookie'] = loggedUser.tokenCookie;
loggedUser = await authenticateUser(app, 'dev@tooljet.io');
developerUserData['tokenCookie'] = loggedUser.tokenCookie;
loggedUser = await authenticateUser(app, 'viewer@tooljet.io');
viewerUserData['tokenCookie'] = loggedUser.tokenCookie;
[Feature] Organisation level environment variables 🚀 (#3068) * Added new page for env vars * Changed a field name * Added some backend files - Entity, Dto, services * Started working with api endpoints - implmented create - added ability * Added fields validation - Added env variables into module * Added update, delete, get apis - Also implemented delete feature in frontend * Implemented update operation on frontend - Solved an api problem * Added encryption * Added encryption to update operation - Exposed env vars to editor - working on viewer * Exposed env vars in viewer also - Resolved a bug * Updated edit & delete icon sizes * Added specs - Resolved issues that occurred while testing * removed logout code * Changed api endpoint * splitted page into 3 different parts, Form & table * Now, non-admin users can see all org env vars * Resolved divider missing issue * Added variable_type field * Now secret server values will be shown as 'SecureValue' * Now you can't update variable_type * Now server will resolve the secret env values * Resolved variable name issue * Added unique constraints * Resolved some frontend bugs * Changed error text * Fixed failing specs * Added group permissions for org env vars * Added permission checking in the backend * Implemented permission checking in the frontend * Edited spec for new changes * Changed some specs and fixed failing specs * Resolved failing case that showed up after merging with the latest develop * Added default admin seed permissions * Refactored some code * Changed value to organization_id * Fixed a bug * Resolved a failing case * Resolved PR changes - Changed permission name - Changed column type to enum - Fixed some errors - Refactored the code * minor code change * added scope * Fixed: hide table when 0 no of vars available * Fixed table dark theme issues * Fixed encryption switch style * Fixed failing cases and updated a spec * Added %% for environment variables * Added code to resolve single variable * Fixed multi-variable usage * resolved an issue * removed extra divider * Suggestions will also show up for %% too * now, suggestions dropdown will only show env variables results * env vars suggestions will not be included in js search results * You can't resolve env variables from js code - Also, we can't resolve js code from env variable enclosures * added an info text * Resolved variables issue * fixed Viewer issue * Resolved a bug - client variable was not working on query preview and run actions * Update error message while using server variable on canvas * Revert "Update error message while using server variable on canvas" This reverts commit 081e1c9e295509a2db1010ddce0841c60e57387a. * Resolved all PR changes - removed prefix 'environmentVariable' - redefined variable evaluation - removed environmentVariable object from inspector - fixed a small bug * Fixed a server side issue Co-authored-by: Sherfin Shamsudeen <sherfin94@gmail.com>
2022-07-01 10:50:37 +00:00
await request(app.getHttpServer())
.post(`/api/organization-variables/`)
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
.set('Cookie', adminUserData['tokenCookie'])
.set('tj-workspace-id', adminUserData.user.defaultOrganizationId)
[Feature] Organisation level environment variables 🚀 (#3068) * Added new page for env vars * Changed a field name * Added some backend files - Entity, Dto, services * Started working with api endpoints - implmented create - added ability * Added fields validation - Added env variables into module * Added update, delete, get apis - Also implemented delete feature in frontend * Implemented update operation on frontend - Solved an api problem * Added encryption * Added encryption to update operation - Exposed env vars to editor - working on viewer * Exposed env vars in viewer also - Resolved a bug * Updated edit & delete icon sizes * Added specs - Resolved issues that occurred while testing * removed logout code * Changed api endpoint * splitted page into 3 different parts, Form & table * Now, non-admin users can see all org env vars * Resolved divider missing issue * Added variable_type field * Now secret server values will be shown as 'SecureValue' * Now you can't update variable_type * Now server will resolve the secret env values * Resolved variable name issue * Added unique constraints * Resolved some frontend bugs * Changed error text * Fixed failing specs * Added group permissions for org env vars * Added permission checking in the backend * Implemented permission checking in the frontend * Edited spec for new changes * Changed some specs and fixed failing specs * Resolved failing case that showed up after merging with the latest develop * Added default admin seed permissions * Refactored some code * Changed value to organization_id * Fixed a bug * Resolved a failing case * Resolved PR changes - Changed permission name - Changed column type to enum - Fixed some errors - Refactored the code * minor code change * added scope * Fixed: hide table when 0 no of vars available * Fixed table dark theme issues * Fixed encryption switch style * Fixed failing cases and updated a spec * Added %% for environment variables * Added code to resolve single variable * Fixed multi-variable usage * resolved an issue * removed extra divider * Suggestions will also show up for %% too * now, suggestions dropdown will only show env variables results * env vars suggestions will not be included in js search results * You can't resolve env variables from js code - Also, we can't resolve js code from env variable enclosures * added an info text * Resolved variables issue * fixed Viewer issue * Resolved a bug - client variable was not working on query preview and run actions * Update error message while using server variable on canvas * Revert "Update error message while using server variable on canvas" This reverts commit 081e1c9e295509a2db1010ddce0841c60e57387a. * Resolved all PR changes - removed prefix 'environmentVariable' - redefined variable evaluation - removed environmentVariable object from inspector - fixed a small bug * Fixed a server side issue Co-authored-by: Sherfin Shamsudeen <sherfin94@gmail.com>
2022-07-01 10:50:37 +00:00
.send({ variable_name: 'email', variable_type: 'server', value: 'test@tooljet.io', encrypted: true })
.expect(201);
await request(app.getHttpServer())
.post(`/api/organization-variables/`)
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
.set('tj-workspace-id', developerUserData.user.defaultOrganizationId)
.set('Cookie', developerUserData['tokenCookie'])
[Feature] Organisation level environment variables 🚀 (#3068) * Added new page for env vars * Changed a field name * Added some backend files - Entity, Dto, services * Started working with api endpoints - implmented create - added ability * Added fields validation - Added env variables into module * Added update, delete, get apis - Also implemented delete feature in frontend * Implemented update operation on frontend - Solved an api problem * Added encryption * Added encryption to update operation - Exposed env vars to editor - working on viewer * Exposed env vars in viewer also - Resolved a bug * Updated edit & delete icon sizes * Added specs - Resolved issues that occurred while testing * removed logout code * Changed api endpoint * splitted page into 3 different parts, Form & table * Now, non-admin users can see all org env vars * Resolved divider missing issue * Added variable_type field * Now secret server values will be shown as 'SecureValue' * Now you can't update variable_type * Now server will resolve the secret env values * Resolved variable name issue * Added unique constraints * Resolved some frontend bugs * Changed error text * Fixed failing specs * Added group permissions for org env vars * Added permission checking in the backend * Implemented permission checking in the frontend * Edited spec for new changes * Changed some specs and fixed failing specs * Resolved failing case that showed up after merging with the latest develop * Added default admin seed permissions * Refactored some code * Changed value to organization_id * Fixed a bug * Resolved a failing case * Resolved PR changes - Changed permission name - Changed column type to enum - Fixed some errors - Refactored the code * minor code change * added scope * Fixed: hide table when 0 no of vars available * Fixed table dark theme issues * Fixed encryption switch style * Fixed failing cases and updated a spec * Added %% for environment variables * Added code to resolve single variable * Fixed multi-variable usage * resolved an issue * removed extra divider * Suggestions will also show up for %% too * now, suggestions dropdown will only show env variables results * env vars suggestions will not be included in js search results * You can't resolve env variables from js code - Also, we can't resolve js code from env variable enclosures * added an info text * Resolved variables issue * fixed Viewer issue * Resolved a bug - client variable was not working on query preview and run actions * Update error message while using server variable on canvas * Revert "Update error message while using server variable on canvas" This reverts commit 081e1c9e295509a2db1010ddce0841c60e57387a. * Resolved all PR changes - removed prefix 'environmentVariable' - redefined variable evaluation - removed environmentVariable object from inspector - fixed a small bug * Fixed a server side issue Co-authored-by: Sherfin Shamsudeen <sherfin94@gmail.com>
2022-07-01 10:50:37 +00:00
.send({ variable_name: 'name', variable_type: 'client', value: 'demo user', encrypted: false })
.expect(201);
await request(app.getHttpServer())
.post(`/api/organization-variables/`)
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
.set('tj-workspace-id', viewerUserData.user.defaultOrganizationId)
.set('Cookie', viewerUserData['tokenCookie'])
[Feature] Organisation level environment variables 🚀 (#3068) * Added new page for env vars * Changed a field name * Added some backend files - Entity, Dto, services * Started working with api endpoints - implmented create - added ability * Added fields validation - Added env variables into module * Added update, delete, get apis - Also implemented delete feature in frontend * Implemented update operation on frontend - Solved an api problem * Added encryption * Added encryption to update operation - Exposed env vars to editor - working on viewer * Exposed env vars in viewer also - Resolved a bug * Updated edit & delete icon sizes * Added specs - Resolved issues that occurred while testing * removed logout code * Changed api endpoint * splitted page into 3 different parts, Form & table * Now, non-admin users can see all org env vars * Resolved divider missing issue * Added variable_type field * Now secret server values will be shown as 'SecureValue' * Now you can't update variable_type * Now server will resolve the secret env values * Resolved variable name issue * Added unique constraints * Resolved some frontend bugs * Changed error text * Fixed failing specs * Added group permissions for org env vars * Added permission checking in the backend * Implemented permission checking in the frontend * Edited spec for new changes * Changed some specs and fixed failing specs * Resolved failing case that showed up after merging with the latest develop * Added default admin seed permissions * Refactored some code * Changed value to organization_id * Fixed a bug * Resolved a failing case * Resolved PR changes - Changed permission name - Changed column type to enum - Fixed some errors - Refactored the code * minor code change * added scope * Fixed: hide table when 0 no of vars available * Fixed table dark theme issues * Fixed encryption switch style * Fixed failing cases and updated a spec * Added %% for environment variables * Added code to resolve single variable * Fixed multi-variable usage * resolved an issue * removed extra divider * Suggestions will also show up for %% too * now, suggestions dropdown will only show env variables results * env vars suggestions will not be included in js search results * You can't resolve env variables from js code - Also, we can't resolve js code from env variable enclosures * added an info text * Resolved variables issue * fixed Viewer issue * Resolved a bug - client variable was not working on query preview and run actions * Update error message while using server variable on canvas * Revert "Update error message while using server variable on canvas" This reverts commit 081e1c9e295509a2db1010ddce0841c60e57387a. * Resolved all PR changes - removed prefix 'environmentVariable' - redefined variable evaluation - removed environmentVariable object from inspector - fixed a small bug * Fixed a server side issue Co-authored-by: Sherfin Shamsudeen <sherfin94@gmail.com>
2022-07-01 10:50:37 +00:00
.send({ variable_name: 'pi', variable_type: 'server', value: '3.14', encrypted: true })
.expect(403);
});
});
describe('PATCH /api/organization-variables/:id', () => {
it('should be able to update an existing variable if group is admin or has update permission in the same organization', async () => {
const adminUserData = await createUser(app, {
email: 'admin@tooljet.io',
groups: ['all_users', 'admin'],
});
const developerUserData = await createUser(app, {
email: 'dev@tooljet.io',
groups: ['all_users', 'developer'],
organization: adminUserData.organization,
});
const viewerUserData = await createUser(app, {
email: 'viewer@tooljet.io',
groups: ['viewer', 'all_users'],
organization: adminUserData.organization,
});
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
let loggedUser = await authenticateUser(app);
adminUserData['tokenCookie'] = loggedUser.tokenCookie;
loggedUser = await authenticateUser(app, 'dev@tooljet.io');
developerUserData['tokenCookie'] = loggedUser.tokenCookie;
loggedUser = await authenticateUser(app, 'viewer@tooljet.io');
viewerUserData['tokenCookie'] = loggedUser.tokenCookie;
[Feature] Organisation level environment variables 🚀 (#3068) * Added new page for env vars * Changed a field name * Added some backend files - Entity, Dto, services * Started working with api endpoints - implmented create - added ability * Added fields validation - Added env variables into module * Added update, delete, get apis - Also implemented delete feature in frontend * Implemented update operation on frontend - Solved an api problem * Added encryption * Added encryption to update operation - Exposed env vars to editor - working on viewer * Exposed env vars in viewer also - Resolved a bug * Updated edit & delete icon sizes * Added specs - Resolved issues that occurred while testing * removed logout code * Changed api endpoint * splitted page into 3 different parts, Form & table * Now, non-admin users can see all org env vars * Resolved divider missing issue * Added variable_type field * Now secret server values will be shown as 'SecureValue' * Now you can't update variable_type * Now server will resolve the secret env values * Resolved variable name issue * Added unique constraints * Resolved some frontend bugs * Changed error text * Fixed failing specs * Added group permissions for org env vars * Added permission checking in the backend * Implemented permission checking in the frontend * Edited spec for new changes * Changed some specs and fixed failing specs * Resolved failing case that showed up after merging with the latest develop * Added default admin seed permissions * Refactored some code * Changed value to organization_id * Fixed a bug * Resolved a failing case * Resolved PR changes - Changed permission name - Changed column type to enum - Fixed some errors - Refactored the code * minor code change * added scope * Fixed: hide table when 0 no of vars available * Fixed table dark theme issues * Fixed encryption switch style * Fixed failing cases and updated a spec * Added %% for environment variables * Added code to resolve single variable * Fixed multi-variable usage * resolved an issue * removed extra divider * Suggestions will also show up for %% too * now, suggestions dropdown will only show env variables results * env vars suggestions will not be included in js search results * You can't resolve env variables from js code - Also, we can't resolve js code from env variable enclosures * added an info text * Resolved variables issue * fixed Viewer issue * Resolved a bug - client variable was not working on query preview and run actions * Update error message while using server variable on canvas * Revert "Update error message while using server variable on canvas" This reverts commit 081e1c9e295509a2db1010ddce0841c60e57387a. * Resolved all PR changes - removed prefix 'environmentVariable' - redefined variable evaluation - removed environmentVariable object from inspector - fixed a small bug * Fixed a server side issue Co-authored-by: Sherfin Shamsudeen <sherfin94@gmail.com>
2022-07-01 10:50:37 +00:00
const developerGroup = await getManager().findOneOrFail(GroupPermission, {
where: { group: 'developer' },
});
await getManager().update(GroupPermission, developerGroup.id, {
orgEnvironmentVariableUpdate: true,
});
const response = await createVariable(app, adminUserData, {
variable_name: 'email',
value: 'test@tooljet.io',
variable_type: 'server',
encrypted: true,
});
for (const userData of [adminUserData, developerUserData]) {
await request(app.getHttpServer())
.patch(`/api/organization-variables/${response.body.variable.id}`)
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
.set('tj-workspace-id', userData.user.defaultOrganizationId)
.set('Cookie', userData['tokenCookie'])
[Feature] Organisation level environment variables 🚀 (#3068) * Added new page for env vars * Changed a field name * Added some backend files - Entity, Dto, services * Started working with api endpoints - implmented create - added ability * Added fields validation - Added env variables into module * Added update, delete, get apis - Also implemented delete feature in frontend * Implemented update operation on frontend - Solved an api problem * Added encryption * Added encryption to update operation - Exposed env vars to editor - working on viewer * Exposed env vars in viewer also - Resolved a bug * Updated edit & delete icon sizes * Added specs - Resolved issues that occurred while testing * removed logout code * Changed api endpoint * splitted page into 3 different parts, Form & table * Now, non-admin users can see all org env vars * Resolved divider missing issue * Added variable_type field * Now secret server values will be shown as 'SecureValue' * Now you can't update variable_type * Now server will resolve the secret env values * Resolved variable name issue * Added unique constraints * Resolved some frontend bugs * Changed error text * Fixed failing specs * Added group permissions for org env vars * Added permission checking in the backend * Implemented permission checking in the frontend * Edited spec for new changes * Changed some specs and fixed failing specs * Resolved failing case that showed up after merging with the latest develop * Added default admin seed permissions * Refactored some code * Changed value to organization_id * Fixed a bug * Resolved a failing case * Resolved PR changes - Changed permission name - Changed column type to enum - Fixed some errors - Refactored the code * minor code change * added scope * Fixed: hide table when 0 no of vars available * Fixed table dark theme issues * Fixed encryption switch style * Fixed failing cases and updated a spec * Added %% for environment variables * Added code to resolve single variable * Fixed multi-variable usage * resolved an issue * removed extra divider * Suggestions will also show up for %% too * now, suggestions dropdown will only show env variables results * env vars suggestions will not be included in js search results * You can't resolve env variables from js code - Also, we can't resolve js code from env variable enclosures * added an info text * Resolved variables issue * fixed Viewer issue * Resolved a bug - client variable was not working on query preview and run actions * Update error message while using server variable on canvas * Revert "Update error message while using server variable on canvas" This reverts commit 081e1c9e295509a2db1010ddce0841c60e57387a. * Resolved all PR changes - removed prefix 'environmentVariable' - redefined variable evaluation - removed environmentVariable object from inspector - fixed a small bug * Fixed a server side issue Co-authored-by: Sherfin Shamsudeen <sherfin94@gmail.com>
2022-07-01 10:50:37 +00:00
.send({ variable_name: 'secret_email' })
.expect(200);
const updatedVariable = await getManager().findOne(OrgEnvironmentVariable, response.body.variable.id);
expect(updatedVariable.variableName).toEqual('secret_email');
}
await request(app.getHttpServer())
.patch(`/api/organization-variables/${response.body.variable.id}`)
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
.set('tj-workspace-id', viewerUserData.user.defaultOrganizationId)
.set('Cookie', viewerUserData['tokenCookie'])
[Feature] Organisation level environment variables 🚀 (#3068) * Added new page for env vars * Changed a field name * Added some backend files - Entity, Dto, services * Started working with api endpoints - implmented create - added ability * Added fields validation - Added env variables into module * Added update, delete, get apis - Also implemented delete feature in frontend * Implemented update operation on frontend - Solved an api problem * Added encryption * Added encryption to update operation - Exposed env vars to editor - working on viewer * Exposed env vars in viewer also - Resolved a bug * Updated edit & delete icon sizes * Added specs - Resolved issues that occurred while testing * removed logout code * Changed api endpoint * splitted page into 3 different parts, Form & table * Now, non-admin users can see all org env vars * Resolved divider missing issue * Added variable_type field * Now secret server values will be shown as 'SecureValue' * Now you can't update variable_type * Now server will resolve the secret env values * Resolved variable name issue * Added unique constraints * Resolved some frontend bugs * Changed error text * Fixed failing specs * Added group permissions for org env vars * Added permission checking in the backend * Implemented permission checking in the frontend * Edited spec for new changes * Changed some specs and fixed failing specs * Resolved failing case that showed up after merging with the latest develop * Added default admin seed permissions * Refactored some code * Changed value to organization_id * Fixed a bug * Resolved a failing case * Resolved PR changes - Changed permission name - Changed column type to enum - Fixed some errors - Refactored the code * minor code change * added scope * Fixed: hide table when 0 no of vars available * Fixed table dark theme issues * Fixed encryption switch style * Fixed failing cases and updated a spec * Added %% for environment variables * Added code to resolve single variable * Fixed multi-variable usage * resolved an issue * removed extra divider * Suggestions will also show up for %% too * now, suggestions dropdown will only show env variables results * env vars suggestions will not be included in js search results * You can't resolve env variables from js code - Also, we can't resolve js code from env variable enclosures * added an info text * Resolved variables issue * fixed Viewer issue * Resolved a bug - client variable was not working on query preview and run actions * Update error message while using server variable on canvas * Revert "Update error message while using server variable on canvas" This reverts commit 081e1c9e295509a2db1010ddce0841c60e57387a. * Resolved all PR changes - removed prefix 'environmentVariable' - redefined variable evaluation - removed environmentVariable object from inspector - fixed a small bug * Fixed a server side issue Co-authored-by: Sherfin Shamsudeen <sherfin94@gmail.com>
2022-07-01 10:50:37 +00:00
.send({ variable_name: 'email', value: 'test3@tooljet.io' })
.expect(403);
});
});
describe('DELETE /api/organization-variables/:id', () => {
it('should be able to delete an existing variable if group is admin or has delete permission in the same organization', async () => {
const adminUserData = await createUser(app, {
email: 'admin@tooljet.io',
groups: ['all_users', 'admin'],
});
const developerUserData = await createUser(app, {
email: 'dev@tooljet.io',
groups: ['all_users', 'developer'],
organization: adminUserData.organization,
});
const viewerUserData = await createUser(app, {
email: 'viewer@tooljet.io',
groups: ['viewer', 'all_users'],
organization: adminUserData.organization,
});
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
let loggedUser = await authenticateUser(app);
adminUserData['tokenCookie'] = loggedUser.tokenCookie;
loggedUser = await authenticateUser(app, 'dev@tooljet.io');
developerUserData['tokenCookie'] = loggedUser.tokenCookie;
loggedUser = await authenticateUser(app, 'viewer@tooljet.io');
viewerUserData['tokenCookie'] = loggedUser.tokenCookie;
[Feature] Organisation level environment variables 🚀 (#3068) * Added new page for env vars * Changed a field name * Added some backend files - Entity, Dto, services * Started working with api endpoints - implmented create - added ability * Added fields validation - Added env variables into module * Added update, delete, get apis - Also implemented delete feature in frontend * Implemented update operation on frontend - Solved an api problem * Added encryption * Added encryption to update operation - Exposed env vars to editor - working on viewer * Exposed env vars in viewer also - Resolved a bug * Updated edit & delete icon sizes * Added specs - Resolved issues that occurred while testing * removed logout code * Changed api endpoint * splitted page into 3 different parts, Form & table * Now, non-admin users can see all org env vars * Resolved divider missing issue * Added variable_type field * Now secret server values will be shown as 'SecureValue' * Now you can't update variable_type * Now server will resolve the secret env values * Resolved variable name issue * Added unique constraints * Resolved some frontend bugs * Changed error text * Fixed failing specs * Added group permissions for org env vars * Added permission checking in the backend * Implemented permission checking in the frontend * Edited spec for new changes * Changed some specs and fixed failing specs * Resolved failing case that showed up after merging with the latest develop * Added default admin seed permissions * Refactored some code * Changed value to organization_id * Fixed a bug * Resolved a failing case * Resolved PR changes - Changed permission name - Changed column type to enum - Fixed some errors - Refactored the code * minor code change * added scope * Fixed: hide table when 0 no of vars available * Fixed table dark theme issues * Fixed encryption switch style * Fixed failing cases and updated a spec * Added %% for environment variables * Added code to resolve single variable * Fixed multi-variable usage * resolved an issue * removed extra divider * Suggestions will also show up for %% too * now, suggestions dropdown will only show env variables results * env vars suggestions will not be included in js search results * You can't resolve env variables from js code - Also, we can't resolve js code from env variable enclosures * added an info text * Resolved variables issue * fixed Viewer issue * Resolved a bug - client variable was not working on query preview and run actions * Update error message while using server variable on canvas * Revert "Update error message while using server variable on canvas" This reverts commit 081e1c9e295509a2db1010ddce0841c60e57387a. * Resolved all PR changes - removed prefix 'environmentVariable' - redefined variable evaluation - removed environmentVariable object from inspector - fixed a small bug * Fixed a server side issue Co-authored-by: Sherfin Shamsudeen <sherfin94@gmail.com>
2022-07-01 10:50:37 +00:00
const developerGroup = await getManager().findOneOrFail(GroupPermission, {
where: { group: 'developer' },
});
await getManager().update(GroupPermission, developerGroup.id, {
orgEnvironmentVariableDelete: true,
});
for (const userData of [adminUserData, developerUserData]) {
const response = await createVariable(app, adminUserData, {
variable_name: 'email',
value: 'test@tooljet.io',
variable_type: 'server',
encrypted: true,
});
const preCount = await getManager().count(OrgEnvironmentVariable);
await request(app.getHttpServer())
.delete(`/api/organization-variables/${response.body.variable.id}`)
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
.set('tj-workspace-id', userData.user.defaultOrganizationId)
.set('Cookie', userData['tokenCookie'])
[Feature] Organisation level environment variables 🚀 (#3068) * Added new page for env vars * Changed a field name * Added some backend files - Entity, Dto, services * Started working with api endpoints - implmented create - added ability * Added fields validation - Added env variables into module * Added update, delete, get apis - Also implemented delete feature in frontend * Implemented update operation on frontend - Solved an api problem * Added encryption * Added encryption to update operation - Exposed env vars to editor - working on viewer * Exposed env vars in viewer also - Resolved a bug * Updated edit & delete icon sizes * Added specs - Resolved issues that occurred while testing * removed logout code * Changed api endpoint * splitted page into 3 different parts, Form & table * Now, non-admin users can see all org env vars * Resolved divider missing issue * Added variable_type field * Now secret server values will be shown as 'SecureValue' * Now you can't update variable_type * Now server will resolve the secret env values * Resolved variable name issue * Added unique constraints * Resolved some frontend bugs * Changed error text * Fixed failing specs * Added group permissions for org env vars * Added permission checking in the backend * Implemented permission checking in the frontend * Edited spec for new changes * Changed some specs and fixed failing specs * Resolved failing case that showed up after merging with the latest develop * Added default admin seed permissions * Refactored some code * Changed value to organization_id * Fixed a bug * Resolved a failing case * Resolved PR changes - Changed permission name - Changed column type to enum - Fixed some errors - Refactored the code * minor code change * added scope * Fixed: hide table when 0 no of vars available * Fixed table dark theme issues * Fixed encryption switch style * Fixed failing cases and updated a spec * Added %% for environment variables * Added code to resolve single variable * Fixed multi-variable usage * resolved an issue * removed extra divider * Suggestions will also show up for %% too * now, suggestions dropdown will only show env variables results * env vars suggestions will not be included in js search results * You can't resolve env variables from js code - Also, we can't resolve js code from env variable enclosures * added an info text * Resolved variables issue * fixed Viewer issue * Resolved a bug - client variable was not working on query preview and run actions * Update error message while using server variable on canvas * Revert "Update error message while using server variable on canvas" This reverts commit 081e1c9e295509a2db1010ddce0841c60e57387a. * Resolved all PR changes - removed prefix 'environmentVariable' - redefined variable evaluation - removed environmentVariable object from inspector - fixed a small bug * Fixed a server side issue Co-authored-by: Sherfin Shamsudeen <sherfin94@gmail.com>
2022-07-01 10:50:37 +00:00
.send()
.expect(200);
const postCount = await getManager().count(OrgEnvironmentVariable);
expect(postCount).toEqual(preCount - 1);
}
const response = await createVariable(app, adminUserData, {
variable_name: 'email',
value: 'test@tooljet.io',
variable_type: 'server',
encrypted: true,
});
await request(app.getHttpServer())
.delete(`/api/organization-variables/${response.body.variable.id}`)
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
.set('tj-workspace-id', viewerUserData.user.defaultOrganizationId)
.set('Cookie', viewerUserData['tokenCookie'])
[Feature] Organisation level environment variables 🚀 (#3068) * Added new page for env vars * Changed a field name * Added some backend files - Entity, Dto, services * Started working with api endpoints - implmented create - added ability * Added fields validation - Added env variables into module * Added update, delete, get apis - Also implemented delete feature in frontend * Implemented update operation on frontend - Solved an api problem * Added encryption * Added encryption to update operation - Exposed env vars to editor - working on viewer * Exposed env vars in viewer also - Resolved a bug * Updated edit & delete icon sizes * Added specs - Resolved issues that occurred while testing * removed logout code * Changed api endpoint * splitted page into 3 different parts, Form & table * Now, non-admin users can see all org env vars * Resolved divider missing issue * Added variable_type field * Now secret server values will be shown as 'SecureValue' * Now you can't update variable_type * Now server will resolve the secret env values * Resolved variable name issue * Added unique constraints * Resolved some frontend bugs * Changed error text * Fixed failing specs * Added group permissions for org env vars * Added permission checking in the backend * Implemented permission checking in the frontend * Edited spec for new changes * Changed some specs and fixed failing specs * Resolved failing case that showed up after merging with the latest develop * Added default admin seed permissions * Refactored some code * Changed value to organization_id * Fixed a bug * Resolved a failing case * Resolved PR changes - Changed permission name - Changed column type to enum - Fixed some errors - Refactored the code * minor code change * added scope * Fixed: hide table when 0 no of vars available * Fixed table dark theme issues * Fixed encryption switch style * Fixed failing cases and updated a spec * Added %% for environment variables * Added code to resolve single variable * Fixed multi-variable usage * resolved an issue * removed extra divider * Suggestions will also show up for %% too * now, suggestions dropdown will only show env variables results * env vars suggestions will not be included in js search results * You can't resolve env variables from js code - Also, we can't resolve js code from env variable enclosures * added an info text * Resolved variables issue * fixed Viewer issue * Resolved a bug - client variable was not working on query preview and run actions * Update error message while using server variable on canvas * Revert "Update error message while using server variable on canvas" This reverts commit 081e1c9e295509a2db1010ddce0841c60e57387a. * Resolved all PR changes - removed prefix 'environmentVariable' - redefined variable evaluation - removed environmentVariable object from inspector - fixed a small bug * Fixed a server side issue Co-authored-by: Sherfin Shamsudeen <sherfin94@gmail.com>
2022-07-01 10:50:37 +00:00
.send()
.expect(403);
});
});
afterAll(async () => {
await app.close();
});
});