Preserve independent proposer checks, canonical Admin UUID allowlist and deny ordinary admins. Revalidate pinned owner in read-only CI preflight; expose server-advertised card decisions and distinguish reservation from unknown real cost. Verified backend 42 HTTP/service/config tests and build; admin 18 relevant tests, app tsc and Vite build; 3 CI config tests and bash syntax.
10 lines
592 B
TypeScript
10 lines
592 B
TypeScript
import type { WorkflowConfig } from './prepare-workflow.service';
|
|
/** Startup-only configuration; HTTP payloads can never supply reviewer grants. */
|
|
export function workflowConfig(env: NodeJS.ProcessEnv): WorkflowConfig {
|
|
const raw = env.CANINA_ENV === 'staging' ? env.CANINA_WORKFLOW_OWNER_REVIEWER_IDS ?? '' : '';
|
|
const ids = raw ? raw.split(',') : [];
|
|
if (ids.length > 20 || ids.some(id => !/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/.test(id)))
|
|
throw new Error('Invalid owner reviewer UUID allowlist');
|
|
return {workerIds:[],stageCiIds:[],ownerReviewerIds:[...new Set(ids)]};
|
|
}
|