Skip to content

Commit 7a7a8b6

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/mailparser-3.9.3
2 parents 6f359ff + 80ab4af commit 7a7a8b6

251 files changed

Lines changed: 6597 additions & 2948 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

THIRD_PARTY_LICENSES.txt

Lines changed: 347 additions & 208 deletions
Large diffs are not rendered by default.

deploy/docker-compose/docker-compose.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ services:
55
ports:
66
- '80:80'
77
- '443:443'
8+
environment:
9+
NGINX_WEBHOOK_SYNC_TIMEOUT: '${OPS_FLOW_TIMEOUT_SECONDS:-600}s'
810
volumes:
911
- ./${OPS_NGINX_CONFIG_FILE:-nginx.gateway.conf}:/etc/nginx/conf.d/default.conf
10-
- ./nginx.gateway.routing.conf:/etc/nginx/includes/routing.conf
12+
- ./nginx.gateway.routing.template:/etc/nginx/templates/gateway.routing.template
1113
- ./tls:/etc/nginx/tls
1214
depends_on:
1315
openops-tables:
@@ -36,7 +38,7 @@ services:
3638
image: public.ecr.aws/openops/openops-engine:${OPS_VERSION:-latest}
3739
restart: unless-stopped
3840
env_file: .env
39-
command: ["cp -r /var/tmp-base/. /tmp/ && node main.js; exit $?"]
41+
command: ['cp -r /var/tmp-base/. /tmp/ && node main.js; exit $?']
4042
environment:
4143
OPS_BASE_CODE_DIRECTORY: /tmp/codes
4244
OPS_COMPONENT: engine
@@ -137,7 +139,7 @@ services:
137139
volumes:
138140
- 'redis_data:/data'
139141
healthcheck:
140-
test: [ 'CMD', 'redis-cli', 'ping' ]
142+
test: ['CMD', 'redis-cli', 'ping']
141143
interval: 5s
142144
timeout: 3s
143145
retries: 3

deploy/docker-compose/nginx.gateway.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ server {
33

44
server_name openops;
55

6-
include includes/routing.conf;
6+
include /etc/nginx/conf.d/gateway.routing;
77
}

deploy/docker-compose/nginx.gateway.routing.conf renamed to deploy/docker-compose/nginx.gateway.routing.template

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,20 @@ location /openops-tables {
6262
proxy_set_header X-Forwarded-Proto $scheme;
6363
}
6464

65+
location ~ ^/api/v1/webhooks/[^/]+/sync$ {
66+
add_header X-Frame-Options DENY;
67+
proxy_pass http://openops-app;
68+
proxy_set_header Host $host;
69+
proxy_set_header X-Real-IP $remote_addr;
70+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
71+
proxy_set_header X-Forwarded-Proto $scheme;
72+
73+
proxy_connect_timeout ${NGINX_WEBHOOK_SYNC_TIMEOUT};
74+
proxy_send_timeout ${NGINX_WEBHOOK_SYNC_TIMEOUT};
75+
proxy_read_timeout ${NGINX_WEBHOOK_SYNC_TIMEOUT};
76+
send_timeout ${NGINX_WEBHOOK_SYNC_TIMEOUT};
77+
}
78+
6579
location /.well-known/acme-challenge/ {
6680
root /etc/nginx/tls/acme;
6781
}

deploy/docker-compose/nginx.gateway.tls.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ server {
2424

2525
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
2626

27-
include includes/routing.conf;
27+
include /etc/nginx/conf.d/gateway.routing;
2828
}
2929

3030
server {

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@
151151
"@vercel/otel": "1.13.0",
152152
"@xyflow/react": "12.4.4",
153153
"ai": "6.0.40",
154-
"ajv": "8.12.0",
154+
"ajv": "8.18.0",
155155
"async-mutex": "0.4.0",
156156
"aws-lambda": "1.0.7",
157157
"axios": "1.13.5",
@@ -181,11 +181,11 @@
181181
"decimal.js": "10.4.3",
182182
"decompress": "4.2.1",
183183
"deepmerge-ts": "7.1.0",
184-
"dompurify": "3.2.7",
184+
"dompurify": "3.3.3",
185185
"dotenv": "16.4.5",
186186
"embla-carousel-react": "8.1.8",
187187
"fast-deep-equal": "3.1.3",
188-
"fastify": "5.4.0",
188+
"fastify": "5.8.2",
189189
"fastify-favicon": "5.0.0",
190190
"fastify-plugin": "5.0.1",
191191
"fastify-raw-body": "5.0.0",
@@ -272,7 +272,7 @@
272272
"recharts": "2.12.7",
273273
"redlock": "5.0.0-beta.2",
274274
"remark-gfm": "4.0.1",
275-
"rollup": "4.24.0",
275+
"rollup": "4.59.0",
276276
"rss-parser": "3.13.0",
277277
"rxjs": "7.8.1",
278278
"semver": "7.6.0",

packages/blocks/aws-athena/src/lib/actions/query-athena-action.ts

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
amazonAuth,
44
dryRunCheckBox,
55
getAwsAccountsSingleSelectDropdown,
6-
getCredentialsListFromAuth,
6+
getCredentialsForAccount,
77
getRegionsDropdownState,
88
listAthenaDatabases,
99
runAndWaitForQueryResult,
@@ -33,10 +33,9 @@ export const runAthenaQueryAction = createAction({
3333
database: Property.Dropdown<string>({
3434
displayName: 'Database',
3535
description: 'Database that contains the table to query on',
36-
37-
refreshers: ['auth', 'accounts', 'region'],
36+
refreshers: ['auth', 'accounts', 'accounts.accounts', 'region'],
3837
required: true,
39-
options: async ({ auth, accounts, region }) => {
38+
options: async ({ auth, accounts, region }: any) => {
4039
if (!auth) {
4140
return {
4241
disabled: true,
@@ -46,24 +45,14 @@ export const runAthenaQueryAction = createAction({
4645
}
4746

4847
try {
49-
const authProp = auth as {
50-
accessKeyId: string;
51-
secretAccessKey: string;
52-
defaultRegion: string;
53-
};
54-
const selectedAccounts = (
55-
accounts as unknown as {
56-
accounts?: string[];
57-
}
58-
)?.accounts;
59-
const credentialsList = await getCredentialsListFromAuth(
60-
authProp,
61-
selectedAccounts,
48+
const credentials = await getCredentialsForAccount(
49+
auth,
50+
accounts?.['accounts'],
6251
);
6352

6453
const databases = await listAthenaDatabases(
65-
credentialsList[0],
66-
(region as string | undefined) ?? authProp.defaultRegion,
54+
credentials,
55+
(region as string | undefined) ?? auth.defaultRegion,
6756
);
6857

6958
return {
@@ -119,14 +108,13 @@ export const runAthenaQueryAction = createAction({
119108
}
120109

121110
try {
122-
const selectedAccounts = context.propsValue.accounts?.['accounts'];
123-
const credentialsList = await getCredentialsListFromAuth(
111+
const credentials = await getCredentialsForAccount(
124112
context.auth,
125-
selectedAccounts,
113+
context.propsValue.accounts?.['accounts'],
126114
);
127115

128116
return await runAndWaitForQueryResult(
129-
credentialsList[0],
117+
credentials,
130118
context.propsValue.region ?? context.auth.defaultRegion,
131119
query,
132120
database,

packages/blocks/aws-athena/test/athena-query-action.test.ts

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const openopsCommonMock = {
22
...jest.requireActual('@openops/common'),
3-
getCredentialsListFromAuth: jest.fn(),
3+
getCredentialsForAccount: jest.fn(),
44
runAndWaitForQueryResult: jest.fn(),
55
};
66

@@ -12,9 +12,9 @@ describe('runAthenaQueryAction tests', () => {
1212
beforeEach(() => {
1313
jest.clearAllMocks();
1414

15-
openopsCommonMock.getCredentialsListFromAuth.mockResolvedValue([
16-
{ someCreds: 'some creds' },
17-
]);
15+
openopsCommonMock.getCredentialsForAccount.mockResolvedValue({
16+
someCreds: 'some creds',
17+
});
1818
});
1919

2020
const auth = {
@@ -76,7 +76,7 @@ describe('runAthenaQueryAction tests', () => {
7676
...jest.requireActual('@openops/blocks-framework'),
7777
auth: auth,
7878
propsValue: {
79-
accounts: { accounts: ['some-account-id'] },
79+
accounts: { accounts: 'some-account-id' },
8080
query: 'some query',
8181
database: 'some database',
8282
outputBucket: 'some outputBucket',
@@ -87,12 +87,10 @@ describe('runAthenaQueryAction tests', () => {
8787
const result = (await runAthenaQueryAction.run(context)) as any;
8888

8989
expect(result).toEqual('mockResult');
90-
expect(openopsCommonMock.getCredentialsListFromAuth).toHaveBeenCalledTimes(
91-
1,
92-
);
93-
expect(openopsCommonMock.getCredentialsListFromAuth).toHaveBeenCalledWith(
90+
expect(openopsCommonMock.getCredentialsForAccount).toHaveBeenCalledTimes(1);
91+
expect(openopsCommonMock.getCredentialsForAccount).toHaveBeenCalledWith(
9492
auth,
95-
['some-account-id'],
93+
'some-account-id',
9694
);
9795
});
9896

@@ -138,7 +136,6 @@ describe('runAthenaQueryAction tests', () => {
138136
...jest.requireActual('@openops/blocks-framework'),
139137
auth: auth,
140138
propsValue: {
141-
accounts: { accounts: ['some-account-id'] },
142139
region: 'some region',
143140
query: 'some query',
144141
database: 'some database',
@@ -158,12 +155,10 @@ describe('runAthenaQueryAction tests', () => {
158155
'some database',
159156
'some outputBucket',
160157
);
161-
expect(openopsCommonMock.getCredentialsListFromAuth).toHaveBeenCalledTimes(
162-
1,
163-
);
164-
expect(openopsCommonMock.getCredentialsListFromAuth).toHaveBeenCalledWith(
158+
expect(openopsCommonMock.getCredentialsForAccount).toHaveBeenCalledTimes(1);
159+
expect(openopsCommonMock.getCredentialsForAccount).toHaveBeenCalledWith(
165160
auth,
166-
['some-account-id'],
161+
undefined,
167162
);
168163
});
169164

packages/blocks/aws/src/lib/actions/get-price-action.ts

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { Property, createAction } from '@openops/blocks-framework';
33
import {
44
amazonAuth,
55
getAttributeValues,
6+
getAwsAccountsSingleSelectDropdown,
7+
getCredentialsForAccount,
68
getCredentialsFromAuth,
79
getPriceListWithCache,
810
getServices,
@@ -17,12 +19,13 @@ export const getPriceAction = createAction({
1719
displayName: 'Get Price from Price Catalog',
1820
isWriteAction: false,
1921
props: {
22+
account: getAwsAccountsSingleSelectDropdown().accounts,
2023
service: Property.Dropdown({
2124
displayName: 'Service Code',
2225
description: 'Service code for which to fetch the price',
23-
refreshers: ['auth'],
26+
refreshers: ['auth', 'account', 'account.accounts'],
2427
required: true,
25-
options: async ({ auth }: any) => {
28+
options: async ({ auth, account }: any) => {
2629
if (!auth) {
2730
return {
2831
disabled: true,
@@ -31,8 +34,11 @@ export const getPriceAction = createAction({
3134
};
3235
}
3336

34-
const credentials = await getCredentialsFromAuth(auth);
3537
try {
38+
const credentials = await getCredentialsForAccount(
39+
auth,
40+
account?.['accounts'],
41+
);
3642
const services = await getServices(credentials, PRICING_REGION);
3743

3844
if (!services.length) {
@@ -66,8 +72,8 @@ export const getPriceAction = createAction({
6672
displayName: '',
6773
description: '',
6874
required: true,
69-
refreshers: ['auth', 'service'],
70-
props: async ({ auth, service }, { input }) => {
75+
refreshers: ['auth', 'account', 'account.accounts', 'service'],
76+
props: async ({ auth, account, service }, { input }) => {
7177
if (!auth || !service) {
7278
return {};
7379
}
@@ -101,7 +107,10 @@ export const getPriceAction = createAction({
101107
};
102108
}
103109

104-
const credentials = await getCredentialsFromAuth(auth);
110+
const credentials = await getCredentialsForAccount(
111+
auth,
112+
account?.['accounts'],
113+
);
105114
try {
106115
const attributeValues: AttributeValue[] =
107116
await getAttributeValues(
@@ -139,17 +148,20 @@ export const getPriceAction = createAction({
139148
},
140149
async run(context) {
141150
try {
142-
const { service, queryFilters } = context.propsValue;
151+
const { account, service, queryFilters } = context.propsValue;
143152
const filters = queryFilters['queryFilters'].map((filter: any) => {
144153
return {
145154
Field: filter.attributeName,
146155
Type: FilterType.TERM_MATCH,
147156
Value: filter.attributeValue,
148157
};
149158
});
159+
const credentials = account?.['accounts']
160+
? await getCredentialsForAccount(context.auth, account['accounts'])
161+
: await getCredentialsFromAuth(context.auth);
150162

151163
const priceList = getPriceListWithCache(
152-
context.auth,
164+
credentials,
153165
service.ServiceCode!,
154166
filters,
155167
PRICING_REGION,

0 commit comments

Comments
 (0)