@autohq/cli 0.1.364 → 0.1.365

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.
@@ -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.364",
23495
+ version: "0.1.365",
23496
23496
  license: "SEE LICENSE IN README.md",
23497
23497
  publishConfig: {
23498
23498
  access: "public"
@@ -26200,10 +26200,35 @@ var EncryptedSecretValueSchema = external_exports.object({
26200
26200
  dekAuthTag: SecretAesGcmAuthTagSchema
26201
26201
  });
26202
26202
  var SecretDescriptionSchema = external_exports.string().trim().max(1024);
26203
+ var SECRET_BINDING_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])?$/;
26204
+ var SECRET_BINDING_HEADER_PATTERN = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
26205
+ var SECRET_BINDING_FORBIDDEN_HEADERS = /* @__PURE__ */ new Set([
26206
+ "connection",
26207
+ "content-length",
26208
+ "host",
26209
+ "transfer-encoding"
26210
+ ]);
26211
+ var SecretBindingHostSchema = external_exports.string().trim().toLowerCase().regex(
26212
+ SECRET_BINDING_HOST_PATTERN,
26213
+ "Binding hosts must be exact lowercase hostnames (no wildcards, schemes, ports, or paths)"
26214
+ );
26215
+ var SecretBindingHeaderSchema = external_exports.string().trim().min(1).max(128).regex(SECRET_BINDING_HEADER_PATTERN, "Invalid HTTP header name").refine(
26216
+ (header) => !SECRET_BINDING_FORBIDDEN_HEADERS.has(header.toLowerCase()),
26217
+ "This header cannot carry a secret binding"
26218
+ );
26219
+ var SecretBindingSchema = external_exports.object({
26220
+ hosts: external_exports.array(SecretBindingHostSchema).min(1).max(16),
26221
+ header: SecretBindingHeaderSchema,
26222
+ format: external_exports.string().min(1).max(256).refine(
26223
+ (format) => format.includes("{value}"),
26224
+ "Binding format must contain the {value} placeholder"
26225
+ ).optional()
26226
+ });
26203
26227
  var SecretSetRequestSchema = external_exports.object({
26204
26228
  value: external_exports.string(),
26205
26229
  description: SecretDescriptionSchema.nullable().optional(),
26206
- protected: external_exports.boolean().optional()
26230
+ protected: external_exports.boolean().optional(),
26231
+ binding: SecretBindingSchema.nullable().optional()
26207
26232
  });
26208
26233
  var SecretRotateRequestSchema = external_exports.object({
26209
26234
  value: external_exports.string()
@@ -26215,6 +26240,9 @@ var SecretMetadataSchema = external_exports.object({
26215
26240
  name: ResourceNameSchema,
26216
26241
  description: external_exports.string().nullable(),
26217
26242
  protected: external_exports.boolean(),
26243
+ // Defaulted rather than required so a newer client parsing an older
26244
+ // server's metadata (deploy skew) treats an absent binding as unbound.
26245
+ binding: SecretBindingSchema.nullable().default(null),
26218
26246
  createdAt: external_exports.string().datetime(),
26219
26247
  updatedAt: external_exports.string().datetime(),
26220
26248
  lastRotatedAt: external_exports.string().datetime().nullable(),
package/dist/index.js CHANGED
@@ -17599,7 +17599,7 @@ var init_mounts = __esm({
17599
17599
  });
17600
17600
 
17601
17601
  // ../../packages/schemas/src/secrets.ts
17602
- var SECRET_ENCRYPTION_ALGORITHM, SecretEnvNameSchema, SecretCiphertextFieldSchema, SecretAesGcmIvSchema, SecretAesGcmAuthTagSchema, SecretEnvValueSchema, SecretEnvSchema, EncryptedSecretValueSchema, SecretDescriptionSchema, SecretSetRequestSchema, SecretRotateRequestSchema, SecretMetadataSchema, SecretSetResponseSchema, SecretListResponseSchema, SecretDeleteResponseSchema, SecretRevealResponseSchema;
17602
+ var SECRET_ENCRYPTION_ALGORITHM, SecretEnvNameSchema, SecretCiphertextFieldSchema, SecretAesGcmIvSchema, SecretAesGcmAuthTagSchema, SecretEnvValueSchema, SecretEnvSchema, EncryptedSecretValueSchema, SecretDescriptionSchema, SECRET_BINDING_HOST_PATTERN, SECRET_BINDING_HEADER_PATTERN, SECRET_BINDING_FORBIDDEN_HEADERS, SecretBindingHostSchema, SecretBindingHeaderSchema, SecretBindingSchema, SecretSetRequestSchema, SecretRotateRequestSchema, SecretMetadataSchema, SecretSetResponseSchema, SecretListResponseSchema, SecretDeleteResponseSchema, SecretRevealResponseSchema;
17603
17603
  var init_secrets = __esm({
17604
17604
  "../../packages/schemas/src/secrets.ts"() {
17605
17605
  "use strict";
@@ -17632,10 +17632,35 @@ var init_secrets = __esm({
17632
17632
  dekAuthTag: SecretAesGcmAuthTagSchema
17633
17633
  });
17634
17634
  SecretDescriptionSchema = external_exports.string().trim().max(1024);
17635
+ SECRET_BINDING_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])?$/;
17636
+ SECRET_BINDING_HEADER_PATTERN = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
17637
+ SECRET_BINDING_FORBIDDEN_HEADERS = /* @__PURE__ */ new Set([
17638
+ "connection",
17639
+ "content-length",
17640
+ "host",
17641
+ "transfer-encoding"
17642
+ ]);
17643
+ SecretBindingHostSchema = external_exports.string().trim().toLowerCase().regex(
17644
+ SECRET_BINDING_HOST_PATTERN,
17645
+ "Binding hosts must be exact lowercase hostnames (no wildcards, schemes, ports, or paths)"
17646
+ );
17647
+ SecretBindingHeaderSchema = external_exports.string().trim().min(1).max(128).regex(SECRET_BINDING_HEADER_PATTERN, "Invalid HTTP header name").refine(
17648
+ (header) => !SECRET_BINDING_FORBIDDEN_HEADERS.has(header.toLowerCase()),
17649
+ "This header cannot carry a secret binding"
17650
+ );
17651
+ SecretBindingSchema = external_exports.object({
17652
+ hosts: external_exports.array(SecretBindingHostSchema).min(1).max(16),
17653
+ header: SecretBindingHeaderSchema,
17654
+ format: external_exports.string().min(1).max(256).refine(
17655
+ (format) => format.includes("{value}"),
17656
+ "Binding format must contain the {value} placeholder"
17657
+ ).optional()
17658
+ });
17635
17659
  SecretSetRequestSchema = external_exports.object({
17636
17660
  value: external_exports.string(),
17637
17661
  description: SecretDescriptionSchema.nullable().optional(),
17638
- protected: external_exports.boolean().optional()
17662
+ protected: external_exports.boolean().optional(),
17663
+ binding: SecretBindingSchema.nullable().optional()
17639
17664
  });
17640
17665
  SecretRotateRequestSchema = external_exports.object({
17641
17666
  value: external_exports.string()
@@ -17647,6 +17672,9 @@ var init_secrets = __esm({
17647
17672
  name: ResourceNameSchema,
17648
17673
  description: external_exports.string().nullable(),
17649
17674
  protected: external_exports.boolean(),
17675
+ // Defaulted rather than required so a newer client parsing an older
17676
+ // server's metadata (deploy skew) treats an absent binding as unbound.
17677
+ binding: SecretBindingSchema.nullable().default(null),
17650
17678
  createdAt: external_exports.string().datetime(),
17651
17679
  updatedAt: external_exports.string().datetime(),
17652
17680
  lastRotatedAt: external_exports.string().datetime().nullable(),
@@ -31577,7 +31605,7 @@ var init_package = __esm({
31577
31605
  "package.json"() {
31578
31606
  package_default = {
31579
31607
  name: "@autohq/cli",
31580
- version: "0.1.364",
31608
+ version: "0.1.365",
31581
31609
  license: "SEE LICENSE IN README.md",
31582
31610
  publishConfig: {
31583
31611
  access: "public"
@@ -50030,7 +50058,8 @@ async function setSecret(input) {
50030
50058
  {
50031
50059
  value,
50032
50060
  ...input.commandOptions.description === void 0 ? {} : { description: input.commandOptions.description },
50033
- ...resolveProtectedFlag(input.commandOptions)
50061
+ ...resolveProtectedFlag(input.commandOptions),
50062
+ ...resolveBindingFlags(input.commandOptions)
50034
50063
  },
50035
50064
  {
50036
50065
  projectId: await secretProjectId(input),
@@ -50094,6 +50123,30 @@ function resolveProtectedFlag(options) {
50094
50123
  }
50095
50124
  return {};
50096
50125
  }
50126
+ function resolveBindingFlags(options) {
50127
+ const hasBindingFlags = (options.bindHost?.length ?? 0) > 0 || options.bindHeader !== void 0 || options.bindFormat !== void 0;
50128
+ if (options.unbind) {
50129
+ if (hasBindingFlags) {
50130
+ throw new Error("Use either --unbind or the --bind-* flags, not both.");
50131
+ }
50132
+ return { binding: null };
50133
+ }
50134
+ if (!hasBindingFlags) {
50135
+ return {};
50136
+ }
50137
+ if (!options.bindHost?.length || options.bindHeader === void 0) {
50138
+ throw new Error(
50139
+ "Binding a secret requires at least one --bind-host and a --bind-header."
50140
+ );
50141
+ }
50142
+ return {
50143
+ binding: {
50144
+ hosts: options.bindHost,
50145
+ header: options.bindHeader,
50146
+ ...options.bindFormat === void 0 ? {} : { format: options.bindFormat }
50147
+ }
50148
+ };
50149
+ }
50097
50150
  async function removeSecret(input) {
50098
50151
  await confirmDestructiveAction(input.context, {
50099
50152
  message: `This will remove secret "${input.name}".`,
@@ -50248,7 +50301,18 @@ function registerSecretCommands(program, context) {
50248
50301
  secrets.command("set").description("Create or update a secret without printing its value.").argument("<name>", "secret name").option("--project <project>", "project id; defaults to organization scope").option("--stdin", "read the secret value from stdin").option("--value <value>", "secret value").option(
50249
50302
  "--from-env <name>",
50250
50303
  "read the secret value from an environment variable"
50251
- ).option("--description <text>", "human-readable description for the secret").option("--protected", "mark write-only: refuse plaintext reveal (default)").option(
50304
+ ).option("--description <text>", "human-readable description for the secret").option(
50305
+ "--bind-host <host>",
50306
+ "bind the secret to an exact destination host (repeatable); bound secrets are injected at the sandbox edge instead of entering the sandbox",
50307
+ (host, hosts) => [...hosts, host],
50308
+ []
50309
+ ).option(
50310
+ "--bind-header <header>",
50311
+ "HTTP header the bound secret is injected into (e.g. Authorization)"
50312
+ ).option(
50313
+ "--bind-format <format>",
50314
+ 'header value template around the secret, e.g. "Bearer {value}"'
50315
+ ).option("--unbind", "clear an existing destination binding").option("--protected", "mark write-only: refuse plaintext reveal (default)").option(
50252
50316
  "--unprotected",
50253
50317
  "allow scope-gated plaintext reveal of this secret"
50254
50318
  ).option("--raw", "allow empty values and preserve stdin exactly").option("--json", "print the updated secret metadata as JSON").option("--api-url <url>", "Auto API base URL").option("--api-base-url <url>", "Auto API base URL").action(async (name, commandOptions) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autohq/cli",
3
- "version": "0.1.364",
3
+ "version": "0.1.365",
4
4
  "license": "SEE LICENSE IN README.md",
5
5
  "publishConfig": {
6
6
  "access": "public"