@acarmisc/backstage-plugin-litellm-backend 0.16.1 → 0.17.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/bridge.d.ts +11 -0
- package/dist/bridge.js +40 -7
- package/dist/client.d.ts +6 -0
- package/dist/client.js +50 -0
- package/dist/index.cjs.js +119 -62
- package/dist/index.cjs.js.map +3 -3
- package/dist/routes/keys.js +9 -9
- package/package.json +1 -1
package/dist/routes/keys.js
CHANGED
|
@@ -343,15 +343,15 @@ function registerKeysRoutes(router, ctx) {
|
|
|
343
343
|
try {
|
|
344
344
|
const { keyId } = req.params;
|
|
345
345
|
const { tokenEntityRef, key } = await authorizeKeyAction(req, keyId);
|
|
346
|
-
//
|
|
347
|
-
//
|
|
348
|
-
//
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
346
|
+
// Unblocking always needs the dedicated permission, on top of ownership.
|
|
347
|
+
// `metadata.blocked_by` is deliberately NOT trusted here: it lives in a
|
|
348
|
+
// record the owner can influence (older keys, or a stale value left after
|
|
349
|
+
// an admin unblocked in the LiteLLM UI), so "I blocked it myself" can't be
|
|
350
|
+
// told apart from "an admin blocked it". Grant `litellm.key.unblock` only
|
|
351
|
+
// to roles that may lift blocks; everyone else asks an administrator.
|
|
352
|
+
if (!(await assertPermission(req, backstage_plugin_litellm_common_1.litellmKeyUnblockPermission))) {
|
|
353
|
+
sendPermissionDenied(res, backstage_plugin_litellm_common_1.litellmKeyUnblockPermission);
|
|
354
|
+
return;
|
|
355
355
|
}
|
|
356
356
|
await client.unblockKey(keyId);
|
|
357
357
|
// Clear the block record on unblock. Set the fields to null rather than
|