@rightkit/release 0.2.35 → 0.2.36

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rightkit/release",
3
- "version": "0.2.35",
3
+ "version": "0.2.36",
4
4
  "description": "Portable Right Suite release CLI/SDK: signed installers, updater artifacts, patch/update routing, hardening, R2 publish, and RightApps registration.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -10,6 +10,7 @@ const root = path.dirname(fileURLToPath(import.meta.url));
10
10
  const cli = path.join(root, "cli", "right-release.mjs");
11
11
  const build = path.join(root, "build-release.mjs");
12
12
  const upload = path.join(root, "upload-release.mjs");
13
+ const signWindows = path.join(root, "sign-windows.mjs");
13
14
 
14
15
  test("CLI routes build and release only to the build state machine", () => {
15
16
  const source = readFileSync(cli, "utf8");
@@ -41,3 +42,13 @@ test("upload requires an explicit patch or update tier before reading a release"
41
42
  assert.notEqual(result.status, 0);
42
43
  assert.match(result.stderr, /tier is required.*patch\|update/i);
43
44
  });
45
+
46
+ test("Windows upload trust verification uses signtool instead of PowerShell modules", () => {
47
+ const uploadSource = readFileSync(upload, "utf8");
48
+ const signingSource = readFileSync(signWindows, "utf8");
49
+ assert.match(uploadSource, /SIGN_WINDOWS/);
50
+ assert.match(uploadSource, /--verify-only/);
51
+ assert.doesNotMatch(uploadSource, /Get-AuthenticodeSignature/);
52
+ assert.match(signingSource, /verifyOnly/);
53
+ assert.match(signingSource, /\["verify", "\/pa", "\/v", file\]/);
54
+ });
@@ -317,7 +317,7 @@ test("Cargo version contract rejects staged versions that mismatch canonical man
317
317
  test("RightKit exposes one current version manifest", () => {
318
318
  assert.equal(existsSync(versionsPath), true, "rightkit-versions.json must be the single current-version source");
319
319
  assert.match(versions.packageManager, /^pnpm@\d+\.\d+\.\d+$/);
320
- assert.equal(versions.npm["@rightkit/release"], "0.2.35");
320
+ assert.equal(versions.npm["@rightkit/release"], "0.2.36");
321
321
  assert.equal(versions.npm["@rightkit/legal"], "0.2.0");
322
322
  assert.equal(versions.npm["@rightkit/license"], "0.1.5");
323
323
  assert.equal(versions.npm["@rightkit/logs"], "0.1.3");
@@ -7,7 +7,7 @@
7
7
  "@rightkit/logs": "0.1.3",
8
8
  "@rightkit/platform-ui": "0.1.0",
9
9
  "@rightkit/qa": "0.1.0",
10
- "@rightkit/release": "0.2.35",
10
+ "@rightkit/release": "0.2.36",
11
11
  "@rightkit/tauri": "0.1.0",
12
12
  "@rightkit/updates": "0.2.3"
13
13
  },
package/sign-windows.mjs CHANGED
@@ -18,17 +18,24 @@ const userEnvCache = new Map();
18
18
 
19
19
  const args = process.argv.slice(2);
20
20
  const dryRun = args.includes("--dry-run");
21
- const files = args.filter((arg) => arg !== "--dry-run").map((arg) => path.resolve(arg));
21
+ const verifyOnly = args.includes("--verify-only");
22
+ const files = args.filter((arg) => arg !== "--dry-run" && arg !== "--verify-only").map((arg) => path.resolve(arg));
22
23
 
23
- if (!files.length) fail("usage: node sign-windows.mjs [--dry-run] <file>...");
24
+ if (!files.length) fail("usage: node sign-windows.mjs [--dry-run|--verify-only] <file>...");
24
25
  if (dryRun) {
25
- console.log(`dry-run: Azure Artifact Signing ${files.join(", ")}`);
26
+ console.log(`dry-run: ${verifyOnly ? "Authenticode verification" : "Azure Artifact Signing"} ${files.join(", ")}`);
26
27
  process.exit(0);
27
28
  }
28
29
  if (process.platform !== "win32") fail("Windows signing must run on Windows");
29
30
  for (const file of files) if (!existsSync(file)) fail(`missing file: ${file}`);
30
31
 
32
+ const childEnv = signingEnv();
31
33
  const signtool = findFirst([env("AZURE_SIGNTOOL_PATH"), env("SIGNTOOL_PATH"), ...signtoolCandidates()]);
34
+ if (!signtool) fail("signtool.exe not found; set AZURE_SIGNTOOL_PATH or install Windows SDK Build Tools");
35
+ if (verifyOnly) {
36
+ for (const file of files) run(signtool, ["verify", "/pa", "/v", file]);
37
+ process.exit(0);
38
+ }
32
39
  const dlib = findFirst([
33
40
  env("AZURE_CODESIGN_DLIB_PATH"),
34
41
  env("AZURE_ARTIFACT_SIGNING_DLIB_PATH"),
@@ -36,12 +43,10 @@ const dlib = findFirst([
36
43
  "C:\\Program Files\\Microsoft Azure Artifact Signing Client Tools\\x64\\Azure.CodeSigning.Dlib.dll",
37
44
  "C:\\Program Files (x86)\\Microsoft\\ArtifactSigningClientTools\\bin\\x64\\Azure.CodeSigning.Dlib.dll",
38
45
  ]);
39
- if (!signtool) fail("signtool.exe not found; set AZURE_SIGNTOOL_PATH or install Windows SDK Build Tools");
40
46
  if (!dlib) fail("Azure.CodeSigning.Dlib.dll not found; set AZURE_CODESIGN_DLIB_PATH or install Azure Artifact Signing Client Tools");
41
47
 
42
48
  const tempDir = mkdtempSync(path.join(os.tmpdir(), "right-sign-"));
43
49
  const metadata = metadataPath(tempDir);
44
- const childEnv = signingEnv();
45
50
  try {
46
51
  for (const file of files) {
47
52
  run(signtool, ["sign", "/v", "/fd", "SHA256", "/tr", "http://timestamp.acs.microsoft.com", "/td", "SHA256", "/dlib", dlib, "/dmdf", metadata, file]);
@@ -9,6 +9,7 @@ import { runUploadStateMachine, verifySealedRelease } from "./release-state.mjs"
9
9
  const TOOL_ROOT = path.dirname(fileURLToPath(import.meta.url));
10
10
  const PUBLISH_UPDATE = path.join(TOOL_ROOT, "publish-update.mjs");
11
11
  const HARDENING = path.join(TOOL_ROOT, "hardeningscan.mjs");
12
+ const SIGN_WINDOWS = path.join(TOOL_ROOT, "sign-windows.mjs");
12
13
  const UPLOAD = path.join(TOOL_ROOT, "upload-large.mjs");
13
14
  const PUBLIC_BASE = (process.env.RIGHTAPPS_PUBLIC_DOWNLOAD_BASE || "https://pub-6c73208d46c245a9b4881d5e02f6b618.r2.dev").replace(/\/$/, "");
14
15
  const API_BASE = (process.env.RIGHTAPPS_API_URL || "https://api.spoares.com").replace(/\/$/, "");
@@ -73,9 +74,7 @@ function verifyPlatformTrust(release) {
73
74
  if (platform === "win") {
74
75
  for (const artifact of artifacts) {
75
76
  const file = path.join(release.sealedDir, artifact.name);
76
- const escaped = file.replaceAll("'", "''");
77
- const status = commandOutput("powershell", ["-NoProfile", "-Command", `(Get-AuthenticodeSignature -LiteralPath '${escaped}').Status`]);
78
- if (status.trim() !== "Valid") throw new Error(`Authenticode verification failed for ${artifact.name}: ${status}`);
77
+ runChecked(process.execPath, [SIGN_WINDOWS, "--verify-only", file], repoRoot);
79
78
  }
80
79
  } else {
81
80
  for (const artifact of artifacts.filter((file) => /\.dmg$/i.test(file.name))) {