@autohq/cli 0.1.382 → 0.1.383
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/agent-bridge.js +19 -18
- package/dist/index.js +47 -39
- package/package.json +1 -1
package/dist/agent-bridge.js
CHANGED
|
@@ -23492,7 +23492,7 @@ Object.assign(lookup, {
|
|
|
23492
23492
|
// package.json
|
|
23493
23493
|
var package_default = {
|
|
23494
23494
|
name: "@autohq/cli",
|
|
23495
|
-
version: "0.1.
|
|
23495
|
+
version: "0.1.383",
|
|
23496
23496
|
license: "SEE LICENSE IN README.md",
|
|
23497
23497
|
publishConfig: {
|
|
23498
23498
|
access: "public"
|
|
@@ -26299,35 +26299,35 @@ var SecretDescriptionSchema = external_exports.string().trim().max(1024);
|
|
|
26299
26299
|
var SECRET_IDLE_EXPIRY_MAX_SECONDS = 10 * 365 * 24 * 60 * 60;
|
|
26300
26300
|
var SecretExpiresAtSchema = external_exports.string().datetime({ offset: true });
|
|
26301
26301
|
var SecretIdleExpirySecondsSchema = external_exports.number().int().min(1).max(SECRET_IDLE_EXPIRY_MAX_SECONDS);
|
|
26302
|
-
var
|
|
26303
|
-
var
|
|
26304
|
-
var
|
|
26302
|
+
var SECRET_INJECTION_HOST_PATTERN = /^(?=.{1,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]([a-z0-9-]{0,61}[a-z0-9])?$/;
|
|
26303
|
+
var SECRET_INJECTION_HEADER_PATTERN = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
|
|
26304
|
+
var SECRET_INJECTION_FORBIDDEN_HEADERS = /* @__PURE__ */ new Set([
|
|
26305
26305
|
"connection",
|
|
26306
26306
|
"content-length",
|
|
26307
26307
|
"host",
|
|
26308
26308
|
"transfer-encoding"
|
|
26309
26309
|
]);
|
|
26310
|
-
var
|
|
26311
|
-
|
|
26312
|
-
"
|
|
26310
|
+
var SecretInjectionHostSchema = external_exports.string().trim().toLowerCase().regex(
|
|
26311
|
+
SECRET_INJECTION_HOST_PATTERN,
|
|
26312
|
+
"Injection hosts must be exact lowercase hostnames (no wildcards, schemes, ports, or paths)"
|
|
26313
26313
|
);
|
|
26314
|
-
var
|
|
26315
|
-
(header) => !
|
|
26316
|
-
"This header cannot carry
|
|
26314
|
+
var SecretInjectionHeaderSchema = external_exports.string().trim().min(1).max(128).regex(SECRET_INJECTION_HEADER_PATTERN, "Invalid HTTP header name").refine(
|
|
26315
|
+
(header) => !SECRET_INJECTION_FORBIDDEN_HEADERS.has(header.toLowerCase()),
|
|
26316
|
+
"This header cannot carry an injected secret"
|
|
26317
26317
|
);
|
|
26318
|
-
var
|
|
26319
|
-
hosts: external_exports.array(
|
|
26320
|
-
header:
|
|
26318
|
+
var SecretInjectionSchema = external_exports.object({
|
|
26319
|
+
hosts: external_exports.array(SecretInjectionHostSchema).min(1).max(16),
|
|
26320
|
+
header: SecretInjectionHeaderSchema,
|
|
26321
26321
|
format: external_exports.string().min(1).max(256).refine(
|
|
26322
26322
|
(format) => format.includes("{value}"),
|
|
26323
|
-
"
|
|
26323
|
+
"Injection format must contain the {value} placeholder"
|
|
26324
26324
|
).optional()
|
|
26325
26325
|
});
|
|
26326
26326
|
var SecretSetRequestSchema = external_exports.object({
|
|
26327
26327
|
value: external_exports.string(),
|
|
26328
26328
|
description: SecretDescriptionSchema.nullable().optional(),
|
|
26329
26329
|
protected: external_exports.boolean().optional(),
|
|
26330
|
-
|
|
26330
|
+
injection: SecretInjectionSchema.nullable().optional(),
|
|
26331
26331
|
expiresAt: SecretExpiresAtSchema.nullable().optional(),
|
|
26332
26332
|
idleExpirySeconds: SecretIdleExpirySecondsSchema.nullable().optional()
|
|
26333
26333
|
});
|
|
@@ -26349,13 +26349,14 @@ var SecretMetadataSchema = external_exports.object({
|
|
|
26349
26349
|
description: external_exports.string().nullable(),
|
|
26350
26350
|
protected: external_exports.boolean(),
|
|
26351
26351
|
// Defaulted rather than required so a newer client parsing an older
|
|
26352
|
-
// server's metadata (deploy skew) treats an absent
|
|
26353
|
-
|
|
26352
|
+
// server's metadata (deploy skew) treats an absent injection as plain
|
|
26353
|
+
// env delivery.
|
|
26354
|
+
injection: SecretInjectionSchema.nullable().default(null),
|
|
26354
26355
|
createdAt: external_exports.string().datetime(),
|
|
26355
26356
|
updatedAt: external_exports.string().datetime(),
|
|
26356
26357
|
lastRotatedAt: external_exports.string().datetime().nullable(),
|
|
26357
26358
|
lastAccessedAt: external_exports.string().datetime().nullable(),
|
|
26358
|
-
// Like
|
|
26359
|
+
// Like injection, defaulted for deploy skew: an older server that never sends
|
|
26359
26360
|
// expiry fields parses as a secret that never expires.
|
|
26360
26361
|
expiresAt: external_exports.string().datetime().nullable().default(null),
|
|
26361
26362
|
idleExpirySeconds: external_exports.number().int().nullable().default(null),
|
package/dist/index.js
CHANGED
|
@@ -17695,7 +17695,7 @@ var init_mounts = __esm({
|
|
|
17695
17695
|
});
|
|
17696
17696
|
|
|
17697
17697
|
// ../../packages/schemas/src/secrets.ts
|
|
17698
|
-
var SECRET_ENCRYPTION_ALGORITHM, SecretEnvNameSchema, SecretCiphertextFieldSchema, SecretAesGcmIvSchema, SecretAesGcmAuthTagSchema, SecretEnvValueSchema, SecretEnvSchema, EncryptedSecretValueSchema, SecretDescriptionSchema, SECRET_IDLE_EXPIRY_MAX_SECONDS, SecretExpiresAtSchema, SecretIdleExpirySecondsSchema,
|
|
17698
|
+
var SECRET_ENCRYPTION_ALGORITHM, SecretEnvNameSchema, SecretCiphertextFieldSchema, SecretAesGcmIvSchema, SecretAesGcmAuthTagSchema, SecretEnvValueSchema, SecretEnvSchema, EncryptedSecretValueSchema, SecretDescriptionSchema, SECRET_IDLE_EXPIRY_MAX_SECONDS, SecretExpiresAtSchema, SecretIdleExpirySecondsSchema, SECRET_INJECTION_HOST_PATTERN, SECRET_INJECTION_HEADER_PATTERN, SECRET_INJECTION_FORBIDDEN_HEADERS, SecretInjectionHostSchema, SecretInjectionHeaderSchema, SecretInjectionSchema, SecretSetRequestSchema, SecretExpiryUpdateRequestSchema, SecretRotateRequestSchema, SecretMetadataSchema, SecretSetResponseSchema, SecretListResponseSchema, SecretDeleteResponseSchema, SecretExpiryUpdateResponseSchema, SecretRevealResponseSchema;
|
|
17699
17699
|
var init_secrets = __esm({
|
|
17700
17700
|
"../../packages/schemas/src/secrets.ts"() {
|
|
17701
17701
|
"use strict";
|
|
@@ -17731,35 +17731,35 @@ var init_secrets = __esm({
|
|
|
17731
17731
|
SECRET_IDLE_EXPIRY_MAX_SECONDS = 10 * 365 * 24 * 60 * 60;
|
|
17732
17732
|
SecretExpiresAtSchema = external_exports.string().datetime({ offset: true });
|
|
17733
17733
|
SecretIdleExpirySecondsSchema = external_exports.number().int().min(1).max(SECRET_IDLE_EXPIRY_MAX_SECONDS);
|
|
17734
|
-
|
|
17735
|
-
|
|
17736
|
-
|
|
17734
|
+
SECRET_INJECTION_HOST_PATTERN = /^(?=.{1,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]([a-z0-9-]{0,61}[a-z0-9])?$/;
|
|
17735
|
+
SECRET_INJECTION_HEADER_PATTERN = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
|
|
17736
|
+
SECRET_INJECTION_FORBIDDEN_HEADERS = /* @__PURE__ */ new Set([
|
|
17737
17737
|
"connection",
|
|
17738
17738
|
"content-length",
|
|
17739
17739
|
"host",
|
|
17740
17740
|
"transfer-encoding"
|
|
17741
17741
|
]);
|
|
17742
|
-
|
|
17743
|
-
|
|
17744
|
-
"
|
|
17742
|
+
SecretInjectionHostSchema = external_exports.string().trim().toLowerCase().regex(
|
|
17743
|
+
SECRET_INJECTION_HOST_PATTERN,
|
|
17744
|
+
"Injection hosts must be exact lowercase hostnames (no wildcards, schemes, ports, or paths)"
|
|
17745
17745
|
);
|
|
17746
|
-
|
|
17747
|
-
(header) => !
|
|
17748
|
-
"This header cannot carry
|
|
17746
|
+
SecretInjectionHeaderSchema = external_exports.string().trim().min(1).max(128).regex(SECRET_INJECTION_HEADER_PATTERN, "Invalid HTTP header name").refine(
|
|
17747
|
+
(header) => !SECRET_INJECTION_FORBIDDEN_HEADERS.has(header.toLowerCase()),
|
|
17748
|
+
"This header cannot carry an injected secret"
|
|
17749
17749
|
);
|
|
17750
|
-
|
|
17751
|
-
hosts: external_exports.array(
|
|
17752
|
-
header:
|
|
17750
|
+
SecretInjectionSchema = external_exports.object({
|
|
17751
|
+
hosts: external_exports.array(SecretInjectionHostSchema).min(1).max(16),
|
|
17752
|
+
header: SecretInjectionHeaderSchema,
|
|
17753
17753
|
format: external_exports.string().min(1).max(256).refine(
|
|
17754
17754
|
(format) => format.includes("{value}"),
|
|
17755
|
-
"
|
|
17755
|
+
"Injection format must contain the {value} placeholder"
|
|
17756
17756
|
).optional()
|
|
17757
17757
|
});
|
|
17758
17758
|
SecretSetRequestSchema = external_exports.object({
|
|
17759
17759
|
value: external_exports.string(),
|
|
17760
17760
|
description: SecretDescriptionSchema.nullable().optional(),
|
|
17761
17761
|
protected: external_exports.boolean().optional(),
|
|
17762
|
-
|
|
17762
|
+
injection: SecretInjectionSchema.nullable().optional(),
|
|
17763
17763
|
expiresAt: SecretExpiresAtSchema.nullable().optional(),
|
|
17764
17764
|
idleExpirySeconds: SecretIdleExpirySecondsSchema.nullable().optional()
|
|
17765
17765
|
});
|
|
@@ -17781,13 +17781,14 @@ var init_secrets = __esm({
|
|
|
17781
17781
|
description: external_exports.string().nullable(),
|
|
17782
17782
|
protected: external_exports.boolean(),
|
|
17783
17783
|
// Defaulted rather than required so a newer client parsing an older
|
|
17784
|
-
// server's metadata (deploy skew) treats an absent
|
|
17785
|
-
|
|
17784
|
+
// server's metadata (deploy skew) treats an absent injection as plain
|
|
17785
|
+
// env delivery.
|
|
17786
|
+
injection: SecretInjectionSchema.nullable().default(null),
|
|
17786
17787
|
createdAt: external_exports.string().datetime(),
|
|
17787
17788
|
updatedAt: external_exports.string().datetime(),
|
|
17788
17789
|
lastRotatedAt: external_exports.string().datetime().nullable(),
|
|
17789
17790
|
lastAccessedAt: external_exports.string().datetime().nullable(),
|
|
17790
|
-
// Like
|
|
17791
|
+
// Like injection, defaulted for deploy skew: an older server that never sends
|
|
17791
17792
|
// expiry fields parses as a secret that never expires.
|
|
17792
17793
|
expiresAt: external_exports.string().datetime().nullable().default(null),
|
|
17793
17794
|
idleExpirySeconds: external_exports.number().int().nullable().default(null),
|
|
@@ -33907,7 +33908,7 @@ var init_package = __esm({
|
|
|
33907
33908
|
"package.json"() {
|
|
33908
33909
|
package_default = {
|
|
33909
33910
|
name: "@autohq/cli",
|
|
33910
|
-
version: "0.1.
|
|
33911
|
+
version: "0.1.383",
|
|
33911
33912
|
license: "SEE LICENSE IN README.md",
|
|
33912
33913
|
publishConfig: {
|
|
33913
33914
|
access: "public"
|
|
@@ -52439,7 +52440,7 @@ async function setSecret(input) {
|
|
|
52439
52440
|
...input.commandOptions.description === void 0 ? {} : { description: input.commandOptions.description },
|
|
52440
52441
|
...resolveProtectedFlag(input.commandOptions),
|
|
52441
52442
|
...resolveExpiryFields(input.commandOptions),
|
|
52442
|
-
...
|
|
52443
|
+
...resolveInjectionFlags(input.commandOptions)
|
|
52443
52444
|
},
|
|
52444
52445
|
{
|
|
52445
52446
|
projectId: await secretProjectId(input),
|
|
@@ -52503,6 +52504,11 @@ async function listSecrets(input) {
|
|
|
52503
52504
|
flags,
|
|
52504
52505
|
`updated ${secret.updatedAt}`
|
|
52505
52506
|
];
|
|
52507
|
+
if (secret.injection) {
|
|
52508
|
+
parts.push(
|
|
52509
|
+
`injected ${secret.injection.header}@${secret.injection.hosts.join(",")}`
|
|
52510
|
+
);
|
|
52511
|
+
}
|
|
52506
52512
|
if (secret.expired) {
|
|
52507
52513
|
parts.push("expired");
|
|
52508
52514
|
} else {
|
|
@@ -52565,27 +52571,29 @@ function resolveExpiryFields(options) {
|
|
|
52565
52571
|
...options.idleExpiry === void 0 ? {} : { idleExpirySeconds: parseIdleExpiry(options.idleExpiry) }
|
|
52566
52572
|
};
|
|
52567
52573
|
}
|
|
52568
|
-
function
|
|
52569
|
-
const
|
|
52570
|
-
if (options.
|
|
52571
|
-
if (
|
|
52572
|
-
throw new Error(
|
|
52574
|
+
function resolveInjectionFlags(options) {
|
|
52575
|
+
const hasInjectionFlags = (options.injectHost?.length ?? 0) > 0 || options.injectHeader !== void 0 || options.injectFormat !== void 0;
|
|
52576
|
+
if (options.clearInjection) {
|
|
52577
|
+
if (hasInjectionFlags) {
|
|
52578
|
+
throw new Error(
|
|
52579
|
+
"Use either --clear-injection or the --inject-* flags, not both."
|
|
52580
|
+
);
|
|
52573
52581
|
}
|
|
52574
|
-
return {
|
|
52582
|
+
return { injection: null };
|
|
52575
52583
|
}
|
|
52576
|
-
if (!
|
|
52584
|
+
if (!hasInjectionFlags) {
|
|
52577
52585
|
return {};
|
|
52578
52586
|
}
|
|
52579
|
-
if (!options.
|
|
52587
|
+
if (!options.injectHost?.length || options.injectHeader === void 0) {
|
|
52580
52588
|
throw new Error(
|
|
52581
|
-
"
|
|
52589
|
+
"An injected secret requires at least one --inject-host and an --inject-header."
|
|
52582
52590
|
);
|
|
52583
52591
|
}
|
|
52584
52592
|
return {
|
|
52585
|
-
|
|
52586
|
-
hosts: options.
|
|
52587
|
-
header: options.
|
|
52588
|
-
...options.
|
|
52593
|
+
injection: {
|
|
52594
|
+
hosts: options.injectHost,
|
|
52595
|
+
header: options.injectHeader,
|
|
52596
|
+
...options.injectFormat === void 0 ? {} : { format: options.injectFormat }
|
|
52589
52597
|
}
|
|
52590
52598
|
};
|
|
52591
52599
|
}
|
|
@@ -52754,17 +52762,17 @@ function registerSecretCommands(program, context) {
|
|
|
52754
52762
|
"--from-env <name>",
|
|
52755
52763
|
"read the secret value from an environment variable"
|
|
52756
52764
|
).option("--description <text>", "human-readable description for the secret").option(
|
|
52757
|
-
"--
|
|
52758
|
-
"
|
|
52765
|
+
"--inject-host <host>",
|
|
52766
|
+
"mark the secret injected for an exact destination host (repeatable); injected secrets are added at the sandbox edge instead of entering the sandbox",
|
|
52759
52767
|
(host, hosts) => [...hosts, host],
|
|
52760
52768
|
[]
|
|
52761
52769
|
).option(
|
|
52762
|
-
"--
|
|
52763
|
-
"HTTP header the
|
|
52770
|
+
"--inject-header <header>",
|
|
52771
|
+
"HTTP header the secret is injected into (e.g. Authorization)"
|
|
52764
52772
|
).option(
|
|
52765
|
-
"--
|
|
52773
|
+
"--inject-format <format>",
|
|
52766
52774
|
'header value template around the secret, e.g. "Bearer {value}"'
|
|
52767
|
-
).option("--
|
|
52775
|
+
).option("--clear-injection", "stop injecting the secret at any destination").option("--protected", "mark write-only: refuse plaintext reveal (default)").option(
|
|
52768
52776
|
"--unprotected",
|
|
52769
52777
|
"allow scope-gated plaintext reveal of this secret"
|
|
52770
52778
|
).option("--raw", "allow empty values and preserve stdin exactly").option(
|