@everyai/cli 0.6.0 → 0.6.2
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/lib/auth/dcr.js +4 -0
- package/dist/lib/auth/flow.js +7 -1
- package/package.json +10 -2
package/dist/lib/auth/dcr.js
CHANGED
|
@@ -44,6 +44,10 @@ async function postClientRegistration(metadata, redirectUri) {
|
|
|
44
44
|
headers: { 'content-type': 'application/json', accept: 'application/json' },
|
|
45
45
|
body: JSON.stringify({
|
|
46
46
|
client_name: CLIENT_NAME,
|
|
47
|
+
// MCP 2026-07-28 requires clients to declare this. We are a native app
|
|
48
|
+
// on a loopback redirect, and saying so stops an OIDC-compliant server
|
|
49
|
+
// from rejecting the http:// redirect_uri that web clients may not use.
|
|
50
|
+
application_type: 'native',
|
|
47
51
|
redirect_uris: [redirectUri],
|
|
48
52
|
grant_types: ['authorization_code', 'refresh_token'],
|
|
49
53
|
response_types: ['code'],
|
package/dist/lib/auth/flow.js
CHANGED
|
@@ -57,7 +57,7 @@ async function createLoopbackCallbackServer(state) {
|
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
59
|
writeHtml(response, 200, callbackHtml());
|
|
60
|
-
settle?.({ code });
|
|
60
|
+
settle?.({ code, iss: url.searchParams.get('iss') ?? undefined });
|
|
61
61
|
});
|
|
62
62
|
await new Promise((resolve, rejectPromise) => {
|
|
63
63
|
server.once('error', rejectPromise);
|
|
@@ -155,6 +155,12 @@ export async function loginFlow(opts) {
|
|
|
155
155
|
opts.onAuthorizationUrl?.(authorizationUrl);
|
|
156
156
|
await (opts.openBrowser ?? openBrowser)(authorizationUrl);
|
|
157
157
|
const callback = await Promise.race([loopback.waitForCallback, timeout]);
|
|
158
|
+
// RFC 9207 mix-up defense: if the server identified itself, it must be the one
|
|
159
|
+
// we discovered. Absent `iss` is left alone -- not every server sends it, and
|
|
160
|
+
// rejecting that would break logins against servers that are otherwise fine.
|
|
161
|
+
if (callback.iss !== undefined && callback.iss !== discovery.authServer.issuer) {
|
|
162
|
+
throw new CliError(`OAuth callback issuer did not match: expected ${discovery.authServer.issuer}, got ${callback.iss}`, ExitCode.AUTH, 'auth');
|
|
163
|
+
}
|
|
158
164
|
const elapsed = Date.now() - startedAt;
|
|
159
165
|
if (elapsed > timeoutMs) {
|
|
160
166
|
throw new CliError('Login timed out after 300s', ExitCode.AUTH, 'auth');
|
package/package.json
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everyai/cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "git+https://github.com/Every-AI-Inc/everyai-cli.git"
|
|
7
|
+
},
|
|
8
|
+
"homepage": "https://github.com/Every-AI-Inc/everyai-cli#readme",
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/Every-AI-Inc/everyai-cli/issues"
|
|
11
|
+
},
|
|
4
12
|
"private": false,
|
|
5
13
|
"description": "The agent-agnostic command-line surface for Every AI.",
|
|
6
14
|
"type": "module",
|
|
@@ -18,7 +26,7 @@
|
|
|
18
26
|
},
|
|
19
27
|
"publishConfig": {
|
|
20
28
|
"access": "public",
|
|
21
|
-
"provenance":
|
|
29
|
+
"provenance": true
|
|
22
30
|
},
|
|
23
31
|
"scripts": {
|
|
24
32
|
"build": "tsc",
|