@enactprotocol/shared 1.2.0 → 1.2.1
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/dist/core/EnactCore.js +10 -3
- package/dist/utils/env-loader.js +1 -1
- package/dist/utils/help.js +1 -1
- package/package.json +1 -1
- package/src/core/EnactCore.ts +11 -4
- package/src/utils/env-loader.ts +1 -1
- package/src/utils/help.ts +1 -1
package/dist/core/EnactCore.js
CHANGED
|
@@ -5,7 +5,7 @@ import { DaggerExecutionProvider } from "./DaggerExecutionProvider.js";
|
|
|
5
5
|
import { resolveToolEnvironmentVariables } from "../utils/env-loader.js";
|
|
6
6
|
import logger from "../exec/logger.js";
|
|
7
7
|
import yaml from "yaml";
|
|
8
|
-
import { CryptoUtils, KeyManager, SigningService } from "@enactprotocol/security";
|
|
8
|
+
import { CryptoUtils, KeyManager, SecurityConfigManager, SigningService } from "@enactprotocol/security";
|
|
9
9
|
export class EnactCore {
|
|
10
10
|
constructor(options = {}) {
|
|
11
11
|
this.options = {
|
|
@@ -277,7 +277,6 @@ export class EnactCore {
|
|
|
277
277
|
const documentForVerification = {
|
|
278
278
|
command: tool.command
|
|
279
279
|
};
|
|
280
|
-
// IGNORE DATABASE SIGNATURES - USE HARDCODED WORKING VALUES FOR TESTING
|
|
281
280
|
const referenceSignature = {
|
|
282
281
|
signature: tool.signatures[0].value,
|
|
283
282
|
publicKey: tool.signatures[0].signer,
|
|
@@ -321,8 +320,16 @@ export class EnactCore {
|
|
|
321
320
|
validateToolStructure(tool);
|
|
322
321
|
// Validate inputs
|
|
323
322
|
const validatedInputs = validateInputs(tool, inputs);
|
|
323
|
+
const config = SecurityConfigManager.loadConfig();
|
|
324
|
+
if (options.isLocalFile && config.allowLocalUnsigned) {
|
|
325
|
+
logger.warn(`Executing local file without signature verification: ${tool.name} (you can disallow in your security config)`);
|
|
326
|
+
}
|
|
327
|
+
if (options.dangerouslySkipVerification) {
|
|
328
|
+
logger.warn(`Skipping signature verification for tool: ${tool.name} because of dangerouslySkipVerification option`);
|
|
329
|
+
}
|
|
330
|
+
const skipVerification = (options.isLocalFile && config.allowLocalUnsigned) || Boolean(options.dangerouslySkipVerification);
|
|
324
331
|
// Verify tool signatures (unless explicitly skipped)
|
|
325
|
-
await this.verifyTool(tool,
|
|
332
|
+
await this.verifyTool(tool, skipVerification);
|
|
326
333
|
// Resolve environment variables
|
|
327
334
|
const { resolved: envVars } = await resolveToolEnvironmentVariables(tool.name, tool.env || {});
|
|
328
335
|
// Execute the tool via the execution provider
|
package/dist/utils/env-loader.js
CHANGED
|
@@ -250,7 +250,7 @@ loadDotenv();
|
|
|
250
250
|
*/
|
|
251
251
|
export function getWebServerUrl() {
|
|
252
252
|
// For now, default to localhost:5555 as that's the standard port
|
|
253
|
-
// When running via MCP (npx -p
|
|
253
|
+
// When running via MCP (npx -p @enactprotocol/cli enact-mcp), the web server is automatically started
|
|
254
254
|
// TODO: In the future, we could check if the server is actually responding or get the port dynamically
|
|
255
255
|
return "http://localhost:5555";
|
|
256
256
|
}
|
package/dist/utils/help.js
CHANGED
package/package.json
CHANGED
package/src/core/EnactCore.ts
CHANGED
|
@@ -17,7 +17,7 @@ import logger from "../exec/logger.js";
|
|
|
17
17
|
import yaml from "yaml";
|
|
18
18
|
import fs from "fs";
|
|
19
19
|
import path from "path";
|
|
20
|
-
import { CryptoUtils, KeyManager, SigningService } from "@enactprotocol/security";
|
|
20
|
+
import { CryptoUtils, KeyManager, SecurityConfigManager, SigningService } from "@enactprotocol/security";
|
|
21
21
|
|
|
22
22
|
export interface EnactCoreOptions {
|
|
23
23
|
apiUrl?: string;
|
|
@@ -406,7 +406,6 @@ private async verifyTool(tool: EnactTool, dangerouslySkipVerification: boolean =
|
|
|
406
406
|
command: tool.command
|
|
407
407
|
};
|
|
408
408
|
|
|
409
|
-
// IGNORE DATABASE SIGNATURES - USE HARDCODED WORKING VALUES FOR TESTING
|
|
410
409
|
const referenceSignature = {
|
|
411
410
|
signature: tool.signatures[0].value,
|
|
412
411
|
publicKey: tool.signatures[0].signer,
|
|
@@ -474,9 +473,17 @@ private async verifyTool(tool: EnactTool, dangerouslySkipVerification: boolean =
|
|
|
474
473
|
|
|
475
474
|
// Validate inputs
|
|
476
475
|
const validatedInputs = validateInputs(tool, inputs);
|
|
477
|
-
|
|
476
|
+
const config = SecurityConfigManager.loadConfig();
|
|
477
|
+
|
|
478
|
+
if( options.isLocalFile && config.allowLocalUnsigned){
|
|
479
|
+
logger.warn(`Executing local file without signature verification: ${tool.name} (you can disallow in your security config)`);
|
|
480
|
+
}
|
|
481
|
+
if( options.dangerouslySkipVerification) {
|
|
482
|
+
logger.warn(`Skipping signature verification for tool: ${tool.name} because of dangerouslySkipVerification option`);
|
|
483
|
+
}
|
|
484
|
+
const skipVerification = (options.isLocalFile && config.allowLocalUnsigned) || Boolean(options.dangerouslySkipVerification);
|
|
478
485
|
// Verify tool signatures (unless explicitly skipped)
|
|
479
|
-
await this.verifyTool(tool,
|
|
486
|
+
await this.verifyTool(tool, skipVerification);
|
|
480
487
|
|
|
481
488
|
// Resolve environment variables
|
|
482
489
|
const { resolved: envVars } =
|
package/src/utils/env-loader.ts
CHANGED
|
@@ -344,7 +344,7 @@ loadDotenv();
|
|
|
344
344
|
*/
|
|
345
345
|
export function getWebServerUrl(): string | null {
|
|
346
346
|
// For now, default to localhost:5555 as that's the standard port
|
|
347
|
-
// When running via MCP (npx -p
|
|
347
|
+
// When running via MCP (npx -p @enactprotocol/cli enact-mcp), the web server is automatically started
|
|
348
348
|
// TODO: In the future, we could check if the server is actually responding or get the port dynamically
|
|
349
349
|
return "http://localhost:5555";
|
|
350
350
|
}
|