refactor(security): unify secure id paths and guard weak patterns

This commit is contained in:
Peter Steinberger
2026-02-22 10:14:55 +01:00
parent ae8d4a8eec
commit 6c2e999776
12 changed files with 167 additions and 54 deletions

View File

@@ -1,5 +1,5 @@
import { randomUUID } from "node:crypto";
import { resolveFetch } from "../infra/fetch.js";
import { generateSecureUuid } from "../infra/secure-random.js";
import { fetchWithTimeout } from "../utils/fetch-timeout.js";
export type SignalRpcOptions = {
@@ -53,7 +53,7 @@ export async function signalRpcRequest<T = unknown>(
opts: SignalRpcOptions,
): Promise<T> {
const baseUrl = normalizeBaseUrl(opts.baseUrl);
const id = randomUUID();
const id = generateSecureUuid();
const body = JSON.stringify({
jsonrpc: "2.0",
method,