sync: update from private repo (a360d15)
CI / build-and-test (push) Has been cancelled

This commit is contained in:
oss-sync
2026-06-09 09:19:09 +00:00
parent 44df3a7da1
commit 483464597a
11 changed files with 328 additions and 16 deletions
+10 -1
View File
@@ -11,6 +11,14 @@ export interface ScheduledTasksApiOptions {
* field is silently dropped (legacy / no-auth deployments).
*/
sessRepo?: BrowserSessionRepo;
/**
* Whether the auth subsystem is wired. When `false` (no-auth single-user
* deployment) requests carry no `req.user`, so new scheduled tasks (and the
* jobs the scheduler spawns from them) are owned by the stable `local` user
* instead of NULL — keeping per-task reflection / visibility consistent with
* the rest of the no-auth path. Defaults to `true`.
*/
authActive?: boolean;
}
export function mountScheduledTasksApi(
@@ -20,6 +28,7 @@ export function mountScheduledTasksApi(
apiOpts: ScheduledTasksApiOptions = {},
): void {
const { sessRepo } = apiOpts;
const noAuthOwner: string | null = (apiOpts.authActive ?? true) ? null : 'local';
/**
* Validate and resolve a browserSessionProfileId from a request body.
@@ -133,7 +142,7 @@ export function mountScheduledTasksApi(
return;
}
}
const ownerId = (req.user as Express.User | undefined)?.id ?? null;
const ownerId = (req.user as Express.User | undefined)?.id ?? noAuthOwner;
const profileBinding = resolveBrowserSessionProfileId(
req.body?.browserSessionProfileId,