@eide/foir-cli 0.6.1 → 0.6.3
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 +12 -9
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -5238,6 +5238,7 @@ async function reconcileApiKeys(client, configKey, apiKeys, summary) {
|
|
|
5238
5238
|
for (const key of apiKeys) {
|
|
5239
5239
|
if (!key.name || !key.keyType || !key.envVar) continue;
|
|
5240
5240
|
const existingKey = existingByName.get(key.name);
|
|
5241
|
+
let rawKey;
|
|
5241
5242
|
if (existingKey) {
|
|
5242
5243
|
const wantScopes = (key.scopes ?? []).slice().sort();
|
|
5243
5244
|
const haveScopes = (existingKey.scopes ?? []).slice().sort();
|
|
@@ -5249,16 +5250,18 @@ async function reconcileApiKeys(client, configKey, apiKeys, summary) {
|
|
|
5249
5250
|
updateScopes: true
|
|
5250
5251
|
});
|
|
5251
5252
|
}
|
|
5252
|
-
|
|
5253
|
+
const rotated = await client.identity.rotateApiKey(existingKey.id);
|
|
5254
|
+
rawKey = rotated?.apiKey?.rawKey;
|
|
5255
|
+
} else {
|
|
5256
|
+
const result = await client.identity.createApiKey({
|
|
5257
|
+
name: key.name,
|
|
5258
|
+
keyType: key.keyType === "secret" ? 2 : 1,
|
|
5259
|
+
allowedModels: key.allowedModels,
|
|
5260
|
+
allowedFileTypes: key.allowedFileTypes,
|
|
5261
|
+
scopes: key.scopes
|
|
5262
|
+
});
|
|
5263
|
+
rawKey = result?.apiKey?.rawKey;
|
|
5253
5264
|
}
|
|
5254
|
-
const result = await client.identity.createApiKey({
|
|
5255
|
-
name: key.name,
|
|
5256
|
-
keyType: key.keyType === "secret" ? 2 : 1,
|
|
5257
|
-
allowedModels: key.allowedModels,
|
|
5258
|
-
allowedFileTypes: key.allowedFileTypes,
|
|
5259
|
-
scopes: key.scopes
|
|
5260
|
-
});
|
|
5261
|
-
const rawKey = result?.apiKey?.rawKey;
|
|
5262
5265
|
if (rawKey) {
|
|
5263
5266
|
summary.apiKeys.push({
|
|
5264
5267
|
name: key.name,
|