chore: tools/live signs tickets as the dashboard does, M5 passed on test-filius
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+5
-4
@@ -22,11 +22,12 @@ const SECRET = env.FILIUS_TICKET_SECRET!;
|
|||||||
const KEY = env.FILIUS_SERVICE_KEY!;
|
const KEY = env.FILIUS_SERVICE_KEY!;
|
||||||
export const made: string[] = [];
|
export const made: string[] = [];
|
||||||
/**
|
/**
|
||||||
* How many seconds before now the tickets are signed. F before
|
* How many seconds before now the tickets are signed (0: as the dashboard
|
||||||
* TICKET_AHEAD_SECONDS refused a ticket from its future, and test-filius'
|
* signs them). F before TICKET_AHEAD_SECONDS refused a ticket from its
|
||||||
* clock was behind this machine's (886 ms, then 8 ms with NTP).
|
* future, and test-filius' clock was behind this machine's (886 ms, then
|
||||||
|
* 8 ms with NTP); against such an F, 2 helps.
|
||||||
*/
|
*/
|
||||||
const SKEW_SECONDS = Number(process.env.SKEW_SECONDS ?? 2);
|
const SKEW_SECONDS = Number(process.env.SKEW_SECONDS ?? 0);
|
||||||
|
|
||||||
export async function svc(method: string, path: string, body?: unknown): Promise<{ status: number; json: any }> {
|
export async function svc(method: string, path: string, body?: unknown): Promise<{ status: number; json: any }> {
|
||||||
const r = await fetch(`${BASE}${path}`, { method, headers: { 'x-filius-service-key': KEY, 'content-type': 'application/json' }, ...(body === undefined ? {} : { body: JSON.stringify(body) }) });
|
const r = await fetch(`${BASE}${path}`, { method, headers: { 'x-filius-service-key': KEY, 'content-type': 'application/json' }, ...(body === undefined ? {} : { body: JSON.stringify(body) }) });
|
||||||
|
|||||||
Reference in New Issue
Block a user