ccqa 1.53.0 → 1.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin/ccqa.mjs
CHANGED
|
@@ -31531,18 +31531,21 @@ z.object({
|
|
|
31531
31531
|
//#endregion
|
|
31532
31532
|
//#region src/hub/api/auth.ts
|
|
31533
31533
|
/**
|
|
31534
|
-
*
|
|
31535
|
-
*
|
|
31536
|
-
*
|
|
31537
|
-
*
|
|
31538
|
-
* carry a header), a `?token=` query parameter — see docs/hub-api.md for
|
|
31539
|
-
* the security tradeoff that accepts.
|
|
31534
|
+
* Reads the token from `Authorization: Bearer <token>`, or — on GET only —
|
|
31535
|
+
* from `?token=`. A query token leaks through `Referer`, history and proxy
|
|
31536
|
+
* logs, so it is accepted only where a browser `<a>` can't send a header;
|
|
31537
|
+
* see docs/hub-api.md.
|
|
31540
31538
|
*/
|
|
31541
31539
|
function extractToken(req, url) {
|
|
31542
31540
|
const header = req.headers.authorization;
|
|
31543
31541
|
if (header?.startsWith("Bearer ")) return header.slice(7);
|
|
31542
|
+
if (req.method !== "GET") return null;
|
|
31544
31543
|
return url.searchParams.get("token");
|
|
31545
31544
|
}
|
|
31545
|
+
/**
|
|
31546
|
+
* Constant-time comparison against the hub's bearer token, so response
|
|
31547
|
+
* timing can't be used to guess the token character-by-character.
|
|
31548
|
+
*/
|
|
31546
31549
|
function isValidToken(provided, expected) {
|
|
31547
31550
|
if (provided === null) return false;
|
|
31548
31551
|
const a = Buffer.from(provided);
|
|
@@ -35,9 +35,9 @@ declare const RunSchema: z.ZodObject<{
|
|
|
35
35
|
running: "running";
|
|
36
36
|
}>;
|
|
37
37
|
kind: z.ZodDefault<z.ZodEnum<{
|
|
38
|
+
record: "record";
|
|
38
39
|
run: "run";
|
|
39
40
|
drift: "drift";
|
|
40
|
-
record: "record";
|
|
41
41
|
}>>;
|
|
42
42
|
drift: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
43
43
|
specs: z.ZodNumber;
|
|
@@ -831,9 +831,9 @@ type ReportSpecResult = z.infer<typeof ReportSpecResultSchema>;
|
|
|
831
831
|
declare const RunReportDataSchema: z.ZodObject<{
|
|
832
832
|
schemaVersion: z.ZodLiteral<1>;
|
|
833
833
|
kind: z.ZodDefault<z.ZodEnum<{
|
|
834
|
+
record: "record";
|
|
834
835
|
run: "run";
|
|
835
836
|
drift: "drift";
|
|
836
|
-
record: "record";
|
|
837
837
|
}>>;
|
|
838
838
|
createdAt: z.ZodString;
|
|
839
839
|
runId: z.ZodNullable<z.ZodString>;
|
|
@@ -35,9 +35,9 @@ declare const RunSchema: z.ZodObject<{
|
|
|
35
35
|
running: "running";
|
|
36
36
|
}>;
|
|
37
37
|
kind: z.ZodDefault<z.ZodEnum<{
|
|
38
|
+
record: "record";
|
|
38
39
|
run: "run";
|
|
39
40
|
drift: "drift";
|
|
40
|
-
record: "record";
|
|
41
41
|
}>>;
|
|
42
42
|
drift: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
43
43
|
specs: z.ZodNumber;
|
|
@@ -831,9 +831,9 @@ type ReportSpecResult = z.infer<typeof ReportSpecResultSchema>;
|
|
|
831
831
|
declare const RunReportDataSchema: z.ZodObject<{
|
|
832
832
|
schemaVersion: z.ZodLiteral<1>;
|
|
833
833
|
kind: z.ZodDefault<z.ZodEnum<{
|
|
834
|
+
record: "record";
|
|
834
835
|
run: "run";
|
|
835
836
|
drift: "drift";
|
|
836
|
-
record: "record";
|
|
837
837
|
}>>;
|
|
838
838
|
createdAt: z.ZodString;
|
|
839
839
|
runId: z.ZodNullable<z.ZodString>;
|
package/dist/package.json
CHANGED