@jeffusion/bungee-core 5.22.0 → 5.23.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/main.js +3382 -3104
- package/dist/plugins/anthropic-request-sanitizer/index.js.map +2 -2
- package/dist/plugins/anthropic-tool-name-transformer/index.js.map +2 -2
- package/dist/plugins/chatgpt-oauth/control.js.map +2 -2
- package/dist/plugins/chatgpt-oauth/index.js +20 -7
- package/dist/plugins/chatgpt-oauth/index.js.map +6 -6
- package/dist/plugins/codex-router/index.js +174 -80
- package/dist/plugins/codex-router/index.js.map +8 -8
- package/dist/plugins/codex-router/manifest.json +63 -12
- package/dist/plugins/deepseek-reasoning-fix/index.js.map +2 -2
- package/dist/plugins/key-access/control.js.map +3 -3
- package/dist/plugins/key-access/index.js +19 -5
- package/dist/plugins/key-access/index.js.map +6 -6
- package/dist/plugins/key-access/ingress.js +19 -5
- package/dist/plugins/key-access/ingress.js.map +6 -6
- package/dist/plugins/key-rate-limit/index.js.map +2 -2
- package/dist/plugins/llm-protocol-adapter/control.js +785 -209
- package/dist/plugins/llm-protocol-adapter/control.js.map +21 -17
- package/dist/plugins/llm-protocol-adapter/index.js +861 -208
- package/dist/plugins/llm-protocol-adapter/index.js.map +21 -17
- package/dist/plugins/llm-protocol-adapter/manifest.json +7 -0
- package/dist/plugins/local-accounts/control.js.map +2 -2
- package/dist/plugins/local-accounts/index.js.map +2 -2
- package/dist/plugins/model-mapping/index.js.map +2 -2
- package/dist/plugins/models-dev/index.js.map +2 -2
- package/dist/plugins/signature-repair/index.js.map +2 -2
- package/dist/plugins/token-budget/control.js.map +2 -2
- package/dist/plugins/token-budget/index.js.map +3 -3
- package/dist/plugins/token-metering/index.js +9 -9
- package/dist/plugins/token-metering/index.js.map +7 -7
- package/dist/plugins/token-stats/control.js.map +2 -2
- package/dist/plugins/token-stats/index.js.map +3 -3
- package/dist/plugins/token-stats/ui/PriceModelPicker.svelte +3 -3
- package/package.json +2 -2
|
@@ -212,8 +212,22 @@ function check(target, policy, scopes = [target.routeId]) {
|
|
|
212
212
|
return { error: "key-access.scope_denied", status: 403 };
|
|
213
213
|
return null;
|
|
214
214
|
}
|
|
215
|
+
function authorize(target, value) {
|
|
216
|
+
try {
|
|
217
|
+
const publication = validatePublication(value);
|
|
218
|
+
const scopes = protectedScopes(target, publication);
|
|
219
|
+
if (scopes.length === 0)
|
|
220
|
+
return null;
|
|
221
|
+
if (target.principal.domain === "anonymous")
|
|
222
|
+
return { error: "unauthorized", status: 401 };
|
|
223
|
+
return check(target, validatePolicy(publication.byKey[target.principal.keyId] ?? null), scopes);
|
|
224
|
+
} catch {
|
|
225
|
+
return { error: "key-access.policy_unavailable", status: 503 };
|
|
226
|
+
}
|
|
227
|
+
}
|
|
215
228
|
function createIngress() {
|
|
216
229
|
return {
|
|
230
|
+
authorize,
|
|
217
231
|
bodyRequirements(target, value) {
|
|
218
232
|
const publication = validatePublication(value);
|
|
219
233
|
if (protectedScopes(target, publication).length === 0 || target.principal.domain !== "data")
|
|
@@ -247,12 +261,12 @@ function createIngress() {
|
|
|
247
261
|
const p = validatePublication(value);
|
|
248
262
|
if (protectedScopes(target, p).length === 0)
|
|
249
263
|
return { snapshot: null };
|
|
250
|
-
|
|
251
|
-
|
|
264
|
+
const denial = authorize(target, p);
|
|
265
|
+
if (denial)
|
|
266
|
+
return { denial };
|
|
252
267
|
const policy = validatePolicy(p.byKey[target.principal.keyId] ?? null);
|
|
253
268
|
const scopes = protectedScopes(target, p);
|
|
254
|
-
|
|
255
|
-
return denial ? { denial } : { snapshot: { routeId: target.routeId, entryRouteId: target.entryRouteId ?? null, scopes, policy } };
|
|
269
|
+
return { snapshot: { routeId: target.routeId, entryRouteId: target.entryRouteId ?? null, scopes, policy } };
|
|
256
270
|
} catch {
|
|
257
271
|
return { denial: { error: "key-access.policy_unavailable", status: 503 } };
|
|
258
272
|
}
|
|
@@ -302,4 +316,4 @@ export {
|
|
|
302
316
|
server_default as default
|
|
303
317
|
};
|
|
304
318
|
|
|
305
|
-
//# debugId=
|
|
319
|
+
//# debugId=6A0764E4E24B544564756E2164756E21
|