@seekrit/cli 1.9.1 → 1.9.2
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 +363 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -864,6 +864,12 @@ const ENTITLEMENT_KEYS = Object.keys({
|
|
|
864
864
|
description: "Push environment secrets to external platforms like Vercel.",
|
|
865
865
|
default: true
|
|
866
866
|
},
|
|
867
|
+
"feature.vault": {
|
|
868
|
+
kind: "feature",
|
|
869
|
+
label: "Vault",
|
|
870
|
+
description: "Capture, hold and apply your end users' credentials for an agent — without your systems or seekrit ever holding a plaintext.",
|
|
871
|
+
default: true
|
|
872
|
+
},
|
|
867
873
|
"apps.max": {
|
|
868
874
|
kind: "limit",
|
|
869
875
|
label: "Applications",
|
|
@@ -924,6 +930,12 @@ const ENTITLEMENT_KEYS = Object.keys({
|
|
|
924
930
|
description: "Maximum secrets with managed rotation configured.",
|
|
925
931
|
default: null
|
|
926
932
|
},
|
|
933
|
+
"vault.connections.max": {
|
|
934
|
+
kind: "limit",
|
|
935
|
+
label: "Vault connections",
|
|
936
|
+
description: "Maximum active end-user connections across the organization's Vault projects.",
|
|
937
|
+
default: null
|
|
938
|
+
},
|
|
927
939
|
members: {
|
|
928
940
|
kind: "metered",
|
|
929
941
|
label: "Members",
|
|
@@ -2031,7 +2043,25 @@ const AUDIT_ACTIONS = [
|
|
|
2031
2043
|
"change_request.rejected",
|
|
2032
2044
|
"change_request.withdrawn",
|
|
2033
2045
|
"change_request.applied",
|
|
2034
|
-
"change_request.superseded"
|
|
2046
|
+
"change_request.superseded",
|
|
2047
|
+
"vault.project.created",
|
|
2048
|
+
"vault.project.updated",
|
|
2049
|
+
"vault.key.created",
|
|
2050
|
+
"vault.key.revoked",
|
|
2051
|
+
"vault.registration_code.created",
|
|
2052
|
+
"vault.executor.registered",
|
|
2053
|
+
"vault.executor.disabled",
|
|
2054
|
+
"vault.executor.key_added",
|
|
2055
|
+
"vault.executor.catalog_updated",
|
|
2056
|
+
"vault.connect_session.created",
|
|
2057
|
+
"vault.connection.created",
|
|
2058
|
+
"vault.connection.reauth_required",
|
|
2059
|
+
"vault.connection.reactivated",
|
|
2060
|
+
"vault.connection.revoked",
|
|
2061
|
+
"vault.credential.written",
|
|
2062
|
+
"vault.credential.release_denied",
|
|
2063
|
+
"vault.webhook.created",
|
|
2064
|
+
"vault.webhook.deleted"
|
|
2035
2065
|
];
|
|
2036
2066
|
/**
|
|
2037
2067
|
* Transactional notification emails seekrit can send. Each id is one
|
|
@@ -3998,6 +4028,291 @@ z.object({
|
|
|
3998
4028
|
enabled: z.boolean().optional()
|
|
3999
4029
|
});
|
|
4000
4030
|
//#endregion
|
|
4031
|
+
//#region ../../packages/core/src/vault.ts
|
|
4032
|
+
/** One encrypted credential within a connection. */
|
|
4033
|
+
const VAULT_SLOTS = [
|
|
4034
|
+
"oauth2",
|
|
4035
|
+
"api_key",
|
|
4036
|
+
"session",
|
|
4037
|
+
"login"
|
|
4038
|
+
];
|
|
4039
|
+
const VAULT_CONNECTION_STATUSES = [
|
|
4040
|
+
"active",
|
|
4041
|
+
"reauth_required",
|
|
4042
|
+
"revoked"
|
|
4043
|
+
];
|
|
4044
|
+
const VAULT_CONNECT_SESSION_MAX_TTL_SECONDS = 86400;
|
|
4045
|
+
/** Ciphertext bound: a `sc1.` blob of a 512 KiB session, with room for base64. */
|
|
4046
|
+
const VAULT_CIPHERTEXT_MAX_CHARS = 819200;
|
|
4047
|
+
/** Never above Browser Run's keep-alive ceiling, whatever a site profile asks for. */
|
|
4048
|
+
const VAULT_LEASE_MAX_MS = 12e5;
|
|
4049
|
+
const VAULT_LEASE_MIN_MS = 1e4;
|
|
4050
|
+
/** Fields `browser.fill` can type from a `login` slot. */
|
|
4051
|
+
const VAULT_FILL_FIELDS = [
|
|
4052
|
+
"username",
|
|
4053
|
+
"password",
|
|
4054
|
+
"totp"
|
|
4055
|
+
];
|
|
4056
|
+
const VAULT_WEBHOOK_EVENTS = [
|
|
4057
|
+
"connection.ready",
|
|
4058
|
+
"connection.reauth_required",
|
|
4059
|
+
"connection.revoked"
|
|
4060
|
+
];
|
|
4061
|
+
const base64urlMember = z.string().regex(/^[A-Za-z0-9_-]{43}$/, "not a P-256 coordinate");
|
|
4062
|
+
const vaultPublicJwkSchema = z.object({
|
|
4063
|
+
kty: z.literal("EC"),
|
|
4064
|
+
crv: z.literal("P-256"),
|
|
4065
|
+
x: base64urlMember,
|
|
4066
|
+
y: base64urlMember
|
|
4067
|
+
});
|
|
4068
|
+
const isoInstant = z.iso.datetime({ offset: true });
|
|
4069
|
+
z.object({
|
|
4070
|
+
v: z.literal(1),
|
|
4071
|
+
accessToken: z.string().min(1).max(16384),
|
|
4072
|
+
tokenType: z.literal("Bearer"),
|
|
4073
|
+
accessTokenExpiresAt: isoInstant.optional(),
|
|
4074
|
+
refreshToken: z.string().min(1).max(16384).optional(),
|
|
4075
|
+
refreshTokenExpiresAt: isoInstant.optional(),
|
|
4076
|
+
scope: z.array(z.string().max(512)).max(128),
|
|
4077
|
+
obtainedAt: isoInstant
|
|
4078
|
+
});
|
|
4079
|
+
z.object({
|
|
4080
|
+
v: z.literal(1),
|
|
4081
|
+
key: z.string().min(1).max(8192)
|
|
4082
|
+
});
|
|
4083
|
+
/** RFC 6238 parameters, as an authenticator app would hold them. */
|
|
4084
|
+
const vaultTotpSchema = z.object({
|
|
4085
|
+
/** Base32 (RFC 4648), upper case, no padding, no separators. */
|
|
4086
|
+
secret: z.string().regex(/^[A-Z2-7]{16,128}$/, "TOTP secret must be base32"),
|
|
4087
|
+
digits: z.union([z.literal(6), z.literal(8)]),
|
|
4088
|
+
period: z.number().int().min(15).max(120),
|
|
4089
|
+
algorithm: z.enum([
|
|
4090
|
+
"SHA1",
|
|
4091
|
+
"SHA256",
|
|
4092
|
+
"SHA512"
|
|
4093
|
+
])
|
|
4094
|
+
});
|
|
4095
|
+
z.object({
|
|
4096
|
+
v: z.literal(1),
|
|
4097
|
+
username: z.string().min(1).max(512),
|
|
4098
|
+
password: z.string().min(1).max(4096),
|
|
4099
|
+
totp: vaultTotpSchema.optional()
|
|
4100
|
+
});
|
|
4101
|
+
const vaultSessionCookieSchema = z.object({
|
|
4102
|
+
name: z.string().min(1).max(4096),
|
|
4103
|
+
value: z.string().max(16384),
|
|
4104
|
+
/** Kept exactly as captured — parent-domain cookies restore to their parent. */
|
|
4105
|
+
domain: z.string().min(1).max(253),
|
|
4106
|
+
path: z.string().min(1).max(4096),
|
|
4107
|
+
/** Unix seconds; -1 ⇒ a session cookie. */
|
|
4108
|
+
expires: z.number(),
|
|
4109
|
+
httpOnly: z.boolean(),
|
|
4110
|
+
secure: z.boolean(),
|
|
4111
|
+
sameSite: z.enum([
|
|
4112
|
+
"Strict",
|
|
4113
|
+
"Lax",
|
|
4114
|
+
"None"
|
|
4115
|
+
]).optional(),
|
|
4116
|
+
partitionKey: z.unknown().optional()
|
|
4117
|
+
});
|
|
4118
|
+
z.object({
|
|
4119
|
+
v: z.literal(1),
|
|
4120
|
+
siteId: z.string().min(1).max(64),
|
|
4121
|
+
capturedAt: isoInstant,
|
|
4122
|
+
userAgent: z.string().max(1024),
|
|
4123
|
+
cookies: z.array(vaultSessionCookieSchema).max(4096),
|
|
4124
|
+
/** origin → key → value. */
|
|
4125
|
+
localStorage: z.record(z.string(), z.record(z.string(), z.string()))
|
|
4126
|
+
});
|
|
4127
|
+
const vaultProviderIdSchema = z.string().trim().min(1).max(64).regex(/^[a-z0-9][a-z0-9._-]*$/, "provider ids are lowercase letters, digits, dots and dashes");
|
|
4128
|
+
/**
|
|
4129
|
+
* What the dashboard, Connect and the SDK may know about a provider: its name,
|
|
4130
|
+
* its method, and — for the consent screen — a plain sentence about what the
|
|
4131
|
+
* agent will be able to do. Never the rules, the endpoints or the injection:
|
|
4132
|
+
* those are compiled into the executor and the API must not be able to serve a
|
|
4133
|
+
* different version of them.
|
|
4134
|
+
*/
|
|
4135
|
+
const vaultCatalogProviderSchema = z.object({
|
|
4136
|
+
id: vaultProviderIdSchema,
|
|
4137
|
+
displayName: z.string().trim().min(1).max(80),
|
|
4138
|
+
method: z.enum(["oauth2", "api_key"]),
|
|
4139
|
+
/** The one sentence Connect shows: "read and send email as you". */
|
|
4140
|
+
consentSummary: z.string().trim().min(1).max(240),
|
|
4141
|
+
/** Hosts the executor will forward to, for display. */
|
|
4142
|
+
hosts: z.array(z.string().trim().min(1).max(253)).max(64).default([]),
|
|
4143
|
+
/** Where the end user finds the key (api_key providers). */
|
|
4144
|
+
helpUrl: z.url().max(2048).optional(),
|
|
4145
|
+
/** Label for the key field (api_key providers), e.g. "API key". */
|
|
4146
|
+
keyLabel: z.string().trim().min(1).max(60).optional(),
|
|
4147
|
+
/** OAuth scopes the provider will be asked for (oauth2 providers), for display. */
|
|
4148
|
+
scopes: z.array(z.string().trim().min(1).max(512)).max(64).optional()
|
|
4149
|
+
});
|
|
4150
|
+
const vaultCatalogSiteSchema = z.object({
|
|
4151
|
+
id: vaultProviderIdSchema,
|
|
4152
|
+
displayName: z.string().trim().min(1).max(80),
|
|
4153
|
+
consentSummary: z.string().trim().min(1).max(240),
|
|
4154
|
+
/** Origins the login form must live on (shown so the person can check). */
|
|
4155
|
+
loginOrigins: z.array(z.url().max(2048)).max(16).default([]),
|
|
4156
|
+
/** Where a restored session lands, for display. */
|
|
4157
|
+
startUrl: z.url().max(2048).optional()
|
|
4158
|
+
});
|
|
4159
|
+
const vaultCatalogSchema = z.object({
|
|
4160
|
+
v: z.literal(1),
|
|
4161
|
+
providers: z.array(vaultCatalogProviderSchema).max(200).default([]),
|
|
4162
|
+
sites: z.array(vaultCatalogSiteSchema).max(200).default([])
|
|
4163
|
+
});
|
|
4164
|
+
const vaultDisplaySchema = z.object({
|
|
4165
|
+
/** The platform's name as its users know it: "Instinct", not "instinct-prod". */
|
|
4166
|
+
name: z.string().trim().min(1).max(80),
|
|
4167
|
+
logoUrl: z.url().max(2048).startsWith("https://").optional(),
|
|
4168
|
+
/** `#rrggbb`. */
|
|
4169
|
+
accent: z.string().regex(/^#[0-9a-fA-F]{6}$/, "accent must be a #rrggbb colour").optional(),
|
|
4170
|
+
/** Origins a `returnUrl` may point at. Exact-match, scheme + host (+ port). */
|
|
4171
|
+
returnOrigins: z.array(z.url().max(2048)).max(16).default([])
|
|
4172
|
+
});
|
|
4173
|
+
z.object({
|
|
4174
|
+
name: nameSchema,
|
|
4175
|
+
display: vaultDisplaySchema.optional()
|
|
4176
|
+
});
|
|
4177
|
+
z.object({
|
|
4178
|
+
name: nameSchema.optional(),
|
|
4179
|
+
display: vaultDisplaySchema.optional(),
|
|
4180
|
+
status: z.enum(["active", "disabled"]).optional()
|
|
4181
|
+
});
|
|
4182
|
+
z.object({ name: nameSchema });
|
|
4183
|
+
/**
|
|
4184
|
+
* The platform's opaque identifier for its end user. Stored as given and
|
|
4185
|
+
* returned as given. It must not be an email address or anything else that
|
|
4186
|
+
* identifies the person outside the platform: the person has no seekrit
|
|
4187
|
+
* account, and this is the one field about them Vault holds in the clear.
|
|
4188
|
+
*/
|
|
4189
|
+
const vaultUserRefSchema = z.string().trim().min(1).max(200).refine((v) => !/\s/.test(v), { message: "userRef must not contain whitespace" }).refine((v) => !/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(v), { message: "userRef must be an opaque identifier, not an email address" });
|
|
4190
|
+
z.object({
|
|
4191
|
+
userRef: vaultUserRefSchema,
|
|
4192
|
+
providerId: vaultProviderIdSchema,
|
|
4193
|
+
purpose: z.enum(["connect", "reconnect"]).default("connect"),
|
|
4194
|
+
/** Required for `reconnect`: the connection being repaired. */
|
|
4195
|
+
connectionId: z.string().trim().min(1).max(64).optional(),
|
|
4196
|
+
/** Where the done screen may send the person. Must match a registered origin. */
|
|
4197
|
+
returnUrl: z.url().max(2048).optional(),
|
|
4198
|
+
expiresInSeconds: z.number().int().min(60).max(VAULT_CONNECT_SESSION_MAX_TTL_SECONDS).optional()
|
|
4199
|
+
});
|
|
4200
|
+
z.object({
|
|
4201
|
+
userRef: vaultUserRefSchema,
|
|
4202
|
+
returnUrl: z.url().max(2048).optional(),
|
|
4203
|
+
expiresInSeconds: z.number().int().min(60).max(VAULT_CONNECT_SESSION_MAX_TTL_SECONDS).optional()
|
|
4204
|
+
});
|
|
4205
|
+
z.object({
|
|
4206
|
+
url: z.url().max(2048).refine((u) => u.startsWith("https://"), "webhook URLs must be https"),
|
|
4207
|
+
/** Defaults to every event. */
|
|
4208
|
+
events: z.array(z.enum(VAULT_WEBHOOK_EVENTS)).min(1).max(VAULT_WEBHOOK_EVENTS.length).optional(),
|
|
4209
|
+
description: z.string().trim().max(200).optional()
|
|
4210
|
+
});
|
|
4211
|
+
z.object({
|
|
4212
|
+
userRef: vaultUserRefSchema.optional(),
|
|
4213
|
+
status: z.enum(VAULT_CONNECTION_STATUSES).optional(),
|
|
4214
|
+
cursor: z.string().max(200).optional(),
|
|
4215
|
+
limit: z.coerce.number().int().min(1).max(200).default(50)
|
|
4216
|
+
});
|
|
4217
|
+
/** An `https://host[:port]` origin with nothing after it; `http://localhost` in dev. */
|
|
4218
|
+
const vaultOriginSchema = z.string().trim().max(2048).refine((v) => {
|
|
4219
|
+
let url;
|
|
4220
|
+
try {
|
|
4221
|
+
url = new URL(v);
|
|
4222
|
+
} catch {
|
|
4223
|
+
return false;
|
|
4224
|
+
}
|
|
4225
|
+
if (url.origin !== v) return false;
|
|
4226
|
+
if (url.protocol === "https:") return true;
|
|
4227
|
+
return url.protocol === "http:" && [
|
|
4228
|
+
"localhost",
|
|
4229
|
+
"127.0.0.1",
|
|
4230
|
+
"[::1]"
|
|
4231
|
+
].includes(url.hostname);
|
|
4232
|
+
}, { message: "must be an https origin (scheme + host, nothing else)" });
|
|
4233
|
+
const vaultWrappingKeySchema = z.object({
|
|
4234
|
+
jwk: vaultPublicJwkSchema,
|
|
4235
|
+
thumbprint: z.string().regex(/^[A-Za-z0-9_-]{43}$/)
|
|
4236
|
+
});
|
|
4237
|
+
z.object({
|
|
4238
|
+
code: z.string().trim().min(16).max(200),
|
|
4239
|
+
origin: vaultOriginSchema,
|
|
4240
|
+
wrappingKey: vaultWrappingKeySchema,
|
|
4241
|
+
catalog: vaultCatalogSchema,
|
|
4242
|
+
sdkVersion: z.string().trim().min(1).max(40)
|
|
4243
|
+
});
|
|
4244
|
+
z.object({
|
|
4245
|
+
catalog: vaultCatalogSchema,
|
|
4246
|
+
sdkVersion: z.string().trim().min(1).max(40)
|
|
4247
|
+
});
|
|
4248
|
+
z.object({ wrappingKey: vaultWrappingKeySchema });
|
|
4249
|
+
/** One encrypted slot, as produced by Connect or the executor. */
|
|
4250
|
+
const vaultEncryptedSlotSchema = z.object({
|
|
4251
|
+
slot: z.enum(VAULT_SLOTS),
|
|
4252
|
+
revision: z.number().int().min(1),
|
|
4253
|
+
ciphertext: z.string().startsWith("sc1.").max(VAULT_CIPHERTEXT_MAX_CHARS),
|
|
4254
|
+
wrappedDek: z.string().startsWith("wd1.").max(2048),
|
|
4255
|
+
keyThumbprint: z.string().regex(/^[A-Za-z0-9_-]{43}$/)
|
|
4256
|
+
});
|
|
4257
|
+
z.object({
|
|
4258
|
+
slots: z.array(vaultEncryptedSlotSchema).min(1).max(2),
|
|
4259
|
+
/** "ava@example.com" / "@ava" — shown to the platform and the org, never used for auth. */
|
|
4260
|
+
accountLabel: z.string().trim().min(1).max(200).optional()
|
|
4261
|
+
});
|
|
4262
|
+
z.object({
|
|
4263
|
+
/** The revision the writer read; the write lands as `expectedRevision + 1`. */
|
|
4264
|
+
expectedRevision: z.number().int().min(0),
|
|
4265
|
+
ciphertext: z.string().startsWith("sc1.").max(VAULT_CIPHERTEXT_MAX_CHARS),
|
|
4266
|
+
wrappedDek: z.string().startsWith("wd1.").max(2048),
|
|
4267
|
+
keyThumbprint: z.string().regex(/^[A-Za-z0-9_-]{43}$/)
|
|
4268
|
+
});
|
|
4269
|
+
z.discriminatedUnion("status", [z.object({
|
|
4270
|
+
status: z.literal("reauth_required"),
|
|
4271
|
+
reason: z.string().trim().min(1).max(120)
|
|
4272
|
+
}), z.object({ status: z.literal("active") })]);
|
|
4273
|
+
z.object({ claimToken: z.string().min(16).max(200) });
|
|
4274
|
+
z.object({ token: z.string().min(16).max(200) });
|
|
4275
|
+
z.object({ consentVersion: z.literal(1) });
|
|
4276
|
+
z.object({ connectionId: z.string().trim().min(1).max(64) });
|
|
4277
|
+
z.object({
|
|
4278
|
+
login: vaultEncryptedSlotSchema.refine((slot) => slot.slot === "login", "must be the login slot").optional(),
|
|
4279
|
+
accountLabel: z.string().trim().min(1).max(200).optional()
|
|
4280
|
+
});
|
|
4281
|
+
z.object({
|
|
4282
|
+
userRef: vaultUserRefSchema,
|
|
4283
|
+
connectionId: z.string().trim().min(1).max(64),
|
|
4284
|
+
request: z.object({
|
|
4285
|
+
method: z.string().trim().toUpperCase().regex(/^[A-Z]{3,10}$/),
|
|
4286
|
+
url: z.url().max(8192),
|
|
4287
|
+
headers: z.record(z.string().max(256), z.string().max(16384)).optional(),
|
|
4288
|
+
/** UTF-8 text. Binary bodies are out of scope for V1. */
|
|
4289
|
+
body: z.string().max(4194304).optional()
|
|
4290
|
+
})
|
|
4291
|
+
});
|
|
4292
|
+
const connectionIdSchema = z.string().trim().min(1).max(64);
|
|
4293
|
+
const leaseIdSchema = z.string().trim().min(1).max(64);
|
|
4294
|
+
z.object({
|
|
4295
|
+
userRef: vaultUserRefSchema,
|
|
4296
|
+
connectionId: connectionIdSchema,
|
|
4297
|
+
/** How long the agent may hold the browser. Clamped to the site's ceiling. */
|
|
4298
|
+
keepAliveMs: z.number().int().min(VAULT_LEASE_MIN_MS).max(VAULT_LEASE_MAX_MS).optional()
|
|
4299
|
+
});
|
|
4300
|
+
z.object({
|
|
4301
|
+
userRef: vaultUserRefSchema,
|
|
4302
|
+
leaseId: leaseIdSchema,
|
|
4303
|
+
field: z.enum(VAULT_FILL_FIELDS)
|
|
4304
|
+
});
|
|
4305
|
+
z.object({
|
|
4306
|
+
userRef: vaultUserRefSchema,
|
|
4307
|
+
leaseId: leaseIdSchema,
|
|
4308
|
+
/** Write the rotated session back (default). `false` drops the browser without saving. */
|
|
4309
|
+
save: z.boolean().default(true)
|
|
4310
|
+
});
|
|
4311
|
+
z.object({
|
|
4312
|
+
userRef: vaultUserRefSchema,
|
|
4313
|
+
leaseId: leaseIdSchema
|
|
4314
|
+
});
|
|
4315
|
+
//#endregion
|
|
4001
4316
|
//#region ../../packages/crypto/src/encoding.ts
|
|
4002
4317
|
const CHUNK = 32768;
|
|
4003
4318
|
/** Base64url (no padding) — portable across browsers, Workers, and Node. */
|
|
@@ -5225,7 +5540,7 @@ async function createAgentTaskToken() {
|
|
|
5225
5540
|
}
|
|
5226
5541
|
//#endregion
|
|
5227
5542
|
//#region package.json
|
|
5228
|
-
var version = "1.9.
|
|
5543
|
+
var version = "1.9.2";
|
|
5229
5544
|
//#endregion
|
|
5230
5545
|
//#region ../../packages/api-client/src/index.ts
|
|
5231
5546
|
/**
|
|
@@ -5962,6 +6277,52 @@ var SeekritClient = class {
|
|
|
5962
6277
|
redeemPromoCode(orgId, input) {
|
|
5963
6278
|
return this.request("POST", `/v1/orgs/${orgId}/billing/promo`, input);
|
|
5964
6279
|
}
|
|
6280
|
+
listVaultProjects(orgId) {
|
|
6281
|
+
return this.request("GET", `/v1/orgs/${orgId}/vault/projects`);
|
|
6282
|
+
}
|
|
6283
|
+
createVaultProject(orgId, input) {
|
|
6284
|
+
return this.request("POST", `/v1/orgs/${orgId}/vault/projects`, input);
|
|
6285
|
+
}
|
|
6286
|
+
getVaultProject(orgId, projectId) {
|
|
6287
|
+
return this.request("GET", `/v1/orgs/${orgId}/vault/projects/${projectId}`);
|
|
6288
|
+
}
|
|
6289
|
+
updateVaultProject(orgId, projectId, input) {
|
|
6290
|
+
return this.request("PATCH", `/v1/orgs/${orgId}/vault/projects/${projectId}`, input);
|
|
6291
|
+
}
|
|
6292
|
+
/**
|
|
6293
|
+
* Mint a platform key. The `secret` is the `skv_…` string, returned exactly
|
|
6294
|
+
* once; the server keeps only its hash. Needs a browser session with a fresh
|
|
6295
|
+
* second factor — the API answers `mfa_required` otherwise.
|
|
6296
|
+
*/
|
|
6297
|
+
createVaultPlatformKey(orgId, projectId, input) {
|
|
6298
|
+
return this.request("POST", `/v1/orgs/${orgId}/vault/projects/${projectId}/keys`, input);
|
|
6299
|
+
}
|
|
6300
|
+
revokeVaultPlatformKey(orgId, projectId, keyId) {
|
|
6301
|
+
return this.request("DELETE", `/v1/orgs/${orgId}/vault/projects/${projectId}/keys/${keyId}`);
|
|
6302
|
+
}
|
|
6303
|
+
/** A one-time executor registration code (10 minutes). Same step-up rule as a key. */
|
|
6304
|
+
createVaultRegistrationCode(orgId, projectId) {
|
|
6305
|
+
return this.request("POST", `/v1/orgs/${orgId}/vault/projects/${projectId}/registration-codes`);
|
|
6306
|
+
}
|
|
6307
|
+
disableVaultExecutor(orgId, projectId) {
|
|
6308
|
+
return this.request("POST", `/v1/orgs/${orgId}/vault/projects/${projectId}/executor/disable`);
|
|
6309
|
+
}
|
|
6310
|
+
listVaultConnections(orgId, projectId, query = {}) {
|
|
6311
|
+
const params = new URLSearchParams();
|
|
6312
|
+
for (const [key, value] of Object.entries(query)) if (value !== void 0 && value !== "") params.set(key, String(value));
|
|
6313
|
+
const qs = params.toString();
|
|
6314
|
+
return this.request("GET", `/v1/orgs/${orgId}/vault/projects/${projectId}/connections${qs ? `?${qs}` : ""}`);
|
|
6315
|
+
}
|
|
6316
|
+
revokeVaultConnection(orgId, projectId, connectionId) {
|
|
6317
|
+
return this.request("POST", `/v1/orgs/${orgId}/vault/projects/${projectId}/connections/${connectionId}/revoke`);
|
|
6318
|
+
}
|
|
6319
|
+
/** Webhook endpoints a platform registered with its key; the dashboard reads and removes. */
|
|
6320
|
+
listVaultWebhooks(orgId, projectId) {
|
|
6321
|
+
return this.request("GET", `/v1/orgs/${orgId}/vault/projects/${projectId}/webhooks`);
|
|
6322
|
+
}
|
|
6323
|
+
deleteVaultWebhook(orgId, projectId, webhookId) {
|
|
6324
|
+
return this.request("DELETE", `/v1/orgs/${orgId}/vault/projects/${projectId}/webhooks/${webhookId}`);
|
|
6325
|
+
}
|
|
5965
6326
|
};
|
|
5966
6327
|
async function unauthenticatedPost(baseUrl, path, body, fetchImpl, client) {
|
|
5967
6328
|
const headers = {
|