quidproquo-actionprocessor-node 0.1.1 → 0.1.3
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/lib/commonjs/dynamicActionProcessor/file/index.d.ts +2 -2
- package/lib/commonjs/dynamicActionProcessor/file/secureUrlUtils.js +2 -8
- package/lib/esm/dynamicActionProcessor/file/index.d.ts +2 -2
- package/lib/esm/dynamicActionProcessor/file/index.js +2 -2
- package/lib/esm/dynamicActionProcessor/file/secureUrlUtils.js +2 -8
- package/package.json +5 -5
|
@@ -2,5 +2,5 @@ import { ActionProcessorListResolver } from 'quidproquo-core';
|
|
|
2
2
|
import { FileStorageConfig } from './types';
|
|
3
3
|
export * from './types';
|
|
4
4
|
export declare const getFileActionProcessor: (fileStorageConfig: FileStorageConfig) => ActionProcessorListResolver;
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
5
|
+
export * from './secureUrlUtils';
|
|
6
|
+
export * from './utils';
|
|
@@ -40,10 +40,7 @@ const createSecureUrlToken = (token, secret) => {
|
|
|
40
40
|
const payload = JSON.stringify(token);
|
|
41
41
|
const payloadBase64 = Buffer.from(payload).toString('base64url');
|
|
42
42
|
// Create HMAC signature
|
|
43
|
-
const signature = crypto
|
|
44
|
-
.createHmac('sha256', secret)
|
|
45
|
-
.update(payloadBase64)
|
|
46
|
-
.digest('base64url');
|
|
43
|
+
const signature = crypto.createHmac('sha256', secret).update(payloadBase64).digest('base64url');
|
|
47
44
|
// Return token as payload.signature
|
|
48
45
|
return `${payloadBase64}.${signature}`;
|
|
49
46
|
};
|
|
@@ -56,10 +53,7 @@ const verifySecureUrlToken = (tokenString, secret) => {
|
|
|
56
53
|
return null;
|
|
57
54
|
}
|
|
58
55
|
// Verify signature
|
|
59
|
-
const expectedSignature = crypto
|
|
60
|
-
.createHmac('sha256', secret)
|
|
61
|
-
.update(payloadBase64)
|
|
62
|
-
.digest('base64url');
|
|
56
|
+
const expectedSignature = crypto.createHmac('sha256', secret).update(payloadBase64).digest('base64url');
|
|
63
57
|
if (signature !== expectedSignature) {
|
|
64
58
|
return null;
|
|
65
59
|
}
|
|
@@ -2,5 +2,5 @@ import { ActionProcessorListResolver } from 'quidproquo-core';
|
|
|
2
2
|
import { FileStorageConfig } from './types';
|
|
3
3
|
export * from './types';
|
|
4
4
|
export declare const getFileActionProcessor: (fileStorageConfig: FileStorageConfig) => ActionProcessorListResolver;
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
5
|
+
export * from './secureUrlUtils';
|
|
6
|
+
export * from './utils';
|
|
@@ -30,5 +30,5 @@ export const getFileActionProcessor = (fileStorageConfig) => {
|
|
|
30
30
|
...(await getFileStreamOpenActionProcessor(fileStorageConfig)(qpqConfig, dynamicModuleLoader)),
|
|
31
31
|
});
|
|
32
32
|
};
|
|
33
|
-
export * from
|
|
34
|
-
export * from
|
|
33
|
+
export * from './secureUrlUtils';
|
|
34
|
+
export * from './utils';
|
|
@@ -4,10 +4,7 @@ export const createSecureUrlToken = (token, secret) => {
|
|
|
4
4
|
const payload = JSON.stringify(token);
|
|
5
5
|
const payloadBase64 = Buffer.from(payload).toString('base64url');
|
|
6
6
|
// Create HMAC signature
|
|
7
|
-
const signature = crypto
|
|
8
|
-
.createHmac('sha256', secret)
|
|
9
|
-
.update(payloadBase64)
|
|
10
|
-
.digest('base64url');
|
|
7
|
+
const signature = crypto.createHmac('sha256', secret).update(payloadBase64).digest('base64url');
|
|
11
8
|
// Return token as payload.signature
|
|
12
9
|
return `${payloadBase64}.${signature}`;
|
|
13
10
|
};
|
|
@@ -19,10 +16,7 @@ export const verifySecureUrlToken = (tokenString, secret) => {
|
|
|
19
16
|
return null;
|
|
20
17
|
}
|
|
21
18
|
// Verify signature
|
|
22
|
-
const expectedSignature = crypto
|
|
23
|
-
.createHmac('sha256', secret)
|
|
24
|
-
.update(payloadBase64)
|
|
25
|
-
.digest('base64url');
|
|
19
|
+
const expectedSignature = crypto.createHmac('sha256', secret).update(payloadBase64).digest('base64url');
|
|
26
20
|
if (signature !== expectedSignature) {
|
|
27
21
|
return null;
|
|
28
22
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quidproquo-actionprocessor-node",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/commonjs/index.js",
|
|
6
6
|
"module": "./lib/esm/index.js",
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
"homepage": "https://github.com/joe-coady/quidproquo#readme",
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@anthropic-ai/sdk": "^0.19.1",
|
|
36
|
-
"quidproquo-actionprocessor-js": "0.1.
|
|
37
|
-
"quidproquo-core": "0.1.
|
|
38
|
-
"quidproquo-webserver": "0.1.
|
|
36
|
+
"quidproquo-actionprocessor-js": "0.1.3",
|
|
37
|
+
"quidproquo-core": "0.1.3",
|
|
38
|
+
"quidproquo-webserver": "0.1.3",
|
|
39
39
|
"uuidv7": "^1.0.1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"quidproquo-tsconfig": "0.1.
|
|
42
|
+
"quidproquo-tsconfig": "0.1.3",
|
|
43
43
|
"typescript": "^5.8.2"
|
|
44
44
|
}
|
|
45
45
|
}
|