@zackbart/connecta 0.22.2 → 0.22.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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this package are documented here.
|
|
4
4
|
|
|
5
|
+
## 0.22.3 — 2026-09-03
|
|
6
|
+
|
|
7
|
+
This patch carries OAuth discovery across the browser redirect. It matters for
|
|
8
|
+
downstream MCP servers whose authentication challenge names a protected-resource
|
|
9
|
+
metadata URL outside the RFC 9728 default path, including Cloudflare Access
|
|
10
|
+
Managed OAuth. Existing grants and connectors using the default path require no
|
|
11
|
+
configuration or storage migration.
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- **Non-default OAuth discovery survives callbacks.** The KV OAuth provider now
|
|
16
|
+
persists the SDK's discovery state in the authorization generation, restores
|
|
17
|
+
it in the callback's fresh request scope, and deletes it through discovery,
|
|
18
|
+
all-credential, and generation cleanup. A callback therefore exchanges its
|
|
19
|
+
code against the same validated authorization-server issuer that registered
|
|
20
|
+
the client instead of invalidating that client after rediscovery (#523).
|
|
21
|
+
|
|
5
22
|
## 0.22.2 — 2026-09-01
|
|
6
23
|
|
|
7
24
|
This patch makes the maintained-provider release check credential-free and
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FetchLike, OAuthClientInformationContext, OAuthClientInformationMixed, OAuthClientMetadata, OAuthClientProvider, OAuthTokens } from "@modelcontextprotocol/client";
|
|
1
|
+
import type { FetchLike, OAuthClientInformationContext, OAuthClientInformationMixed, OAuthClientMetadata, OAuthClientProvider, OAuthDiscoveryState, OAuthTokens } from "@modelcontextprotocol/client";
|
|
2
2
|
import type { KVStorage } from "../types.js";
|
|
3
3
|
type OAuthRefreshFlightOutcome = {
|
|
4
4
|
status: "refreshed";
|
|
@@ -134,6 +134,8 @@ export declare class KvOAuthProvider implements OAuthClientProvider {
|
|
|
134
134
|
get clientMetadata(): OAuthClientMetadata;
|
|
135
135
|
clientInformation(ctx?: OAuthClientInformationContext): Promise<OAuthClientInformationMixed | undefined>;
|
|
136
136
|
saveClientInformation(info: OAuthClientInformationMixed, ctx?: OAuthClientInformationContext): Promise<void>;
|
|
137
|
+
discoveryState(): Promise<OAuthDiscoveryState | undefined>;
|
|
138
|
+
saveDiscoveryState(state: OAuthDiscoveryState): Promise<void>;
|
|
137
139
|
tokens(ctx?: OAuthClientInformationContext): Promise<OAuthTokens | undefined>;
|
|
138
140
|
saveTokens(tokens: OAuthTokens, ctx?: OAuthClientInformationContext): Promise<void>;
|
|
139
141
|
/**
|
|
@@ -24,6 +24,7 @@ const OAUTH_VALUE_KEYS = [
|
|
|
24
24
|
"oauth:pending",
|
|
25
25
|
"oauth:verifier",
|
|
26
26
|
"oauth:state",
|
|
27
|
+
"oauth:discovery",
|
|
27
28
|
];
|
|
28
29
|
const MAX_CLEANUP_BACKLOG = 1_000;
|
|
29
30
|
function isRefreshTokenRequest(init) {
|
|
@@ -621,6 +622,12 @@ export class KvOAuthProvider {
|
|
|
621
622
|
async saveClientInformation(info, ctx) {
|
|
622
623
|
await this.writeValue("oauth:client", info, (value) => JSON.stringify(value), ctx?.issuer);
|
|
623
624
|
}
|
|
625
|
+
async discoveryState() {
|
|
626
|
+
return (await this.readValue("oauth:discovery", (raw) => JSON.parse(raw)))?.value;
|
|
627
|
+
}
|
|
628
|
+
async saveDiscoveryState(state) {
|
|
629
|
+
await this.writeValue("oauth:discovery", state, (value) => JSON.stringify(value));
|
|
630
|
+
}
|
|
624
631
|
async tokens(ctx) {
|
|
625
632
|
const refreshGeneration = ctx ? await this.flowGeneration() : undefined;
|
|
626
633
|
const successIdentity = refreshGeneration !== undefined
|
|
@@ -800,6 +807,7 @@ export class KvOAuthProvider {
|
|
|
800
807
|
oauthValueStorageKey("oauth:client", generation),
|
|
801
808
|
oauthValueStorageKey("oauth:tokens", generation),
|
|
802
809
|
oauthValueStorageKey("oauth:verifier", generation),
|
|
810
|
+
oauthValueStorageKey("oauth:discovery", generation),
|
|
803
811
|
]);
|
|
804
812
|
}
|
|
805
813
|
else if (scope === "client") {
|
|
@@ -811,6 +819,9 @@ export class KvOAuthProvider {
|
|
|
811
819
|
else if (scope === "verifier") {
|
|
812
820
|
await this.storage.delete(oauthValueStorageKey("oauth:verifier", generation));
|
|
813
821
|
}
|
|
822
|
+
else if (scope === "discovery") {
|
|
823
|
+
await this.storage.delete(oauthValueStorageKey("oauth:discovery", generation));
|
|
824
|
+
}
|
|
814
825
|
if (endsRefresh) {
|
|
815
826
|
this.failRefreshFlight(new Error("OAuth refresh invalidated credentials before tokens were saved."));
|
|
816
827
|
}
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
|
@@ -57,7 +57,7 @@ exist so far:
|
|
|
57
57
|
| --- | --- | --- |
|
|
58
58
|
| **pre-template** | before 0.10.2 | no `connecta init` existed; hand-written, or copied from the retired `examples/node` |
|
|
59
59
|
| **A** | 0.10.2 – 0.15.1 | `.env.example`, `.gitignore`, `AGENTS.md`, `CLAUDE.md`, `README.md`, `package.json`, `src/index.ts`, `tsconfig.json` |
|
|
60
|
-
| **B** | 0.16.0 – 0.22.
|
|
60
|
+
| **B** | 0.16.0 – 0.22.3 | adds `.dockerignore`, `Dockerfile`, `docker-compose.yml`, and `src/file-activity.ts`; `src/index.ts` grows the four commented operator blocks; `.env.example` ships `CONNECTA_TOKEN=` empty |
|
|
61
61
|
|
|
62
62
|
Generation A is a decade in template years and identifying it precisely does
|
|
63
63
|
not matter, because you are about to reconstruct it exactly rather than guess
|
|
@@ -106,7 +106,7 @@ know what to preserve, once to know what to re-verify at the end.
|
|
|
106
106
|
### Bump the pin and install
|
|
107
107
|
|
|
108
108
|
```sh
|
|
109
|
-
npm pkg set dependencies.@zackbart/connecta=0.22.
|
|
109
|
+
npm pkg set dependencies.@zackbart/connecta=0.22.3
|
|
110
110
|
npm install
|
|
111
111
|
```
|
|
112
112
|
|
|
@@ -130,7 +130,7 @@ Generate the *current* template beside the base you already made, into the same
|
|
|
130
130
|
`$SCRATCH`:
|
|
131
131
|
|
|
132
132
|
```sh
|
|
133
|
-
(cd "$SCRATCH" && npx @zackbart/connecta@0.22.
|
|
133
|
+
(cd "$SCRATCH" && npx @zackbart/connecta@0.22.3 init current)
|
|
134
134
|
```
|
|
135
135
|
|
|
136
136
|
You now have a three-way merge with a real base: `$SCRATCH/base` is what this
|
|
@@ -186,7 +186,7 @@ A deployment older than 0.10.2 has no base to diff against. Do not try to
|
|
|
186
186
|
manufacture one. Instead:
|
|
187
187
|
|
|
188
188
|
1. `SCRATCH=$(mktemp -d)`, then
|
|
189
|
-
`(cd "$SCRATCH" && npx @zackbart/connecta@0.22.
|
|
189
|
+
`(cd "$SCRATCH" && npx @zackbart/connecta@0.22.3 init current)` — there is no
|
|
190
190
|
`base` leg here, only the current template to read from.
|
|
191
191
|
2. Copy `$SCRATCH/current` into the deployment file by file, **skipping
|
|
192
192
|
`src/index.ts`**.
|
|
@@ -207,7 +207,7 @@ first, so cross them bottom-up: start at the oldest one still above this
|
|
|
207
207
|
deployment's pin and work back up the page, because each boundary assumes the
|
|
208
208
|
older ones are already done.
|
|
209
209
|
|
|
210
|
-
### 0.21.2 → 0.22.
|
|
210
|
+
### 0.21.2 → 0.22.3
|
|
211
211
|
|
|
212
212
|
Connector and user policy remain config-as-code. If `identity.connectorAccess`
|
|
213
213
|
is configured, every interactive human may now manage the authentication of
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zackbart/connecta",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"description": "One MCP to rule them all — a single MCP endpoint aggregating many downstream connectors behind a code-first surface of seven meta-tools.",
|