shield-llm 0.5.0 → 0.5.1
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/cli.js +8 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -34,7 +34,7 @@ import "dotenv/config";
|
|
|
34
34
|
import { Command, CommanderError } from "commander";
|
|
35
35
|
|
|
36
36
|
// package.json
|
|
37
|
-
var version = "0.5.
|
|
37
|
+
var version = "0.5.1";
|
|
38
38
|
|
|
39
39
|
// src/credentials.ts
|
|
40
40
|
import {
|
|
@@ -249,6 +249,13 @@ async function request(creds, method, path, body) {
|
|
|
249
249
|
method,
|
|
250
250
|
headers: {
|
|
251
251
|
Authorization: `Bearer ${creds.apiKey}`,
|
|
252
|
+
// The /api/benchmark/* routes are dual-auth (browser session OR API
|
|
253
|
+
// key), so — unlike the API-key-only /api/cli/* routes — they are NOT
|
|
254
|
+
// exempt from the middleware's CSRF same-origin check. A non-browser
|
|
255
|
+
// client sends no Origin and is rejected with 403 "Invalid origin".
|
|
256
|
+
// Send Origin = the configured backend so the same-origin check passes.
|
|
257
|
+
// API-key auth carries no ambient-cookie CSRF risk, so this is safe.
|
|
258
|
+
Origin: new URL(creds.apiUrl).origin,
|
|
252
259
|
...body !== void 0 && { "Content-Type": "application/json" }
|
|
253
260
|
},
|
|
254
261
|
...body !== void 0 && { body: JSON.stringify(body) }
|