Skip to content

Commit ff15b90

Browse files
authored
Merge branch 'main' into mg/cleanup
2 parents 764cc24 + 75b0bce commit ff15b90

10 files changed

Lines changed: 40 additions & 40 deletions

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,21 @@ jobs:
2525
- name: Install dependencies
2626
if: steps.node-modules-cache.outputs.cache-hit != 'true'
2727
run: npm ci --no-audit --no-fund
28+
audit:
29+
name: Security Audit
30+
needs: install
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v5.0.1
34+
- name: Restore node_modules cache
35+
id: node-modules-cache
36+
uses: actions/cache/restore@v4.3.0
37+
with:
38+
path: node_modules
39+
key: node-modules-cache-${{ hashFiles('package-lock.json', '.npmrc') }}
40+
fail-on-cache-miss: true
41+
- name: Run npm audit
42+
run: npm audit --audit-level=critical
2843
lint:
2944
name: Lint
3045
needs: install

THIRD_PARTY_LICENSES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11834,7 +11834,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1183411834

1183511835
The following npm package may be included in this product:
1183611836

11837-
- form-data@4.0.0
11837+
- form-data@4.0.5
1183811838

1183911839
This package contains the following license:
1184011840

package-lock.json

Lines changed: 7 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@
188188
"fastify-raw-body": "5.0.0",
189189
"fastify-socket.io": "5.1.0",
190190
"firebase-scrypt": "2.2.0",
191-
"form-data": "4.0.0",
191+
"form-data": "4.0.5",
192192
"fs-extra": "11.2.0",
193193
"fuse.js": "7.0.0",
194194
"http-status-codes": "2.2.0",

packages/server/api/src/app/authentication/new-user/organization-assignment.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { AppSystemProp, system } from '@openops/server-shared';
22
import { ApplicationError, ErrorCode, isNil, User } from '@openops/shared';
33
import { openopsTables } from '../../openops-tables';
4+
import { authenticateAdminUserInOpenOpsTables } from '../../openops-tables/auth-admin-tables';
45
import { organizationService } from '../../organization/organization.service';
56
import { projectService } from '../../project/project-service';
67
import { userService } from '../../user/user-service';
@@ -52,8 +53,7 @@ async function addUserToDefaultWorkspace(values: {
5253
email: string;
5354
workspaceId: number;
5455
}): Promise<void> {
55-
const { token: defaultToken } =
56-
await openopsTables.authenticateAdminUserInOpenOpsTables();
56+
const { token: defaultToken } = await authenticateAdminUserInOpenOpsTables();
5757

5858
await openopsTables.addUserToWorkspace(defaultToken, {
5959
...values,

packages/server/api/src/app/database/seeds/create-open-ops-tables-mcp-endpoint.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { logger } from '@openops/server-shared';
22
import { openopsTables } from '../../openops-tables';
3+
import { authenticateAdminUserInOpenOpsTables } from '../../openops-tables/auth-admin-tables';
34
import { OPENOPS_DEFAULT_WORKSPACE_NAME } from '../../openops-tables/default-workspace-database';
45

56
export const createOpenOpsTablesMcpEndpoint = async () => {
6-
const { token } = await openopsTables.authenticateAdminUserInOpenOpsTables();
7+
const { token } = await authenticateAdminUserInOpenOpsTables();
78
const mcpEndpoints = await openopsTables.getMcpEndpointList(token);
89
const workspace = await openopsTables.getWorkspaceByName(
910
token,

packages/server/api/src/app/database/seeds/openops-delete-old-opportunities-table.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
} from '@openops/common';
88
import { logger } from '@openops/server-shared';
99
import { FlagEntity } from '../../flags/flag.entity';
10-
import { openopsTables } from '../../openops-tables';
10+
import { authenticateAdminUserInOpenOpsTables } from '../../openops-tables/auth-admin-tables';
1111
import { SEED_OPENOPS_TABLE_NAME } from '../../openops-tables/template-tables/create-opportunities-table';
1212
import { databaseConnection } from '../database-connection';
1313
import { getDefaultProjectTablesDatabaseToken } from '../get-default-user-db-token';
@@ -53,8 +53,7 @@ export const deleteOldOpportunitiesTable = async (): Promise<void> => {
5353
}
5454

5555
try {
56-
const { token } =
57-
await openopsTables.authenticateAdminUserInOpenOpsTables();
56+
const { token } = await authenticateAdminUserInOpenOpsTables();
5857

5958
const table = await getTableByName(
6059
SEED_OPENOPS_TABLE_NAME,

packages/server/api/src/app/database/seeds/openops-tables-rename-database.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
import { logger } from '@openops/server-shared';
88
import { FlagEntity } from '../../flags/flag.entity';
99
import { openopsTables } from '../../openops-tables';
10+
import { authenticateAdminUserInOpenOpsTables } from '../../openops-tables/auth-admin-tables';
1011
import { databaseConnection } from '../database-connection';
1112

1213
const OPENOPS_TABLES_DATABASE_RENAMED_FLAG = 'TABLES_DB_RENAMED';
@@ -37,7 +38,7 @@ export const updateOpenopsTablesDatabase = async (): Promise<void> => {
3738
return;
3839
}
3940

40-
const { token } = await openopsTables.authenticateAdminUserInOpenOpsTables();
41+
const { token } = await authenticateAdminUserInOpenOpsTables();
4142

4243
try {
4344
const tablesDatabaseId = await getDefaultDatabaseId(

packages/server/api/src/app/database/seeds/seed-admin.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { AppSystemProp, logger, system } from '@openops/server-shared';
22
import { OrganizationRole, Provider, User } from '@openops/shared';
33
import { authenticationService } from '../../authentication/basic/authentication-service';
44
import { openopsTables } from '../../openops-tables';
5+
import { authenticateAdminUserInOpenOpsTables } from '../../openops-tables/auth-admin-tables';
56
import { organizationService } from '../../organization/organization.service';
67
import { projectService } from '../../project/project-service';
78
import { userService } from '../../user/user-service';
@@ -80,7 +81,7 @@ async function ensureOpenOpsTablesWorkspaceAndDatabaseExist(): Promise<{
8081
workspaceId: number;
8182
databaseId: number;
8283
}> {
83-
const { token } = await openopsTables.authenticateAdminUserInOpenOpsTables();
84+
const { token } = await authenticateAdminUserInOpenOpsTables();
8485

8586
const { workspaceId, databaseId, databaseToken } =
8687
await openopsTables.createDefaultWorkspaceAndDatabase(token);

packages/server/api/src/app/openops-tables/template-tables/seed-tables-for-templates.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { AppSystemProp, logger, system } from '@openops/server-shared';
22
import { projectService } from '../../project/project-service';
33
import { userService } from '../../user/user-service';
4+
import { authenticateAdminUserInOpenOpsTables } from '../auth-admin-tables';
45
import { openopsTables } from '../index';
56
import { createAggregatedCostsTable } from './create-aggregated-costs-table';
67
import { createAutoInstancesShutdownTable } from './create-auto-instances-shutdown-table';
@@ -33,8 +34,7 @@ const getProjectTablesDatabaseId = async (): Promise<number> => {
3334

3435
export const seedTemplateTablesService = {
3536
async createBaseTemplateTables() {
36-
const { token } =
37-
await openopsTables.authenticateAdminUserInOpenOpsTables();
37+
const { token } = await authenticateAdminUserInOpenOpsTables();
3838
const databaseId = await getProjectTablesDatabaseId();
3939

4040
const buTable = await createBusinessUnitsTable(databaseId, token);
@@ -50,8 +50,7 @@ export const seedTemplateTablesService = {
5050
},
5151

5252
async createOpportunityTemplateTable() {
53-
const { token } =
54-
await openopsTables.authenticateAdminUserInOpenOpsTables();
53+
const { token } = await authenticateAdminUserInOpenOpsTables();
5554
const databaseId = await getProjectTablesDatabaseId();
5655

5756
await createOpportunitiesTable(token, databaseId);
@@ -60,16 +59,14 @@ export const seedTemplateTablesService = {
6059
},
6160

6261
async createAggregatedCostsTable() {
63-
const { token } =
64-
await openopsTables.authenticateAdminUserInOpenOpsTables();
62+
const { token } = await authenticateAdminUserInOpenOpsTables();
6563
const databaseId = await getProjectTablesDatabaseId();
6664

6765
await createAggregatedCostsTable(databaseId, token);
6866
},
6967

7068
async createKnownCostTypesByApplicationTable() {
71-
const { token } =
72-
await openopsTables.authenticateAdminUserInOpenOpsTables();
69+
const { token } = await authenticateAdminUserInOpenOpsTables();
7370
const databaseId = await getProjectTablesDatabaseId();
7471

7572
await createKnownCostTypesByApplicationTable(token, databaseId);
@@ -78,8 +75,7 @@ export const seedTemplateTablesService = {
7875
},
7976

8077
async createAutoInstancesShutdownTable(): Promise<void> {
81-
const { token } =
82-
await openopsTables.authenticateAdminUserInOpenOpsTables();
78+
const { token } = await authenticateAdminUserInOpenOpsTables();
8379
const databaseId = await getProjectTablesDatabaseId();
8480

8581
await createAutoInstancesShutdownTable(token, databaseId);

0 commit comments

Comments
 (0)