@agentconnect.md/setup 1.37.0-rc.8 → 1.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.
- package/dist/index.js +27 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -57107,8 +57107,10 @@ async function describeVaultError(res) {
|
|
|
57107
57107
|
}
|
|
57108
57108
|
//#endregion
|
|
57109
57109
|
//#region ../control-plane/dist/secrets/vault-transit.js
|
|
57110
|
-
/** Transit ciphertext
|
|
57111
|
-
const
|
|
57110
|
+
/** A bare Transit ciphertext — what this cipher produced BEFORE scoping existed. */
|
|
57111
|
+
const LEGACY_CIPHERTEXT_RE = /^vault:v\d+:/;
|
|
57112
|
+
/** Any version of our own envelope, including ones this build predates. */
|
|
57113
|
+
const ENVELOPE_RE = /^acv\d+:/;
|
|
57112
57114
|
var VaultTransitSecretCipher = class {
|
|
57113
57115
|
http;
|
|
57114
57116
|
key;
|
|
@@ -57143,10 +57145,12 @@ var VaultTransitSecretCipher = class {
|
|
|
57143
57145
|
return `${SECRET_ENVELOPE_PREFIX}${data.ciphertext}`;
|
|
57144
57146
|
}
|
|
57145
57147
|
async open(stored, scope) {
|
|
57146
|
-
|
|
57147
|
-
|
|
57148
|
-
|
|
57149
|
-
|
|
57148
|
+
if (!stored.startsWith("acv1:")) {
|
|
57149
|
+
assertNotUnreadableCiphertext(stored);
|
|
57150
|
+
return stored;
|
|
57151
|
+
}
|
|
57152
|
+
const key = this.keyFor(scope);
|
|
57153
|
+
const ciphertext = stored.slice(5);
|
|
57150
57154
|
const cacheKey = `${key}\u0000${ciphertext}`;
|
|
57151
57155
|
const hit = this.openCache.get(cacheKey);
|
|
57152
57156
|
if (hit !== void 0) return hit;
|
|
@@ -57169,6 +57173,17 @@ var VaultTransitSecretCipher = class {
|
|
|
57169
57173
|
return (await res.json()).data ?? {};
|
|
57170
57174
|
}
|
|
57171
57175
|
};
|
|
57176
|
+
/**
|
|
57177
|
+
* The pass-through arm exists for values that were never sealed (plaintext rows
|
|
57178
|
+
* under `SECRET_CIPHER=none`). It must never swallow a value that IS sealed but
|
|
57179
|
+
* unreadable by this build — returning ciphertext as if it were plaintext is
|
|
57180
|
+
* silent corruption: the caller ships it to a daemon or a platform API as a
|
|
57181
|
+
* credential. Both cases below are loud instead.
|
|
57182
|
+
*/
|
|
57183
|
+
function assertNotUnreadableCiphertext(stored) {
|
|
57184
|
+
if (LEGACY_CIPHERTEXT_RE.test(stored)) throw new Error("secret cipher: unscoped legacy ciphertext — run the rewrap sweep on a pre-scoping build first");
|
|
57185
|
+
if (ENVELOPE_RE.test(stored)) throw new Error("secret cipher: stored value uses a newer envelope version than this build supports");
|
|
57186
|
+
}
|
|
57172
57187
|
//#endregion
|
|
57173
57188
|
//#region ../control-plane/dist/secrets/cipher.js
|
|
57174
57189
|
/**
|
|
@@ -57190,12 +57205,12 @@ var VaultTransitSecretCipher = class {
|
|
|
57190
57205
|
* Contract for an encrypting implementation (e.g. Vault Transit):
|
|
57191
57206
|
* - `seal` returns a self-describing value carrying the envelope version
|
|
57192
57207
|
* (`acv1:` + Transit's own `vault:v1:…`).
|
|
57193
|
-
* - `open` MUST pass through values it did not seal (no
|
|
57194
|
-
*
|
|
57195
|
-
*
|
|
57196
|
-
*
|
|
57197
|
-
*
|
|
57198
|
-
*
|
|
57208
|
+
* - `open` MUST pass through values it did not seal (no envelope tag ⇒ return
|
|
57209
|
+
* as-is): existing plaintext rows keep working, and re-sealing on the next
|
|
57210
|
+
* write migrates them lazily — the flip is online, no backfill required. It
|
|
57211
|
+
* must NOT pass through a value that is sealed but unreadable (a pre-scoping
|
|
57212
|
+
* `vault:vN:`, or a newer envelope version) — that has to throw, since
|
|
57213
|
+
* returning ciphertext as plaintext would be shipped onward as a credential.
|
|
57199
57214
|
* - A value sealed under one scope MUST NOT open under another. Failing closed
|
|
57200
57215
|
* there is the point of passing the scope in.
|
|
57201
57216
|
* - Neither side ever logs its argument.
|