@query-farm/vgi 0.36.2 → 0.37.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.
@@ -31,6 +31,31 @@ export interface AttachOptionSpec {
31
31
  * is by definition satisfiable without the caller.
32
32
  */
33
33
  required?: boolean;
34
+ /**
35
+ * The option carries a credential: an API key, a token, a password, or
36
+ * anything else that must not be shown, stored or logged in plain text.
37
+ *
38
+ * Credential options **MUST** be declared `secret: true`. Clients and the
39
+ * DuckDB extension use the flag to mask the value, keep it out of result
40
+ * cache keys (the extension stores a salted hash instead), `duckdb_databases()`,
41
+ * logs, telemetry, shared links and exported configuration. They can also
42
+ * supply it from a `vgi_attach` DuckDB secret, so the ATTACH statement never
43
+ * carries it:
44
+ *
45
+ * ```sql
46
+ * CREATE SECRET (TYPE vgi_attach, SCOPE 'https://worker.example.com', api_key 'sk-...');
47
+ * ATTACH 'sales' (TYPE vgi, LOCATION 'https://worker.example.com');
48
+ * ```
49
+ *
50
+ * Combines with `required` (a credential the catalog cannot attach without,
51
+ * which a client can then ask for before attaching). It is allowed together
52
+ * with `default`, but a secret option normally has none: a default would be
53
+ * a credential shipped in the catalog's own discovery metadata.
54
+ *
55
+ * Defaults to `false`. On the wire it is a nullable `secret` Bool column
56
+ * appended after `required`; a peer that predates it reads it as `false`.
57
+ */
58
+ secret?: boolean;
34
59
  }
35
60
  /**
36
61
  * Serialize an AttachOptionSpec to the wire format the extension expects
@@ -45,8 +70,8 @@ export declare function serializeAttachOptionSpecs(specs: Iterable<AttachOptionS
45
70
  * Deserialize one AttachOptionSpec from the wire format above.
46
71
  *
47
72
  * Reads by column name, so a spec written by a peer that predates the
48
- * `required` column deserializes with `required: false` rather than failing —
49
- * the same tolerance the Python and C++ readers have.
73
+ * `required` or `secret` column deserializes with that flag `false` rather
74
+ * than failing — the same tolerance the Python and C++ readers have.
50
75
  */
51
76
  export declare function deserializeAttachOptionSpec(bytes: Uint8Array): AttachOptionSpec;
52
77
  /** Deserialize many specs — the shape `CatalogInfo.attach_option_specs` holds. */
@@ -4329,7 +4329,8 @@ var SPEC_SCHEMA = schema2([
4329
4329
  field2("description", utf82(), false),
4330
4330
  field2("type", binary2(), false),
4331
4331
  field2("default_value", binary2(), true),
4332
- field2("required", bool2(), true)
4332
+ field2("required", bool2(), true),
4333
+ field2("secret", bool2(), true)
4333
4334
  ]);
4334
4335
  function deserializeAttachOptionSpec(bytes) {
4335
4336
  const row = [...iterRows(deserializeBatch(bytes))][0];
@@ -4352,7 +4353,8 @@ function deserializeAttachOptionSpec(bytes) {
4352
4353
  description: String(row.description ?? ""),
4353
4354
  type,
4354
4355
  ...value === undefined || value === null ? {} : { default: value },
4355
- required: row.required === true
4356
+ required: row.required === true,
4357
+ secret: row.secret === true
4356
4358
  };
4357
4359
  }
4358
4360
  function deserializeAttachOptionSpecs(specs) {
@@ -4410,4 +4412,4 @@ export {
4410
4412
  typeSignature
4411
4413
  };
4412
4414
 
4413
- //# debugId=D010E9DAE6E6C42D64756E2164756E21
4415
+ //# debugId=8BECE39CB65F6AD764756E2164756E21