| author | |
| committer | |
| log | cabac780f5d9566ea26d340c9f126a46664b698b |
| tree | 4c894686a23a9ebb8c750e0b3ff3de09b6ee98d4 |
| parent | 76f686d03456539f41ef295f0071fecb5df08921 |
| signature | Signed by PGP key B5690EEEBB952194 |
2 files changed, 1 insertions(+), 9 deletions(-)
apps/desktop/src/backend/DesktopBackendConfiguration.test.ts-8| ... | ... | @@ -218,14 +218,6 @@ const withPackagedWslHarness = <A, E, R>( |
| 218 | 218 | }).pipe(Effect.scoped, Effect.provide(NodeServices.layer)); |
| 219 | 219 | |
| 220 | 220 | describe("DesktopBackendConfiguration", () => { |
| 221 | it("accepts only normalized SHA-256 archive identities", () => { | |
| 222 | assert.equal( | |
| 223 | DesktopBackendConfiguration.parseWslRuntimeArchiveHash(` ${"A".repeat(64)}\n`), | |
| 224 | "a".repeat(64), | |
| 225 | ); | |
| 226 | assert.isNull(DesktopBackendConfiguration.parseWslRuntimeArchiveHash("abc123")); | |
| 227 | }); | |
| 228 | ||
| 229 | 221 | it.effect("resolvePrimary produces a stable scoped bootstrap token", () => |
| 230 | 222 | withHarness( |
| 231 | 223 | Effect.gen(function* () { |
apps/desktop/src/backend/DesktopBackendConfiguration.ts+1-1| ... | ... | @@ -243,7 +243,7 @@ const WSL_RUNTIME_ARCHIVE_NAME = "wsl-runtime.tar.gz"; |
| 243 | 243 | const WSL_RUNTIME_ARCHIVE_HASH_NAME = `${WSL_RUNTIME_ARCHIVE_NAME}.sha256`; |
| 244 | 244 | const SHA256_HEX_PATTERN = /^[0-9a-f]{64}$/i; |
| 245 | 245 | |
| 246 | export const parseWslRuntimeArchiveHash = (value: string): string | null => { | |
| 246 | const parseWslRuntimeArchiveHash = (value: string): string | null => { | |
| 247 | 247 | const trimmed = value.trim(); |
| 248 | 248 | return SHA256_HEX_PATTERN.test(trimmed) ? trimmed.toLowerCase() : null; |
| 249 | 249 | }; |