teapot-coding-agent 0.36.1 → 0.36.3
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/mcp-oauth-manager.js +26 -0
- package/package.json +1 -1
- package/public/assets/index-eI8D6ykk.js +31 -0
- package/public/assets/index-eI8D6ykk.js.map +1 -0
- package/public/assets/{shiki-BKf80KQD.js → shiki-IGL6jZ0v.js} +2 -2
- package/public/assets/{shiki-BKf80KQD.js.map → shiki-IGL6jZ0v.js.map} +1 -1
- package/public/index.html +1 -1
- package/public/assets/index-C1_C58W-.js +0 -31
- package/public/assets/index-C1_C58W-.js.map +0 -1
|
@@ -202,6 +202,32 @@ export class ServerAuth {
|
|
|
202
202
|
throw new Error("no PKCE verifier — the authorization flow did not start here");
|
|
203
203
|
return v;
|
|
204
204
|
}
|
|
205
|
+
/**
|
|
206
|
+
* The SDK's discovery cache — the reason Notion's exchange never completed.
|
|
207
|
+
*
|
|
208
|
+
* The OAuth flow is split across TWO transport instances: the one that hits the 401 and
|
|
209
|
+
* redirects the browser, and the one built after the callback arrives. The SDK's own contract
|
|
210
|
+
* says this state "MUST persist with the same durability as `codeVerifier` (survives the
|
|
211
|
+
* redirect round-trip)", because the issuer recorded at redirect time is what the authorization
|
|
212
|
+
* response's `iss` is validated against (RFC 9207) when the code is redeemed.
|
|
213
|
+
*
|
|
214
|
+
* MEASURED on this machine's real store after a BROWSER-COMPLETED Notion authorization:
|
|
215
|
+
* `codeVerifier` present, `clientInformation.redirect_uris` a real ephemeral port
|
|
216
|
+
* (`http://127.0.0.1:37209/callback`), and no `accessToken` — the redeeming instance had
|
|
217
|
+
* re-discovered a different issuer binding, so the exchange never produced tokens. Both earlier
|
|
218
|
+
* fixes (persist the verifier, re-register on a redirect mismatch) were necessary and neither was
|
|
219
|
+
* sufficient.
|
|
220
|
+
*/
|
|
221
|
+
discoveryState() {
|
|
222
|
+
return this.store.discoveryState;
|
|
223
|
+
}
|
|
224
|
+
async saveDiscoveryState(state) {
|
|
225
|
+
if (!state || typeof state !== "object")
|
|
226
|
+
return;
|
|
227
|
+
this.store.discoveryState = state;
|
|
228
|
+
// same durability as the verifier: the instance that redeems the code is not this one
|
|
229
|
+
await this.persist(this.server, this.store);
|
|
230
|
+
}
|
|
205
231
|
// ---- teapot-facing ----
|
|
206
232
|
/** the url the browser must open, once `redirectToAuthorization` has been called */
|
|
207
233
|
pendingUrl() {
|