@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
|
@@ -210,8 +210,22 @@ function check(target, policy, scopes = [target.routeId]) {
|
|
|
210
210
|
return { error: "key-access.scope_denied", status: 403 };
|
|
211
211
|
return null;
|
|
212
212
|
}
|
|
213
|
+
function authorize(target, value) {
|
|
214
|
+
try {
|
|
215
|
+
const publication = validatePublication(value);
|
|
216
|
+
const scopes = protectedScopes(target, publication);
|
|
217
|
+
if (scopes.length === 0)
|
|
218
|
+
return null;
|
|
219
|
+
if (target.principal.domain === "anonymous")
|
|
220
|
+
return { error: "unauthorized", status: 401 };
|
|
221
|
+
return check(target, validatePolicy(publication.byKey[target.principal.keyId] ?? null), scopes);
|
|
222
|
+
} catch {
|
|
223
|
+
return { error: "key-access.policy_unavailable", status: 503 };
|
|
224
|
+
}
|
|
225
|
+
}
|
|
213
226
|
function createIngress() {
|
|
214
227
|
return {
|
|
228
|
+
authorize,
|
|
215
229
|
bodyRequirements(target, value) {
|
|
216
230
|
const publication = validatePublication(value);
|
|
217
231
|
if (protectedScopes(target, publication).length === 0 || target.principal.domain !== "data")
|
|
@@ -245,12 +259,12 @@ function createIngress() {
|
|
|
245
259
|
const p = validatePublication(value);
|
|
246
260
|
if (protectedScopes(target, p).length === 0)
|
|
247
261
|
return { snapshot: null };
|
|
248
|
-
|
|
249
|
-
|
|
262
|
+
const denial = authorize(target, p);
|
|
263
|
+
if (denial)
|
|
264
|
+
return { denial };
|
|
250
265
|
const policy = validatePolicy(p.byKey[target.principal.keyId] ?? null);
|
|
251
266
|
const scopes = protectedScopes(target, p);
|
|
252
|
-
|
|
253
|
-
return denial ? { denial } : { snapshot: { routeId: target.routeId, entryRouteId: target.entryRouteId ?? null, scopes, policy } };
|
|
267
|
+
return { snapshot: { routeId: target.routeId, entryRouteId: target.entryRouteId ?? null, scopes, policy } };
|
|
254
268
|
} catch {
|
|
255
269
|
return { denial: { error: "key-access.policy_unavailable", status: 503 } };
|
|
256
270
|
}
|
|
@@ -277,4 +291,4 @@ export {
|
|
|
277
291
|
validatePublication
|
|
278
292
|
};
|
|
279
293
|
|
|
280
|
-
//# debugId=
|
|
294
|
+
//# debugId=D0FC8EE0A47A039A64756E2164756E21
|