@seekrit/cli 0.20.0 → 0.21.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/index.js +12 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1976,7 +1976,7 @@ function isServiceToken(value) {
|
|
|
1976
1976
|
}
|
|
1977
1977
|
//#endregion
|
|
1978
1978
|
//#region package.json
|
|
1979
|
-
var version = "0.
|
|
1979
|
+
var version = "0.21.0";
|
|
1980
1980
|
//#endregion
|
|
1981
1981
|
//#region ../../packages/api-client/src/index.ts
|
|
1982
1982
|
var SeekritApiError = class extends Error {
|
|
@@ -2259,6 +2259,10 @@ var SeekritClient = class {
|
|
|
2259
2259
|
disableKmsKey(orgId, keyId) {
|
|
2260
2260
|
return this.request("POST", `/v1/orgs/${orgId}/kms/keys/${keyId}/disable`);
|
|
2261
2261
|
}
|
|
2262
|
+
/** Soft-delete a key: it drops out of every listing and read path. */
|
|
2263
|
+
deleteKmsKey(orgId, keyId) {
|
|
2264
|
+
return this.request("DELETE", `/v1/orgs/${orgId}/kms/keys/${keyId}`);
|
|
2265
|
+
}
|
|
2262
2266
|
/** The broker's public key — wrap the admin credential to it before registering a target. */
|
|
2263
2267
|
getLeaseBrokerKey(orgId) {
|
|
2264
2268
|
return this.request("GET", `/v1/orgs/${orgId}/leases/broker-key`);
|
|
@@ -3113,6 +3117,13 @@ function registerKmsCommands(program) {
|
|
|
3113
3117
|
await ctx.client.disableKmsKey(org.id, key.id);
|
|
3114
3118
|
console.error(`disabled ${key.name}`);
|
|
3115
3119
|
});
|
|
3120
|
+
kms.command("delete").description("delete a key (hides it from all listings; the name frees up for reuse)").requiredOption("--key <name>", "key name or id").option("--org <slug>").action(async (options) => {
|
|
3121
|
+
const ctx = buildContext();
|
|
3122
|
+
const org = await resolveOrg(ctx, options.org);
|
|
3123
|
+
const key = await kmsResolveKey(ctx, org.id, options.key);
|
|
3124
|
+
await ctx.client.deleteKmsKey(org.id, key.id);
|
|
3125
|
+
console.error(`deleted ${key.name}`);
|
|
3126
|
+
});
|
|
3116
3127
|
kms.command("encrypt").description("encrypt stdin under a key (prints a ce1 ciphertext blob)").requiredOption("--key <name>", "key name or id").option("--org <slug>").option("--context <ctx>", "encryption context bound as AAD (required identically to decrypt)").action(async (options) => {
|
|
3117
3128
|
const ctx = buildContext();
|
|
3118
3129
|
const org = await resolveOrg(ctx, options.org);
|