@query-farm/vgi 0.36.3 → 0.37.1

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,34 @@ 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`. The value is still
39
+ * passed inline as an ordinary ATTACH option; the flag tells the DuckDB
40
+ * extension to redact it from `duckdb_databases()`, keep only a salted hash
41
+ * of it in its result-cache key, and never log it. Clients use the flag to
42
+ * mask the field and keep the value out of shared links and exported
43
+ * configuration.
44
+ *
45
+ * To keep the credential out of the SQL text itself, pass it as an
46
+ * expression:
47
+ *
48
+ * ```sql
49
+ * ATTACH 'sales' (TYPE vgi, LOCATION 'https://worker.example.com',
50
+ * api_key getenv('SALES_API_KEY'));
51
+ * ```
52
+ *
53
+ * Combines with `required` (a credential the catalog cannot attach without,
54
+ * which a client can then ask for before attaching). It is allowed together
55
+ * with `default`, but a secret option normally has none: a default would be
56
+ * a credential shipped in the catalog's own discovery metadata.
57
+ *
58
+ * Defaults to `false`. On the wire it is a nullable `secret` Bool column
59
+ * appended after `required`; a peer that predates it reads it as `false`.
60
+ */
61
+ secret?: boolean;
34
62
  }
35
63
  /**
36
64
  * Serialize an AttachOptionSpec to the wire format the extension expects
@@ -45,8 +73,8 @@ export declare function serializeAttachOptionSpecs(specs: Iterable<AttachOptionS
45
73
  * Deserialize one AttachOptionSpec from the wire format above.
46
74
  *
47
75
  * 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.
76
+ * `required` or `secret` column deserializes with that flag `false` rather
77
+ * than failing — the same tolerance the Python and C++ readers have.
50
78
  */
51
79
  export declare function deserializeAttachOptionSpec(bytes: Uint8Array): AttachOptionSpec;
52
80
  /** 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