fix: unblock cli startup metadata

This commit is contained in:
Peter Steinberger
2026-04-04 02:35:23 +01:00
parent 143d377c5a
commit 1e6e685347
36 changed files with 674 additions and 79 deletions

View File

@@ -1,5 +1,5 @@
import { listSecretTargetRegistryEntries } from "./target-registry.js";
import { UNSUPPORTED_SECRETREF_SURFACE_PATTERNS } from "./unsupported-surface-policy.js";
import { getUnsupportedSecretRefSurfacePatterns } from "./unsupported-surface-policy.js";
type CredentialMatrixEntry = {
id: string;
@@ -54,7 +54,7 @@ export function buildSecretRefCredentialMatrix(): SecretRefCredentialMatrixDocum
pathSyntax: 'Dot path with "*" for map keys and "[]" for arrays.',
scope:
"Credentials that are strictly user-supplied and not minted/rotated by OpenClaw runtime.",
excludedMutableOrRuntimeManaged: [...UNSUPPORTED_SECRETREF_SURFACE_PATTERNS],
excludedMutableOrRuntimeManaged: getUnsupportedSecretRefSurfacePatterns(),
entries,
};
}

View File

@@ -1,12 +1,12 @@
import { describe, expect, it } from "vitest";
import {
collectUnsupportedSecretRefConfigCandidates,
UNSUPPORTED_SECRETREF_SURFACE_PATTERNS,
getUnsupportedSecretRefSurfacePatterns,
} from "./unsupported-surface-policy.js";
describe("unsupported SecretRef surface policy metadata", () => {
it("exposes the canonical unsupported surface patterns", () => {
expect(UNSUPPORTED_SECRETREF_SURFACE_PATTERNS).toEqual([
expect(getUnsupportedSecretRefSurfacePatterns()).toEqual([
"commands.ownerDisplaySecret",
"hooks.token",
"hooks.gmail.pushToken",

View File

@@ -26,10 +26,15 @@ function collectChannelUnsupportedSecretRefSurfacePatterns(): string[] {
);
}
export const UNSUPPORTED_SECRETREF_SURFACE_PATTERNS = [
...CORE_UNSUPPORTED_SECRETREF_SURFACE_PATTERNS,
...collectChannelUnsupportedSecretRefSurfacePatterns(),
] as const;
let cachedUnsupportedSecretRefSurfacePatterns: string[] | null = null;
export function getUnsupportedSecretRefSurfacePatterns(): string[] {
cachedUnsupportedSecretRefSurfacePatterns ??= [
...CORE_UNSUPPORTED_SECRETREF_SURFACE_PATTERNS,
...collectChannelUnsupportedSecretRefSurfacePatterns(),
];
return cachedUnsupportedSecretRefSurfacePatterns;
}
export type UnsupportedSecretRefConfigCandidate = {
path: string;