codiedev 0.9.49 → 0.9.50
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/hook.js +5 -1
- package/dist/securityPolicy.d.ts +8 -0
- package/dist/securityPolicy.js +16 -4
- package/package.json +1 -1
package/dist/hook.js
CHANGED
|
@@ -366,7 +366,11 @@ async function runSecurityEventUpload() {
|
|
|
366
366
|
endpointName: config.deviceName,
|
|
367
367
|
cliVersion: version_1.CLI_VERSION,
|
|
368
368
|
});
|
|
369
|
-
const result = await postJsonForResponse(`${config.backendUrl}/api/cli/securityEvent`, { ...eventWithEndpoint }, config.token,
|
|
369
|
+
const result = await postJsonForResponse(`${config.backendUrl}/api/cli/securityEvent`, { ...eventWithEndpoint }, config.token,
|
|
370
|
+
// Leave room for a cold backend and durable scheduling. This uploader is
|
|
371
|
+
// detached, so the network budget never delays the developer's prompt or
|
|
372
|
+
// tool call. Policy refreshes use the separately signed sync endpoint.
|
|
373
|
+
5_000);
|
|
370
374
|
if (result?.policy?.schemaVersion === 1) {
|
|
371
375
|
(0, securityPolicy_1.writeEndpointSecurityPolicy)(result.policy, undefined, undefined, config.companyId);
|
|
372
376
|
}
|
package/dist/securityPolicy.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import type { AgentSurface, EndpointSecurityPolicy } from "./security";
|
|
2
2
|
export type TrustedPolicyKeys = Record<string, string>;
|
|
3
|
+
/**
|
|
4
|
+
* Vendor policy roots are compiled into the endpoint binary. This prevents a
|
|
5
|
+
* compromised control-plane response from introducing the key that verifies
|
|
6
|
+
* that same response. Additional customer-managed roots may still be supplied
|
|
7
|
+
* through CODIEDEV_SECURITY_POLICY_PUBLIC_KEYS, but they cannot replace the
|
|
8
|
+
* Codiedev production root with the same key id.
|
|
9
|
+
*/
|
|
10
|
+
export declare const BUILT_IN_POLICY_KEYS: TrustedPolicyKeys;
|
|
3
11
|
export declare function trustedPolicyKeysFromEnvironment(env?: NodeJS.ProcessEnv): TrustedPolicyKeys;
|
|
4
12
|
export declare function verifyEndpointSecurityPolicySignature(policy: EndpointSecurityPolicy, trustedKeys?: TrustedPolicyKeys): {
|
|
5
13
|
ok: boolean;
|
package/dist/securityPolicy.js
CHANGED
|
@@ -33,6 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.BUILT_IN_POLICY_KEYS = void 0;
|
|
36
37
|
exports.trustedPolicyKeysFromEnvironment = trustedPolicyKeysFromEnvironment;
|
|
37
38
|
exports.verifyEndpointSecurityPolicySignature = verifyEndpointSecurityPolicySignature;
|
|
38
39
|
exports.readEndpointSecurityPolicy = readEndpointSecurityPolicy;
|
|
@@ -52,6 +53,16 @@ function policyFile(companyId) {
|
|
|
52
53
|
const scope = companyId.replace(/[^A-Za-z0-9_-]/g, "_").slice(0, 128);
|
|
53
54
|
return `security-policy.${scope}.json`;
|
|
54
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Vendor policy roots are compiled into the endpoint binary. This prevents a
|
|
58
|
+
* compromised control-plane response from introducing the key that verifies
|
|
59
|
+
* that same response. Additional customer-managed roots may still be supplied
|
|
60
|
+
* through CODIEDEV_SECURITY_POLICY_PUBLIC_KEYS, but they cannot replace the
|
|
61
|
+
* Codiedev production root with the same key id.
|
|
62
|
+
*/
|
|
63
|
+
exports.BUILT_IN_POLICY_KEYS = {
|
|
64
|
+
"codiedev-prod-2026-01": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA0H+UISjTn4zhd6Pk9YmrMBqnJEJmv9fXoavXorlV2cU=\n-----END PUBLIC KEY-----\n",
|
|
65
|
+
};
|
|
55
66
|
function stableJson(value) {
|
|
56
67
|
if (Array.isArray(value))
|
|
57
68
|
return `[${value.map(stableJson).join(",")}]`;
|
|
@@ -66,16 +77,17 @@ function stableJson(value) {
|
|
|
66
77
|
function trustedPolicyKeysFromEnvironment(env = process.env) {
|
|
67
78
|
const raw = env.CODIEDEV_SECURITY_POLICY_PUBLIC_KEYS;
|
|
68
79
|
if (!raw)
|
|
69
|
-
return {};
|
|
80
|
+
return { ...exports.BUILT_IN_POLICY_KEYS };
|
|
70
81
|
try {
|
|
71
82
|
const parsed = JSON.parse(raw);
|
|
72
83
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
73
|
-
return {};
|
|
74
|
-
|
|
84
|
+
return { ...exports.BUILT_IN_POLICY_KEYS };
|
|
85
|
+
const configured = Object.fromEntries(Object.entries(parsed)
|
|
75
86
|
.filter((entry) => typeof entry[1] === "string"));
|
|
87
|
+
return { ...configured, ...exports.BUILT_IN_POLICY_KEYS };
|
|
76
88
|
}
|
|
77
89
|
catch {
|
|
78
|
-
return {};
|
|
90
|
+
return { ...exports.BUILT_IN_POLICY_KEYS };
|
|
79
91
|
}
|
|
80
92
|
}
|
|
81
93
|
function verifyEndpointSecurityPolicySignature(policy, trustedKeys = trustedPolicyKeysFromEnvironment()) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codiedev",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.50",
|
|
4
4
|
"description": "Connect Claude Code, Codex, Cursor, OpenCode, or VS Code Copilot to Codiedev for team session capture and artifact collaboration — and run the governed Codie harness",
|
|
5
5
|
"bin": {
|
|
6
6
|
"codiedev": "dist/cli.js",
|