@versori/run 0.2.8 → 0.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/src/context/Context.d.ts +4 -4
- package/esm/src/context/Context.d.ts.map +1 -1
- package/esm/src/context/ContextProvider.d.ts +3 -3
- package/esm/src/context/ContextProvider.d.ts.map +1 -1
- package/esm/src/dsl/http/default.d.ts +4 -4
- package/esm/src/dsl/http/default.d.ts.map +1 -1
- package/esm/src/dsl/http/default.js +3 -3
- package/esm/src/dsl/http/types.d.ts +8 -2
- package/esm/src/dsl/http/types.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/configloader.d.ts +10 -1
- package/esm/src/dsl/http/versori/configloader.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/configloader.js +37 -0
- package/esm/src/dsl/http/versori/constants.d.ts +1 -0
- package/esm/src/dsl/http/versori/constants.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/constants.js +2 -0
- package/esm/src/dsl/http/versori/contextcredentials.d.ts +0 -4
- package/esm/src/dsl/http/versori/contextcredentials.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/cronapi.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/cronapi.js +2 -2
- package/esm/src/dsl/http/versori/proxyroundtripper.d.ts +5 -7
- package/esm/src/dsl/http/versori/proxyroundtripper.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/proxyroundtripper.js +10 -24
- package/esm/src/dsl/http/versori/roundtripper.d.ts +6 -7
- package/esm/src/dsl/http/versori/roundtripper.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/roundtripper.js +32 -28
- package/esm/src/dsl/http/versori/webhookmiddleware.d.ts +16 -0
- package/esm/src/dsl/http/versori/webhookmiddleware.d.ts.map +1 -0
- package/esm/src/dsl/http/versori/webhookmiddleware.js +197 -0
- package/esm/src/dsl/tasks/HttpTask.d.ts +3 -3
- package/esm/src/dsl/tasks/HttpTask.d.ts.map +1 -1
- package/esm/src/dsl/tasks/HttpTask.js +1 -1
- package/esm/src/dsl/triggers/WebhookTrigger.d.ts +1 -0
- package/esm/src/dsl/triggers/WebhookTrigger.d.ts.map +1 -1
- package/esm/src/interpreter/memory/MemoryInterpreter.d.ts +7 -4
- package/esm/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
- package/esm/src/interpreter/memory/MemoryInterpreter.js +70 -20
- package/esm/src/interpreter/memory/ObservableCompiler.d.ts +4 -2
- package/esm/src/interpreter/memory/ObservableCompiler.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/schedule.js +2 -2
- package/esm/src/interpreter/memory/compilers/webhook.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/webhook.js +38 -12
- package/esm/src/observability/logging/ConsoleLogger.d.ts +1 -0
- package/esm/src/observability/logging/ConsoleLogger.d.ts.map +1 -1
- package/esm/src/observability/logging/ConsoleLogger.js +7 -0
- package/esm/src/observability/logging/Logger.d.ts +2 -1
- package/esm/src/observability/logging/Logger.d.ts.map +1 -1
- package/package.json +1 -1
- package/script/src/context/Context.d.ts +4 -4
- package/script/src/context/Context.d.ts.map +1 -1
- package/script/src/context/ContextProvider.d.ts +3 -3
- package/script/src/context/ContextProvider.d.ts.map +1 -1
- package/script/src/dsl/http/default.d.ts +4 -4
- package/script/src/dsl/http/default.d.ts.map +1 -1
- package/script/src/dsl/http/default.js +3 -3
- package/script/src/dsl/http/types.d.ts +8 -2
- package/script/src/dsl/http/types.d.ts.map +1 -1
- package/script/src/dsl/http/versori/configloader.d.ts +10 -1
- package/script/src/dsl/http/versori/configloader.d.ts.map +1 -1
- package/script/src/dsl/http/versori/configloader.js +39 -0
- package/script/src/dsl/http/versori/constants.d.ts +1 -0
- package/script/src/dsl/http/versori/constants.d.ts.map +1 -1
- package/script/src/dsl/http/versori/constants.js +3 -1
- package/script/src/dsl/http/versori/contextcredentials.d.ts +0 -4
- package/script/src/dsl/http/versori/contextcredentials.d.ts.map +1 -1
- package/script/src/dsl/http/versori/cronapi.d.ts.map +1 -1
- package/script/src/dsl/http/versori/cronapi.js +1 -1
- package/script/src/dsl/http/versori/proxyroundtripper.d.ts +5 -7
- package/script/src/dsl/http/versori/proxyroundtripper.d.ts.map +1 -1
- package/script/src/dsl/http/versori/proxyroundtripper.js +9 -23
- package/script/src/dsl/http/versori/roundtripper.d.ts +6 -7
- package/script/src/dsl/http/versori/roundtripper.d.ts.map +1 -1
- package/script/src/dsl/http/versori/roundtripper.js +31 -27
- package/script/src/dsl/http/versori/webhookmiddleware.d.ts +16 -0
- package/script/src/dsl/http/versori/webhookmiddleware.d.ts.map +1 -0
- package/script/src/dsl/http/versori/webhookmiddleware.js +202 -0
- package/script/src/dsl/tasks/HttpTask.d.ts +3 -3
- package/script/src/dsl/tasks/HttpTask.d.ts.map +1 -1
- package/script/src/dsl/tasks/HttpTask.js +1 -1
- package/script/src/dsl/triggers/WebhookTrigger.d.ts +1 -0
- package/script/src/dsl/triggers/WebhookTrigger.d.ts.map +1 -1
- package/script/src/interpreter/memory/MemoryInterpreter.d.ts +7 -4
- package/script/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
- package/script/src/interpreter/memory/MemoryInterpreter.js +70 -20
- package/script/src/interpreter/memory/ObservableCompiler.d.ts +4 -2
- package/script/src/interpreter/memory/ObservableCompiler.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/schedule.js +2 -2
- package/script/src/interpreter/memory/compilers/webhook.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/webhook.js +38 -12
- package/script/src/observability/logging/ConsoleLogger.d.ts +1 -0
- package/script/src/observability/logging/ConsoleLogger.d.ts.map +1 -1
- package/script/src/observability/logging/ConsoleLogger.js +7 -0
- package/script/src/observability/logging/Logger.d.ts +2 -1
- package/script/src/observability/logging/Logger.d.ts.map +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Code, ConnectError } from '@connectrpc/connect';
|
|
2
2
|
import { ConsoleLogger } from '../../../observability/mod.js';
|
|
3
|
-
import {
|
|
3
|
+
import { VersoriConfigReader } from './configloader.js';
|
|
4
4
|
import { envVarCredsBaseURL, envVarEnvId, envVarOrgId, envVarPlatformApiBaseURL, } from './constants.js';
|
|
5
5
|
import { VersoriCredentialClient } from './credentials/mod.js';
|
|
6
|
-
import { PlatformAPIClient } from './platformapi.js';
|
|
7
6
|
import { isValidURL } from './helpers.js';
|
|
7
|
+
import { PlatformAPIClient } from './platformapi.js';
|
|
8
8
|
/**
|
|
9
9
|
* VersoriRoundTripper is an implementation of the RoundTripperFactory interface for Versori connections.
|
|
10
10
|
* This is the intended implementation for when projects/services are hosted on Versori infrastructure.
|
|
@@ -17,7 +17,7 @@ import { isValidURL } from './helpers.js';
|
|
|
17
17
|
* ```
|
|
18
18
|
*/
|
|
19
19
|
export class VersoriCredentialsFactory {
|
|
20
|
-
constructor(credsClient, credsBaseURL, platformAPIClient, logger, tracer) {
|
|
20
|
+
constructor(credsClient, credsBaseURL, platformAPIClient, logger, tracer, cfgReader) {
|
|
21
21
|
Object.defineProperty(this, "tokenClient", {
|
|
22
22
|
enumerable: true,
|
|
23
23
|
configurable: true,
|
|
@@ -36,7 +36,7 @@ export class VersoriCredentialsFactory {
|
|
|
36
36
|
writable: true,
|
|
37
37
|
value: void 0
|
|
38
38
|
});
|
|
39
|
-
Object.defineProperty(this, "
|
|
39
|
+
Object.defineProperty(this, "cfgReader", {
|
|
40
40
|
enumerable: true,
|
|
41
41
|
configurable: true,
|
|
42
42
|
writable: true,
|
|
@@ -68,7 +68,7 @@ export class VersoriCredentialsFactory {
|
|
|
68
68
|
this.tokenClient = credsClient;
|
|
69
69
|
this.credsBaseURL = credsBaseURL;
|
|
70
70
|
this.platformAPIClient = platformAPIClient;
|
|
71
|
-
this.
|
|
71
|
+
this.cfgReader = cfgReader;
|
|
72
72
|
this.log = logger;
|
|
73
73
|
this.tracer = tracer;
|
|
74
74
|
// lost 15 minutes because of this one
|
|
@@ -80,6 +80,7 @@ export class VersoriCredentialsFactory {
|
|
|
80
80
|
const platformApiBaseURL = Deno.env.get(envVarPlatformApiBaseURL);
|
|
81
81
|
const orgId = Deno.env.get(envVarOrgId);
|
|
82
82
|
const envId = Deno.env.get(envVarEnvId);
|
|
83
|
+
const cfgReader = VersoriConfigReader.fromEnv(logger);
|
|
83
84
|
if (!orgId || !envId || !platformApiBaseURL || !credsBaseURL) {
|
|
84
85
|
const missingVars = [];
|
|
85
86
|
if (!orgId)
|
|
@@ -95,7 +96,7 @@ export class VersoriCredentialsFactory {
|
|
|
95
96
|
const log = logger || new ConsoleLogger('debug');
|
|
96
97
|
const pAPIClient = new PlatformAPIClient(platformApiBaseURL, orgId, envId, log);
|
|
97
98
|
const tokenClient = new VersoriCredentialClient(credsBaseURL);
|
|
98
|
-
return new VersoriCredentialsFactory(tokenClient, credsBaseURL, pAPIClient, log, tracer);
|
|
99
|
+
return new VersoriCredentialsFactory(tokenClient, credsBaseURL, pAPIClient, log, tracer, cfgReader);
|
|
99
100
|
}
|
|
100
101
|
// takes the info and modifies the url using changeBaseUrl if necessary
|
|
101
102
|
// if a full valid URL is passed as a string, it will be returned as is
|
|
@@ -134,7 +135,7 @@ export class VersoriCredentialsFactory {
|
|
|
134
135
|
return newURL.toString();
|
|
135
136
|
}
|
|
136
137
|
create(connName) {
|
|
137
|
-
const cnxId = this.getConnectionID(connName);
|
|
138
|
+
const cnxId = this.cfgReader.getConnectionID(connName);
|
|
138
139
|
if (!cnxId) {
|
|
139
140
|
this.log.debug('Connection not found in config, could be a dynamic connection', {
|
|
140
141
|
connectionName: connName,
|
|
@@ -166,7 +167,7 @@ export class VersoriCredentialsFactory {
|
|
|
166
167
|
return Promise.resolve(_fn);
|
|
167
168
|
}
|
|
168
169
|
createDynamic(templateName) {
|
|
169
|
-
const template = this.getTemplateID(templateName);
|
|
170
|
+
const template = this.cfgReader.getTemplateID(templateName);
|
|
170
171
|
if (!template) {
|
|
171
172
|
this.log.debug('Template not found in config, could be a static connection', {
|
|
172
173
|
templateName: templateName,
|
|
@@ -236,7 +237,7 @@ export class VersoriCredentialsFactory {
|
|
|
236
237
|
}
|
|
237
238
|
async getTokenByName(name, forceRefresh = false, activationId) {
|
|
238
239
|
const credId = await this.getCredentialIDFromName(name, activationId);
|
|
239
|
-
const token = await this.
|
|
240
|
+
const token = await this.getToken(credId, forceRefresh);
|
|
240
241
|
if (!token?.token) {
|
|
241
242
|
throw new Error(`Token not found for connection ${name} with credential ID ${credId}`);
|
|
242
243
|
}
|
|
@@ -250,7 +251,7 @@ export class VersoriCredentialsFactory {
|
|
|
250
251
|
}
|
|
251
252
|
async getRawByName(name, activationId) {
|
|
252
253
|
const credId = await this.getCredentialIDFromName(name, activationId);
|
|
253
|
-
const raw = await this.
|
|
254
|
+
const raw = await this.getRaw(credId);
|
|
254
255
|
if (!raw) {
|
|
255
256
|
throw new Error(`Raw data not found for connection ${name} with credential ID ${credId}`);
|
|
256
257
|
}
|
|
@@ -262,7 +263,7 @@ export class VersoriCredentialsFactory {
|
|
|
262
263
|
}
|
|
263
264
|
async getCredentialIDFromName(name, activationId) {
|
|
264
265
|
// fin connection config from versori file
|
|
265
|
-
const conn = this.
|
|
266
|
+
const conn = this.cfgReader.getCnxMapping(name);
|
|
266
267
|
if (!conn) {
|
|
267
268
|
return '';
|
|
268
269
|
}
|
|
@@ -293,21 +294,6 @@ export class VersoriCredentialsFactory {
|
|
|
293
294
|
}
|
|
294
295
|
return staticConn.credentials[0].credential.id;
|
|
295
296
|
}
|
|
296
|
-
getConnectionID(connName) {
|
|
297
|
-
const conn = this.versoriCfg.mappings.find((c) => (c.dynamic === undefined || c.dynamic === false) &&
|
|
298
|
-
c.name.toLowerCase() === connName.toLowerCase());
|
|
299
|
-
if (!conn || !conn.connId) {
|
|
300
|
-
return '';
|
|
301
|
-
}
|
|
302
|
-
return conn.connId;
|
|
303
|
-
}
|
|
304
|
-
getTemplateID(templateName) {
|
|
305
|
-
const template = this.versoriCfg.mappings.find((c) => c.dynamic && c.name.toLowerCase() === templateName.toLowerCase());
|
|
306
|
-
if (!template || !template.templateId) {
|
|
307
|
-
return '';
|
|
308
|
-
}
|
|
309
|
-
return template.templateId;
|
|
310
|
-
}
|
|
311
297
|
apiKeyFetcher(conn, fn) {
|
|
312
298
|
const _fn = async (input, init) => {
|
|
313
299
|
const tokenResponse = await this.getToken(conn.credentials[0].credential.id);
|
|
@@ -475,9 +461,10 @@ export class VersoriCredentialsFactory {
|
|
|
475
461
|
return await this.tokenClient.getToken(id, forceRefresh);
|
|
476
462
|
}
|
|
477
463
|
catch (error) {
|
|
478
|
-
this.log.error('unable to get credential', { error });
|
|
464
|
+
this.log.error('unable to get token credential', { error });
|
|
479
465
|
if (error instanceof ConnectError) {
|
|
480
|
-
if (error.rawMessage.includes('connection error received: not a result of an error') &&
|
|
466
|
+
if (error.rawMessage.includes('connection error received: not a result of an error') &&
|
|
467
|
+
error.code === Code.Internal) {
|
|
481
468
|
this.log.info('Connection error received, attempting to reconnect');
|
|
482
469
|
this.tokenClient = new VersoriCredentialClient(this.credsBaseURL);
|
|
483
470
|
return await this.tokenClient.getToken(id);
|
|
@@ -487,4 +474,21 @@ export class VersoriCredentialsFactory {
|
|
|
487
474
|
throw error;
|
|
488
475
|
}
|
|
489
476
|
}
|
|
477
|
+
async getRaw(id) {
|
|
478
|
+
try {
|
|
479
|
+
return await this.tokenClient.getRaw(id);
|
|
480
|
+
}
|
|
481
|
+
catch (error) {
|
|
482
|
+
this.log.error('unable to get raw credential', { error });
|
|
483
|
+
if (error instanceof ConnectError) {
|
|
484
|
+
if (error.rawMessage.includes('connection error received: not a result of an error') && error.code === Code.Internal) {
|
|
485
|
+
this.log.info('Connection error received, attempting to reconnect');
|
|
486
|
+
this.tokenClient = new VersoriCredentialClient(this.credsBaseURL);
|
|
487
|
+
return await this.tokenClient.getRaw(id);
|
|
488
|
+
}
|
|
489
|
+
throw error;
|
|
490
|
+
}
|
|
491
|
+
throw error;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
490
494
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { NextFunction, Response, Request } from 'express';
|
|
2
|
+
import { CredentialsProvider } from './contextcredentials.js';
|
|
3
|
+
import { ConfigReader, ConnectionProvider } from '../types.js';
|
|
4
|
+
import { Logger } from '../../../observability/mod.js';
|
|
5
|
+
export type CreateWebhookMiddleWareOpts = {
|
|
6
|
+
id: string;
|
|
7
|
+
connName?: string;
|
|
8
|
+
credentials: CredentialsProvider;
|
|
9
|
+
cnxProvider: ConnectionProvider;
|
|
10
|
+
cfgReader: ConfigReader;
|
|
11
|
+
log: Logger;
|
|
12
|
+
};
|
|
13
|
+
export declare function createStaticWebhookMiddleware(opts: CreateWebhookMiddleWareOpts): (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
14
|
+
export declare function createActIdDynamicWebhookMiddleware(opts: CreateWebhookMiddleWareOpts): (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
15
|
+
export declare function createUserIdDynamicWebhookMiddleware(opts: CreateWebhookMiddleWareOpts): (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
16
|
+
//# sourceMappingURL=webhookmiddleware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhookmiddleware.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/webhookmiddleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAwB,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAErF,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAGvD,MAAM,MAAM,2BAA2B,GAAG;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,mBAAmB,CAAC;IACjC,WAAW,EAAE,kBAAkB,CAAC;IAChC,SAAS,EAAE,YAAY,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC;CACf,CAAC;AAIF,wBAAgB,6BAA6B,CACzC,IAAI,EAAE,2BAA2B,GAClC,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CA8DpE;AAED,wBAAgB,mCAAmC,CAC/C,IAAI,EAAE,2BAA2B,GAClC,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAiEpE;AAED,wBAAgB,oCAAoC,CAChD,IAAI,EAAE,2BAA2B,GAClC,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAkFpE"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { createHmac } from 'node:crypto';
|
|
2
|
+
import { Buffer } from 'node:buffer';
|
|
3
|
+
// TODO: Refactor this so we don't have like three different middlewares for static and dynamic webhooks
|
|
4
|
+
export function createStaticWebhookMiddleware(opts) {
|
|
5
|
+
if (opts.connName === undefined) {
|
|
6
|
+
opts.log.warn(`No connection ID found for webhook, accepting any requests which is unsecure!`, { webhookId: opts.id });
|
|
7
|
+
return async (_req, res, next) => {
|
|
8
|
+
const activation = await opts.cnxProvider.getStaticActivation();
|
|
9
|
+
res.locals.activation = activation;
|
|
10
|
+
next();
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
return async (req, res, next) => {
|
|
14
|
+
if (!opts.connName) {
|
|
15
|
+
// This is mainly for type safety, but we should never reach this point
|
|
16
|
+
opts.log.error('Connection name is not defined for webhook middleware');
|
|
17
|
+
res.status(401).json({ error: 'Unauthorised' });
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const cnxId = opts.cfgReader.getConnectionID(opts.connName);
|
|
21
|
+
const conn = await opts.cnxProvider.getStaticConnection(cnxId);
|
|
22
|
+
const activation = await opts.cnxProvider.getStaticActivation();
|
|
23
|
+
if (conn === undefined || activation === undefined) {
|
|
24
|
+
opts.log.error(`Connection or activation not found for webhook: /${opts.id}`);
|
|
25
|
+
res.status(401).json({ error: 'Unauthorised' });
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const key = await opts.credentials.getRaw(opts.connName);
|
|
29
|
+
const asc = conn.credentials[0].authSchemeConfig;
|
|
30
|
+
if (!asc || !asc.hmac) {
|
|
31
|
+
opts.log.error('HMAC AuthSchemeConfig not found for webhook');
|
|
32
|
+
res.status(401).json({ error: 'Unauthorised' });
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const digest = createDigest(asc.hmac, req, key);
|
|
36
|
+
let requestDigest;
|
|
37
|
+
try {
|
|
38
|
+
requestDigest = extractDigest(asc.hmac, req);
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
opts.log.error('Error extracting HMAC digest from request', { error });
|
|
42
|
+
res.status(401).json({ error: 'Unauthorised' });
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (digest !== requestDigest) {
|
|
46
|
+
res.status(401).json({ error: 'Unauthorised' });
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
res.locals.activation = activation;
|
|
50
|
+
next();
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export function createActIdDynamicWebhookMiddleware(opts) {
|
|
54
|
+
if (!opts.connName) {
|
|
55
|
+
opts.log.warn(`No template ID found for webhook, accepting any requests which is unsecure!`, { webhookId: opts.id });
|
|
56
|
+
return async (req, res, next) => {
|
|
57
|
+
const activationId = req.params.activationId;
|
|
58
|
+
const activation = await opts.cnxProvider.getActivation(activationId);
|
|
59
|
+
res.locals.activation = activation;
|
|
60
|
+
next();
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
return async (req, res, next) => {
|
|
64
|
+
if (!opts.connName) {
|
|
65
|
+
// This is mainly for type safety, but we should never reach this point
|
|
66
|
+
opts.log.error('Connection name is not defined for webhook middleware');
|
|
67
|
+
res.status(401).json({ error: 'Unauthorised' });
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const templateId = opts.cfgReader.getTemplateID(opts.connName);
|
|
71
|
+
const activationId = req.params.activationId;
|
|
72
|
+
const activation = await opts.cnxProvider.getActivation(activationId);
|
|
73
|
+
const conn = await opts.cnxProvider.getActivationConnection(templateId, activationId);
|
|
74
|
+
if (activation === undefined || conn === undefined) {
|
|
75
|
+
opts.log.error(`Activation or connection not found for webhook: /${opts.id}/activations/${activationId}`);
|
|
76
|
+
res.status(401).json({ error: 'Unauthorised' });
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const key = await opts.credentials.getRaw(opts.connName, activationId);
|
|
80
|
+
const asc = conn.credentials[0].authSchemeConfig;
|
|
81
|
+
if (!asc || !asc.hmac) {
|
|
82
|
+
opts.log.error('HMAC AuthSchemeConfig not found for webhook');
|
|
83
|
+
res.status(401).json({ error: 'Unauthorised' });
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const digest = createDigest(asc.hmac, req, key);
|
|
87
|
+
let requestDigest;
|
|
88
|
+
try {
|
|
89
|
+
requestDigest = extractDigest(asc.hmac, req);
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
opts.log.error('Error extracting HMAC digest from request', { error });
|
|
93
|
+
res.status(401).json({ error: 'Unauthorised' });
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (digest !== requestDigest) {
|
|
97
|
+
res.status(401).json({ error: 'Unauthorised' });
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
res.locals.activation = activation;
|
|
101
|
+
next();
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
export function createUserIdDynamicWebhookMiddleware(opts) {
|
|
105
|
+
if (!opts.connName) {
|
|
106
|
+
opts.log.warn(`No template ID found for webhook, accepting any requests which is unsecure!`, { webhookId: opts.id });
|
|
107
|
+
return async (req, res, next) => {
|
|
108
|
+
const userId = req.params.userId;
|
|
109
|
+
const activations = await opts.cnxProvider.getUserActivations(userId);
|
|
110
|
+
if (activations.length === 0) {
|
|
111
|
+
opts.log.error(`No activations found for user: ${userId}`);
|
|
112
|
+
res.status(401).json({ error: 'Unauthorised' });
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const activation = activations[0];
|
|
116
|
+
res.locals.activation = activation;
|
|
117
|
+
next();
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
return async (req, res, next) => {
|
|
121
|
+
if (!opts.connName) {
|
|
122
|
+
// This is mainly for type safety, but we should never reach this point
|
|
123
|
+
opts.log.error('Connection name is not defined for webhook middleware');
|
|
124
|
+
res.status(401).json({ error: 'Unauthorised' });
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
const templateId = opts.cfgReader.getTemplateID(opts.connName);
|
|
128
|
+
const userId = req.params.userId;
|
|
129
|
+
const activations = await opts.cnxProvider.getUserActivations(userId);
|
|
130
|
+
if (activations.length === 0) {
|
|
131
|
+
res.status(401).json({ error: 'Unauthorised' });
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
const activation = activations[0]; // Right now we only support a user having one activation
|
|
135
|
+
const conn = await opts.cnxProvider.getActivationConnection(templateId, activation.id);
|
|
136
|
+
if (conn === undefined) {
|
|
137
|
+
opts.log.error(`Connection not found for webhook: /${opts.id}/users/${userId}`);
|
|
138
|
+
res.status(401).json({ error: 'Unauthorised' });
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
const key = await opts.credentials.getRaw(opts.connName, activation.id);
|
|
142
|
+
const asc = conn.credentials[0].authSchemeConfig;
|
|
143
|
+
if (!asc || !asc.hmac) {
|
|
144
|
+
opts.log.error('HMAC AuthSchemeConfig not found for webhook');
|
|
145
|
+
res.status(401).json({ error: 'Unauthorised' });
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
const digest = createDigest(asc.hmac, req, key);
|
|
149
|
+
let requestDigest;
|
|
150
|
+
try {
|
|
151
|
+
requestDigest = extractDigest(asc.hmac, req);
|
|
152
|
+
}
|
|
153
|
+
catch (error) {
|
|
154
|
+
opts.log.error('Error extracting HMAC digest from request', { error });
|
|
155
|
+
res.status(401).json({ error: 'Unauthorised' });
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
if (digest !== requestDigest) {
|
|
159
|
+
res.status(401).json({ error: 'Unauthorised' });
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
res.locals.activation = activation;
|
|
163
|
+
next();
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
// createDigest creates a HMAC digest for the request using the provided key.
|
|
167
|
+
// Note that this assumes the request body is a JSON object, as one would normally
|
|
168
|
+
// expect for our use case.
|
|
169
|
+
// TODO: implement the case where we might want to digest the body + url or url + body
|
|
170
|
+
// or url...
|
|
171
|
+
function createDigest(asc, req, key) {
|
|
172
|
+
const hmac = createHmac(asc.algorithm, Buffer.from(key).toString('utf8'));
|
|
173
|
+
hmac.update(JSON.stringify(req.body));
|
|
174
|
+
return hmac.digest(asc.encoding);
|
|
175
|
+
}
|
|
176
|
+
function extractDigest(asc, req) {
|
|
177
|
+
switch (asc.in) {
|
|
178
|
+
case 'query':
|
|
179
|
+
if (req.query[asc.name]) {
|
|
180
|
+
return req.query[asc.name];
|
|
181
|
+
}
|
|
182
|
+
break;
|
|
183
|
+
case 'header':
|
|
184
|
+
if (req.headers[asc.name]) {
|
|
185
|
+
return req.headers[asc.name];
|
|
186
|
+
}
|
|
187
|
+
break;
|
|
188
|
+
case 'cookie':
|
|
189
|
+
if (req.cookies[asc.name]) {
|
|
190
|
+
return req.cookies[asc.name];
|
|
191
|
+
}
|
|
192
|
+
break;
|
|
193
|
+
default:
|
|
194
|
+
throw new Error(`Unsupported HMAC digest extraction method: ${asc.in}`);
|
|
195
|
+
}
|
|
196
|
+
throw new Error(`HMAC digest not found in request: ${asc.name}`);
|
|
197
|
+
}
|
|
@@ -2,7 +2,7 @@ import { Context, ContextImpl } from '../../context/Context.js';
|
|
|
2
2
|
import { KeyValue, KeyValueScope } from '../../kv/KeyValue.js';
|
|
3
3
|
import { Logger } from '../../observability/logging/Logger.js';
|
|
4
4
|
import { Activation, DynamicFetcher } from '../http/types.js';
|
|
5
|
-
import {
|
|
5
|
+
import { CredentialsProvider } from '../http/versori/contextcredentials.js';
|
|
6
6
|
import { ArrayTask, Task, Taskable, TaskType } from '../Task.js';
|
|
7
7
|
export interface HttpContext<Data, PageParams = undefined> extends Context<Data> {
|
|
8
8
|
fetch: typeof fetch;
|
|
@@ -42,9 +42,9 @@ export declare class HttpContextImpl<D, PageParams> implements HttpContext<D, Pa
|
|
|
42
42
|
get activation(): Activation | undefined;
|
|
43
43
|
get data(): D;
|
|
44
44
|
openKv(scope?: KeyValueScope): KeyValue;
|
|
45
|
-
credentials():
|
|
45
|
+
credentials(): CredentialsProvider;
|
|
46
46
|
get fetch(): typeof globalThis.fetch;
|
|
47
|
-
nextPage(
|
|
47
|
+
nextPage(_nextParams: PageParams): Promise<void>;
|
|
48
48
|
}
|
|
49
49
|
export declare function http<In = any, Out = any, PageParams = unknown>(taskId: string, opts: HttpOptions<In, Out, PageParams>, fn: HttpContextFunc<In, Out, PageParams>): Task<In, Out>;
|
|
50
50
|
//# sourceMappingURL=HttpTask.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpTask.d.ts","sourceRoot":"","sources":["../../../../src/src/dsl/tasks/HttpTask.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAE/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CAAC,EAAE,UAAU,CAAC;;IAC7E,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IAC9C,UAAU,CAAC,EAAE,UAAU,CAAC;gBASpB,GAAG,EAAE,WAAW,CAAC,CAAC,EAAE,GAAG,CAAC,EACxB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACnC,aAAa,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,EACvC,cAAc,CAAC,EAAE,cAAc,EAC/B,UAAU,CAAC,EAAE,UAAU;IAgB3B,IAAI,GAAG,IAAI,MAAM,CAEhB;IAED,IAAI,WAAW,IAAI,MAAM,CAExB;IAED,IAAI,SAAS,IAAI,IAAI,CAEpB;IAED,IAAI,UAAU,IAAI,UAAU,GAAG,SAAS,CAEvC;IAED,IAAI,IAAI,IAAI,CAAC,CAEZ;IAED,MAAM,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,QAAQ;IAIvC,WAAW,IAAI,mBAAmB;IAIlC,IAAI,KAAK,IAAI,OAAO,UAAU,CAAC,KAAK,CAKnC;IAEK,QAAQ,CAAC,WAAW,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAGzD;AAED,wBAAgB,IAAI,CAAC,EAAE,GAAG,GAAG,EAAE,GAAG,GAAG,GAAG,EAAE,UAAU,GAAG,OAAO,EAC1D,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,WAAW,CAAC,EAAE,EAAE,GAAG,EAAE,UAAU,CAAC,EACtC,EAAE,EAAE,eAAe,CAAC,EAAE,EAAE,GAAG,EAAE,UAAU,CAAC,GACzC,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,CAEf"}
|
|
@@ -124,7 +124,7 @@ export class HttpContextImpl {
|
|
|
124
124
|
? wrapDynamicFetcher(__classPrivateFieldGet(this, _HttpContextImpl_dynamicFetcher, "f"), __classPrivateFieldGet(this, _HttpContextImpl_inner, "f").activation)
|
|
125
125
|
: __classPrivateFieldGet(this, _HttpContextImpl_staticFetcher, "f") ?? globalThis.fetch;
|
|
126
126
|
}
|
|
127
|
-
async nextPage(
|
|
127
|
+
async nextPage(_nextParams) {
|
|
128
128
|
throw new Error('Method not implemented.');
|
|
129
129
|
}
|
|
130
130
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebhookTrigger.d.ts","sourceRoot":"","sources":["../../../../src/src/dsl/triggers/WebhookTrigger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAgB,MAAM,gBAAgB,CAAC;AAExD,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAEhD,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;CACxB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACjC;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAExB;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC;IAE7C;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC;CAC9C,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IACzB,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAC1B,QAAQ,CA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AAE,cAAc,CAAC;IAExB,CAAC,WAAW,CAAC,EAAE,MAAM,CAAa;gBAEtB,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,cAAmB;IAKpD,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC;CAG1D;AAED,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,WAAW,CAAC,CAElF"}
|
|
@@ -3,7 +3,7 @@ import { NodeSDK } from '@opentelemetry/sdk-node';
|
|
|
3
3
|
import { Router } from 'express';
|
|
4
4
|
import { Observable, Subscription } from 'rxjs';
|
|
5
5
|
import { ContextProvider } from '../../context/ContextProvider.js';
|
|
6
|
-
import { ConnectionProvider, CronProvider, RoundTripperFactory } from '../../dsl/http/types.js';
|
|
6
|
+
import { ConfigReader, ConnectionProvider, CronProvider, RoundTripperFactory } from '../../dsl/http/types.js';
|
|
7
7
|
import { Workflow } from '../../dsl/Workflow.js';
|
|
8
8
|
import { ContextImpl, ContextOperatorFunction } from '../../mod.js';
|
|
9
9
|
import { Logger } from '../../observability/logging/Logger.js';
|
|
@@ -27,17 +27,20 @@ export declare class MemoryInterpreter {
|
|
|
27
27
|
private readonly compiler;
|
|
28
28
|
private readonly contextProvider;
|
|
29
29
|
private readonly roundTripperFactory;
|
|
30
|
-
private readonly
|
|
30
|
+
private readonly webhookRouter;
|
|
31
|
+
private readonly cronRouter;
|
|
31
32
|
private cronRegistry;
|
|
32
33
|
private readonly connectionProvider;
|
|
33
34
|
private readonly cronProvider;
|
|
34
35
|
private readonly tracer;
|
|
36
|
+
private readonly cfgReader;
|
|
35
37
|
private readonly otelSDK?;
|
|
36
38
|
private registeredWorkflows;
|
|
37
|
-
private
|
|
39
|
+
private webhookServer?;
|
|
40
|
+
private cronServer?;
|
|
38
41
|
private shutdownServer?;
|
|
39
42
|
private isShuttingDown;
|
|
40
|
-
constructor(log: Logger, compiler: ObservableCompiler, contextProvider: ContextProvider, roundTripperFactory: RoundTripperFactory,
|
|
43
|
+
constructor(log: Logger, compiler: ObservableCompiler, contextProvider: ContextProvider, roundTripperFactory: RoundTripperFactory, webhookRouter: Router, cronRouter: Router, cronRegistry: Map<string, string>, connectionProvider: ConnectionProvider, cronProvider: CronProvider, tracer: Tracer, cfgReader: ConfigReader, otelSDK?: NodeSDK | undefined);
|
|
41
44
|
static newInstance(options?: MemoryInterpreterOptions): Promise<MemoryInterpreter>;
|
|
42
45
|
register<O>(workflow: Workflow<O>, options?: MemoryInterpreterOptions): Registration;
|
|
43
46
|
start(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MemoryInterpreter.d.ts","sourceRoot":"","sources":["../../../../src/src/interpreter/memory/MemoryInterpreter.ts"],"names":[],"mappings":"AAAA,OAAsB,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG3D,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAgB,EAAqB,MAAM,EAAE,MAAM,SAAS,CAAC;AAG7D,OAAO,EAA+B,UAAU,EAAM,YAAY,EAAO,MAAM,MAAM,CAAC;AACtF,OAAO,EAAE,eAAe,EAAuB,MAAM,kCAAkC,CAAC;AAExF,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"MemoryInterpreter.d.ts","sourceRoot":"","sources":["../../../../src/src/interpreter/memory/MemoryInterpreter.ts"],"names":[],"mappings":"AAAA,OAAsB,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG3D,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAgB,EAAqB,MAAM,EAAE,MAAM,SAAS,CAAC;AAG7D,OAAO,EAA+B,UAAU,EAAM,YAAY,EAAO,MAAM,MAAM,CAAC;AACt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