diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c70225..d48581a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [2.7.0] - 2026-11-24 + +### Added +- **Standard MCP OAuth 2.1 + PKCE (`S256`) Authorization Server (`src/middleware/oauth.ts`)**: + - **RFC 9728 Protected Resource Metadata**: `GET /.well-known/oauth-protected-resource` and `/.well-known/oauth-protected-resource/mcp` + `WWW-Authenticate` challenge on all `401 Unauthorized` `/mcp` responses (`POST`, `GET`, `DELETE`) with CORS exposure (`Access-Control-Expose-Headers: mcp-session-id, WWW-Authenticate`). + - **RFC 8414 Authorization Server Metadata**: `GET /.well-known/oauth-authorization-server` and `/.well-known/openid-configuration` advertising PKCE `S256`, `authorization_code`, and `refresh_token` grants. + - **RFC 7591 Dynamic Client Registration (`POST /oauth/register`)**: Restart-proof HMAC-signed client IDs supporting Google Gemini (`*.googleusercontent.com`), Claude, ChatGPT, Antigravity, Cursor, VS Code, and RFC 8252 loopback redirects while strictly rejecting untrusted redirect hosts. + - **Silicon Valley Global Consent & Aura Cloud SSO (`GET/POST /oauth/authorize`)**: Instant 1-click consent for signed-in Aura Cloud accounts (`aura_access` cookie), native **Continue with Google** & Work Email sign-in via `auth.auraajenticai.cloud`, Developer/Merchant API Key tab, 1-click Read-Only Sandbox for evaluators, and crisp inline vector SVG branding. + - **Gemini-Safe Non-Rotating Refresh & Dual-Auth (`POST /oauth/token`, `POST /oauth/revoke`, `src/middleware/auth.ts`)**: `application/x-www-form-urlencoded` + JSON token exchange with PKCE `S256`, 180-day non-rotating refresh tokens (preventing Google Gemini unlinking), and full Dual-Auth compatibility preserving static Bearer API Keys, PostgreSQL dynamic keys (`aura_courier_runtime`), and BYOK carrier headers. +- **Automated OAuth 2.1 Acceptance Suite (`test/oauth21.test.mjs`)**: Full end-to-end verification of discovery, DCR, SSO cookie consent, Read-Only Sandbox, PKCE `S256`, non-rotating refresh, Dual-Auth, and RFC 7009 revocation alongside all 25 existing tests. + ## [2.6.1] - 2026-11-13 ### Fixed & Changed diff --git a/README.md b/README.md index 9156a27..d9960e0 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# 🚚 AURA COURIER MCP v2.6.1 — THE ENTERPRISE LOGISTICS MASTER MANUAL +# 🚚 AURA COURIER MCP v2.7.0 — THE ENTERPRISE LOGISTICS MASTER MANUAL ### Universal Multi-Carrier Logistics Engine, Spatial Intelligence Hub & Zero-Risk COD Gateway **Published by Aura Agentic AI · Architected with DeepMind Principles & Google Maps Platform** [![Google Cloud Partner Advantage](https://img.shields.io/badge/Google_Cloud_Partner-Aura_Ajentic_AI-4285F4?logo=google-cloud&logoColor=white)](https://cloud.google.com/find-a-partner/partner/aura-ajentic-ai) [![auraajenticai/aura-courier-mcp MCP server](https://glama.ai/mcp/servers/auraajenticai/aura-courier-mcp/badges/score.svg)](https://glama.ai/mcp/servers/auraajenticai/aura-courier-mcp) -[![Antigravity Plugin](https://img.shields.io/badge/Antigravity_Plugin-v2.6.1-0676FF?logo=google&logoColor=white)](plugin.json) +[![Antigravity Plugin](https://img.shields.io/badge/Antigravity_Plugin-v2.7.0-0676FF?logo=google&logoColor=white)](plugin.json) [![User Guide BN/EN](https://img.shields.io/badge/User_Guide-বাংলা_%26_English-f59e0b)](https://courier.auraajenticai.cloud/guide) [![License: Apache-2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Status](https://img.shields.io/badge/Status-Production%20Active-success.svg)](https://courier.auraajenticai.cloud) @@ -227,7 +227,7 @@ curl -s https://courier.auraajenticai.cloud/health | jq ```json { "ok": true, - "version": "2.6.1" + "version": "2.7.0" } ``` @@ -278,7 +278,7 @@ Add this configuration block to your client settings (`claude_desktop_config.jso "mcpServers": { "aura-courier": { "command": "npx", - "args": ["-y", "aura-courier-mcp@2.6.1"], + "args": ["-y", "aura-courier-mcp@2.7.0"], "env": { "PORT": "8080", "GOOGLE_MAPS_API_KEY": "", @@ -340,6 +340,9 @@ Bundles the complete `courier-ops` skill (9 tools), `rules/COURIER_RULES.md` (sm ## 9. Version History & Glama TDQS 5.0 Audit Log +* **v2.7.0 (Nov 24, 2026)**: + - **Standard MCP OAuth 2.1 + PKCE (`S256`) + RFC 9728 / 8414 / 7591 DCR**: Native remote OAuth connectivity for **Google Gemini**, **Antigravity Marketplace**, **ChatGPT**, and **Claude Web** with 1-click Aura Cloud SSO, Google Sign-In, Developer API Key Dual-Auth, and non-rotating refresh tokens. + - **13 Live Logistics & Spatial Tools + Full Glama / Antigravity Plugin Parity**: Synchronized all manifests (`package.json`, `plugin.json`, `server.json`, `validate_plugin.js`) and expanded automated tests (`30+` passing). * **v2.6.1 (Nov 13, 2026)**: - **Single-Source-of-Truth Release Parity (`src/version.ts`)**: Unified version synchronization across `package.json`, `server.json`, `plugin.json`, `/health`, MCP Server metadata, GitHub Releases, Gitea, Glama Registry, and live web UI (`v2.6.1`). - **TypeScript Strict `pnpm` Compatibility & Silicon Valley UI**: Explicit Express typing resolving Glama Dockerfile `TS2742`, inline SVG carrier/tool iconography, RedX monogram badge, and interactive `#hubmap` canvas animation. diff --git a/configs/README.md b/configs/README.md index 643b148..7cf2fba 100644 --- a/configs/README.md +++ b/configs/README.md @@ -8,7 +8,7 @@ Connect any AI Agent / IDE to Aura Courier MCP in seconds. - **Server-Sent Events / SSE (Claude Desktop, Remote SSE)**: `https://courier.auraajenticai.cloud/sse` - **NPX Direct CLI**: - `npx -y aura-courier-mcp@2.6.1` + `npx -y aura-courier-mcp@2.7.0` --- diff --git a/configs/antigravity_gemini.json b/configs/antigravity_gemini.json index ad329bd..e8bf4c3 100644 --- a/configs/antigravity_gemini.json +++ b/configs/antigravity_gemini.json @@ -9,7 +9,7 @@ }, "aura-courier-local": { "command": "npx", - "args": ["-y", "aura-courier-mcp@2.6.1"], + "args": ["-y", "aura-courier-mcp@2.7.0"], "env": { "PORT": "8080" } diff --git a/configs/claude_desktop_config.json b/configs/claude_desktop_config.json index 2ace93f..45feb84 100644 --- a/configs/claude_desktop_config.json +++ b/configs/claude_desktop_config.json @@ -6,7 +6,7 @@ }, "aura-courier-stdio": { "command": "npx", - "args": ["-y", "aura-courier-mcp@2.6.1"] + "args": ["-y", "aura-courier-mcp@2.7.0"] } } } diff --git a/dist/middleware/oauth.js b/dist/middleware/oauth.js index 00e5185..96f084d 100644 --- a/dist/middleware/oauth.js +++ b/dist/middleware/oauth.js @@ -5,6 +5,9 @@ const REFRESH_TOKEN_TTL_SEC = 180 * 24 * 3600; // 180 days (non-rotating for Gem const AUTH_CODE_TTL_SEC = 300; // 5 minutes const CSRF_TTL_SEC = 900; // 15 minutes const VALID_SCOPES = ["read", "write"]; +const AURA_AUTH_BASE = (process.env.AURA_AUTH_URL || "https://auth.auraajenticai.cloud").replace(/\/+$/, ""); +// Official inline vector SVG brand mark (from assets/logo.svg — instant render, zero broken-image risk) +const INLINE_LOGO_SVG = ``; // In-memory replay & revocation guards (with periodic TTL pruning) const usedAuthCodes = new Map(); // jti -> expiresAtMs const revokedTokenIds = new Map(); // jti -> expiresAtMs @@ -37,6 +40,109 @@ function safeEqualStr(a, b) { return false; return timingSafeEqual(ba, bb); } +function parseCookie(req, name) { + const raw = req.headers.cookie || ""; + if (!raw) + return null; + const parts = raw.split(";"); + for (const part of parts) { + const eq = part.indexOf("="); + if (eq <= 0) + continue; + const k = part.slice(0, eq).trim(); + if (k === name) { + const v = part.slice(eq + 1).trim(); + try { + return decodeURIComponent(v); + } + catch { + return v; + } + } + } + return null; +} +/** + * Verifies the shared `.auraajenticai.cloud` SSO cookie (`aura_access`) signed with HS256 by `auth.auraajenticai.cloud`. + * Enables zero-friction 1-click consent for signed-in Aura Cloud users (just like GitHub, Vercel, Linear, Notion). + */ +function verifyAuraSsoCookie(req) { + const secret = process.env.AURA_SSO_JWT_SECRET || process.env.JWT_SECRET || ""; + if (!secret) + return null; + const token = parseCookie(req, "aura_access"); + if (!token) + return null; + const parts = token.split("."); + if (parts.length !== 3) + return null; + const [headerB64, bodyB64, sigB64] = parts; + try { + const header = JSON.parse(Buffer.from(headerB64, "base64url").toString("utf8")); + if (header?.alg !== "HS256") + return null; + const expectedSig = createHmac("sha256", Buffer.from(secret, "utf8")) + .update(`${headerB64}.${bodyB64}`) + .digest("base64url"); + if (!safeEqualStr(sigB64, expectedSig)) + return null; + const payload = JSON.parse(Buffer.from(bodyB64, "base64url").toString("utf8")); + const nowSec = Math.floor(Date.now() / 1000); + if (typeof payload?.exp === "number" && payload.exp <= nowSec) + return null; + if (typeof payload?.sub !== "string" || typeof payload?.email !== "string") + return null; + const role = String(payload.role || "client").toLowerCase(); + const normalizedRole = role === "owner" || role === "admin" || role === "team_member" ? role : "client"; + return { + sub: payload.sub, + email: payload.email.toLowerCase().trim(), + role: normalizedRole, + }; + } + catch { + return null; + } +} +function mapSsoUserToAuth(user) { + const isOwnerOrAdmin = user.role === "owner" || user.role === "admin"; + if (isOwnerOrAdmin) { + return { tenantId: "master", isAdmin: true, scopes: ["read", "write"] }; + } + return { tenantId: `aura_${user.sub}`, isAdmin: false, scopes: ["read", "write"] }; +} +async function authenticateWithAuraPassword(email, password) { + const ctrl = new AbortController(); + const timer = setTimeout(() => ctrl.abort(), 5000); + try { + const resp = await fetch(`${AURA_AUTH_BASE}/api/auth/login`, { + method: "POST", + headers: { "Content-Type": "application/json", Accept: "application/json" }, + body: JSON.stringify({ email: email.trim().toLowerCase(), password }), + signal: ctrl.signal, + }); + const data = await resp.json().catch(() => ({})); + if (!resp.ok || !data?.user?.id || !data?.user?.email) { + return { ok: false, error: data?.error || "Invalid email or password." }; + } + const role = String(data.user.role || "client").toLowerCase(); + const normalizedRole = role === "owner" || role === "admin" || role === "team_member" ? role : "client"; + return { + ok: true, + user: { + sub: String(data.user.id), + email: String(data.user.email).toLowerCase().trim(), + role: normalizedRole, + }, + }; + } + catch { + return { ok: false, error: "Aura Sign-In service is temporarily unreachable. Please try Google Sign-In or an API key." }; + } + finally { + clearTimeout(timer); + } +} function signJwt(payload, purpose) { const header = Buffer.from(JSON.stringify({ alg: "HS256", typ: "JWT" })).toString("base64url"); const body = Buffer.from(JSON.stringify(payload)).toString("base64url"); @@ -122,7 +228,6 @@ export function isAllowedRedirectUri(uri) { return false; const proto = parsed.protocol.toLowerCase(); const host = parsed.hostname.toLowerCase(); - // Desktop IDE & native MCP app custom URI schemes if (proto === "cursor:" || proto === "vscode:" || proto === "vscode-insiders:" || @@ -132,7 +237,6 @@ export function isAllowedRedirectUri(uri) { proto === "cline:") { return true; } - // RFC 8252 loopback redirect URIs for local CLIs & MCP Inspector if ((proto === "http:" || proto === "https:") && (host === "localhost" || host === "127.0.0.1" || host === "[::1]")) { return true; @@ -140,22 +244,17 @@ export function isAllowedRedirectUri(uri) { if (proto !== "https:") return false; const trustedHostPatterns = [ - // Google / Gemini / AI Studio / Antigravity /^(?:.+\.)?googleusercontent\.com$/, /^(?:.+\.)?google\.com$/, /^(?:.+\.)?googleapis\.com$/, /^(?:.+\.)?google\.dev$/, /^(?:.+\.)?antigravity\.google$/, - // Claude / Anthropic /^(?:.+\.)?claude\.ai$/, /^(?:.+\.)?anthropic\.com$/, - // OpenAI / ChatGPT /^(?:.+\.)?chatgpt\.com$/, /^(?:.+\.)?openai\.com$/, - // Aura & Snehalata Ecosystem /^(?:.+\.)?auraajenticai\.cloud$/, /^(?:.+\.)?snehalata\.com$/, - // MCP Directories & API Clients /^(?:.+\.)?glama\.ai$/, /^(?:.+\.)?smithery\.ai$/, /^(?:.+\.)?modelcontextprotocol\.io$/, @@ -284,251 +383,35 @@ function extractClientCredentials(req) { } } catch { - // Ignore malformed Basic header; fall back to body params + // Ignore malformed Basic header } } return { clientId, clientSecret }; } +function buildAuthorizeReturnUrl(opts) { + const u = new URL(`${opts.origin}/oauth/authorize`); + u.searchParams.set("response_type", "code"); + u.searchParams.set("client_id", opts.clientId); + u.searchParams.set("redirect_uri", opts.redirectUri); + if (opts.state) + u.searchParams.set("state", opts.state); + if (opts.scope) + u.searchParams.set("scope", opts.scope); + u.searchParams.set("code_challenge", opts.codeChallenge); + u.searchParams.set("code_challenge_method", opts.codeChallengeMethod || "S256"); + if (opts.resource) + u.searchParams.set("resource", opts.resource); + return u.toString(); +} function renderConsentPage(opts) { - const scopes = opts.scope - ? opts.scope.split(/[\s,]+/).filter(Boolean) - : ["read", "write"]; + const scopes = opts.scope ? opts.scope.split(/[\s,]+/).filter(Boolean) : ["read", "write"]; const hasWrite = scopes.some((s) => s.toLowerCase().includes("write")); - return ` - - - - - Authorize ${escapeHtml(opts.clientName)} — Aura Courier MCP - - - - - - - -
-
- Aura Courier MCP -
-

Aura Courier MCP

-

OAuth 2.1 + PKCE Merchant Authorization

-
-
- -
-
-
${escapeHtml(opts.clientName)}
-
Redirect: ${escapeHtml(opts.redirectHost)}
-
- PKCE S256 -
- -
-
Requested Permissions
-
    -
  • Read: Track parcels, check COD balance, verify fraud risk, geocode addresses & compare courier rates.
  • - ${hasWrite ? `
  • Write: Book, update, or cancel parcels across Steadfast, Pathao, RedX & Paperfly (according to your key scope).
  • ` : ""} -
-
- - ${opts.errorMessage ? `
${escapeHtml(opts.errorMessage)}
` : ""} - -
+ const returnUrl = buildAuthorizeReturnUrl(opts); + const googleSignInUrl = `${AURA_AUTH_BASE}/login/google?next=${encodeURIComponent(returnUrl)}`; + const auraLoginUrl = `${AURA_AUTH_BASE}/login?next=${encodeURIComponent(returnUrl)}`; + const auraRegisterUrl = `${AURA_AUTH_BASE}/register?next=${encodeURIComponent(returnUrl)}`; + const tab = opts.activeTab === "apikey" ? "apikey" : "account"; + const hiddenFields = ` @@ -536,27 +419,439 @@ function renderConsentPage(opts) { - - - -
- - -
-
- আপনার Aura Master Key, Tenant API Key, অথবা Snehalata snl_mcp_... কী দিন। Read-only টেস্টের জন্য: aura_ro_public_inspector_2026 + `; + const roleLabel = opts.ssoUser + ? opts.ssoUser.role === "owner" || opts.ssoUser.role === "admin" + ? "Workspace Owner" + : "Aura Merchant" + : ""; + const authSectionHtml = opts.ssoUser + ? ` +
+
${escapeHtml(opts.ssoUser.email.charAt(0).toUpperCase())}
+
+
${escapeHtml(opts.ssoUser.email)}
+
${escapeHtml(roleLabel)} · Switch account
+
+ + ${hiddenFields} +
- - + + +
+ ` + : ` + + + Continue with Google + + +
or continue with
+ +
+ + +
+ +
+ ${hiddenFields} + +
+ + +
+
+ +
+ + +
+
+
+ + +
+ +
+ +
+ ${hiddenFields} + +
+ +
+ + +
+
Generate or manage API keys anytime from your Aura Cloud Console.
+
+
+ +
+
+ ${hiddenFields} + + +
`; + return ` + + + + + Authorize ${escapeHtml(opts.clientName)} — Aura Courier + + + + +
+
+
${INLINE_LOGO_SVG}
+
+

Authorize ${escapeHtml(opts.clientName)}

+

Aura Courier MCP · Enterprise Logistics Hub

+
+
+ +
+
+
${escapeHtml(opts.clientName)}
+
${escapeHtml(opts.redirectHost)}
+
+ + + OAuth 2.1 + +
+ +
+
Permissions Requested
+
    +
  • + + Read logistics data: Track consignments, check COD balances, assess fraud risk, geocode addresses, and compare carrier rates. +
  • + ${hasWrite + ? `
  • + + Manage parcels: Create, update, and cancel shipments across connected carriers (within your workspace permissions). +
  • ` + : ""} +
+
+ + ${opts.errorMessage ? `
${escapeHtml(opts.errorMessage)}
` : ""} + + ${authSectionHtml} +
- Secured by Aura Ajentic AI · Privacy Policy + Protected by Aura Ajentic AI · Privacy · Docs
+ `; } @@ -592,7 +887,6 @@ function resolveClientMeta(clientId, redirectUri) { } return { valid: true, clientName: dcr.n || "MCP Client", authMethod: dcr.m }; } - // Allow non-DCR clients (e.g. Google Gemini / ChatGPT / Claude / local CLI) when redirect_uri is strictly allowlisted let inferredName = clientId.slice(0, 48); try { const h = new URL(redirectUri).hostname.toLowerCase(); @@ -694,7 +988,7 @@ export function registerOAuthRoutes(app) { } return res.status(201).json(responsePayload); }); - // 4. OAuth 2.1 Authorization Endpoint (GET Consent UI) + // 4. OAuth 2.1 Authorization Endpoint (GET Consent UI — 1-Click SSO, Google Sign-In, Email/Password, API Key, Sandbox) app.get("/oauth/authorize", (req, res) => { res.setHeader("Cache-Control", "no-store"); res.setHeader("X-Frame-Options", "DENY"); @@ -736,6 +1030,7 @@ export function registerOAuthRoutes(app) { codeChallenge, state, }); + const ssoUser = verifyAuraSsoCookie(req); return res.status(200).type("html").send(renderConsentPage({ origin, clientName: clientCheck.clientName, @@ -748,6 +1043,7 @@ export function registerOAuthRoutes(app) { codeChallengeMethod: "S256", resource: resource || `${origin}/mcp`, csrfToken, + ssoUser, })); }); // 5. OAuth 2.1 Authorization Endpoint (POST Consent Submission) @@ -765,7 +1061,7 @@ export function registerOAuthRoutes(app) { const resource = String(b.resource || "").trim(); const csrfToken = String(b.csrf_token || "").trim(); const decision = String(b.decision || "approve").trim().toLowerCase(); - const apiKey = String(b.api_key || "").trim(); + const authMode = String(b.auth_mode || (b.api_key ? "apikey" : "sso")).trim().toLowerCase(); const clientCheck = resolveClientMeta(clientId, redirectUri); if (!clientCheck.valid) { return res.status(400).json({ @@ -787,7 +1083,8 @@ export function registerOAuthRoutes(app) { redirectHost = new URL(redirectUri).host || redirectUri; } catch { } - const renderFailure = (errorMessage) => { + const ssoUser = verifyAuraSsoCookie(req); + const renderFailure = (errorMessage, activeTab = "account") => { const freshCsrf = signCsrfToken({ clientId, redirectUri, codeChallenge, state }); return res.status(200).type("html").send(renderConsentPage({ origin, @@ -801,22 +1098,63 @@ export function registerOAuthRoutes(app) { codeChallengeMethod: "S256", resource: resource || `${origin}/mcp`, csrfToken: freshCsrf, + ssoUser, + activeTab, errorMessage, })); }; - if (!apiKey) { - return renderFailure("Please enter your Aura API Key, Tenant Key, or Snehalata snl_mcp_... key."); + let resolvedTenantId = ""; + let resolvedAdmin = false; + let resolvedScopes = []; + if (decision === "sandbox" || authMode === "sandbox") { + // Strictly Read-Only Sandbox mode for evaluators / Antigravity Marketplace / Gemini reviewers + resolvedTenantId = "public_ro"; + resolvedAdmin = false; + resolvedScopes = ["read"]; } - // Validate submitted API key against ALL live auth backends (Master, Read-Only, Dynamic PG, Env, Snehalata) - const syntheticReq = { - headers: { authorization: `Bearer ${apiKey}` }, - query: {}, - }; - const authCtx = await resolveAuthContextAsync(syntheticReq); - if (!authCtx.authenticated) { - return renderFailure(authCtx.deniedReason || "Invalid API Key. Please check your Aura API Key or Snehalata MCP Key and try again."); + else if (authMode === "sso") { + if (!ssoUser) { + return renderFailure("Your Aura session has expired. Please sign in again to continue.", "account"); + } + const mapped = mapSsoUserToAuth(ssoUser); + resolvedTenantId = mapped.tenantId; + resolvedAdmin = mapped.isAdmin; + resolvedScopes = mapped.scopes; } - const grantedScopes = normalizeScopes(scope, authCtx.scopes); + else if (authMode === "password") { + const email = String(b.email || "").trim(); + const password = String(b.password || ""); + if (!email || !password) { + return renderFailure("Please enter both your email address and password.", "account"); + } + const loginRes = await authenticateWithAuraPassword(email, password); + if (!loginRes.ok || !loginRes.user) { + return renderFailure(loginRes.error || "Invalid email or password.", "account"); + } + const mapped = mapSsoUserToAuth(loginRes.user); + resolvedTenantId = mapped.tenantId; + resolvedAdmin = mapped.isAdmin; + resolvedScopes = mapped.scopes; + } + else { + // Developer / Merchant API Key authentication (Master, Dynamic PG, Env, or Partner keys) + const apiKey = String(b.api_key || "").trim(); + if (!apiKey) { + return renderFailure("Please enter a valid Aura Courier API key.", "apikey"); + } + const syntheticReq = { + headers: { authorization: `Bearer ${apiKey}` }, + query: {}, + }; + const authCtx = await resolveAuthContextAsync(syntheticReq); + if (!authCtx.authenticated) { + return renderFailure(authCtx.deniedReason || "Invalid API key. Please verify your key in Aura Cloud Console and try again.", "apikey"); + } + resolvedTenantId = authCtx.tenantId; + resolvedAdmin = authCtx.isAdmin; + resolvedScopes = authCtx.scopes; + } + const grantedScopes = normalizeScopes(scope, resolvedScopes); const nowSec = Math.floor(Date.now() / 1000); const codeClaims = { cid: clientId, @@ -824,8 +1162,8 @@ export function registerOAuthRoutes(app) { cc: codeChallenge, ccm: "S256", scp: grantedScopes, - sub: authCtx.tenantId, - adm: authCtx.isAdmin, + sub: resolvedTenantId, + adm: resolvedAdmin, res: resource || `${origin}/mcp`, typ: "code", iat: nowSec, @@ -846,7 +1184,6 @@ export function registerOAuthRoutes(app) { const b = (req.body || {}); const grantType = String(b.grant_type || "").trim(); const { clientId, clientSecret } = extractClientCredentials(req); - // If DCR client registered as confidential (client_secret_*), verify secret if (clientId && clientId.startsWith("aura_dcr_")) { const dcr = decodeDcrClientId(clientId); if (!dcr) { @@ -907,7 +1244,6 @@ export function registerOAuthRoutes(app) { error_description: "PKCE S256 code_verifier verification failed.", }); } - // Enforce single-use authorization code usedAuthCodes.set(codeClaims.jti, Date.now() + AUTH_CODE_TTL_SEC * 1000 * 2); const nowSec = Math.floor(Date.now() / 1000); const accessClaims = { @@ -979,7 +1315,7 @@ export function registerOAuthRoutes(app) { jti: randomBytes(16).toString("base64url"), }; const accessToken = signJwt(accessClaims, "access"); - // IMPORTANT FOR GOOGLE GEMINI: Keep refresh_token NON-ROTATING so Gemini never unlinks! + // Non-rotating refresh_token preserves long-lived Google Gemini MCP connections return res.status(200).json({ access_token: accessToken, token_type: "Bearer", diff --git a/dist/version.js b/dist/version.js index 94f046e..71d0747 100644 --- a/dist/version.js +++ b/dist/version.js @@ -11,6 +11,6 @@ function readPackageVersion() { catch { // Fallback if package.json is unavailable at runtime } - return "2.6.1"; + return "2.7.0"; } export const APP_VERSION = readPackageVersion(); diff --git a/guide.html b/guide.html index 1fd1ab1..6687756 100644 --- a/guide.html +++ b/guide.html @@ -1605,7 +1605,7 @@ Aura Courier MCP Logo
Aura Courier MCP - v2.6.1 + v2.7.0
  • - 📦 npm Package (v2.6.1) + 📦 npm Package (v2.7.0)
  • diff --git a/health.html b/health.html index a8be9c0..ee01096 100644 --- a/health.html +++ b/health.html @@ -360,7 +360,7 @@
    Aura Courier MCP - v2.6.1 · Telemetry + v2.7.0 · Telemetry