Skip to content

v0.145.0

Choose a tag to compare

@nstfkc nstfkc released this 15 Oct 22:46
· 277 commits to main since this release

MCP: PrismaMcpOAuthStore and PrismaNonceStore, shared stores on the app's database

New, nothing to migrate. See MCP Server → The store and Approval.

  • PrismaMcpOAuthStore (gemi/services): a ready-made McpOAuthStore on three models (McpOAuthClient, McpOAuthCredential, McpOAuthUse; the schema is in the docs), given as gemi ORM model classes or a Prisma client's delegates. It adds connectedApps(userId), disconnect(userId, familyId), revokeUser(userId), prune() and nonces().
  • PrismaNonceStore (gemi/ai): a NonceStore on a key/expiresAt model, for route.mcp.remote.nonces (or an AgentController's nonces) on an app without Redis. A nonce is spent by inserting it as the primary key, so it is single-use across instances. prune() deletes expired rows.
  • An app that wrote its own Prisma store with these models (like the one in the docs before) can switch to PrismaMcpOAuthStore without a migration, as long as McpOAuthCredential has createdAt DateTime @default(now()).

MCP: route.mcp.remote.onCall, an audit hook for remote tool calls

New, nothing to migrate. See MCP Server → Auditing calls.

  • onCall(event) runs once after every remote tools/call has been answered, including failures and refusals. The event carries the user, the resolver (via), the credential id (the OAuth grant or API key id), the OAuth clientId, the scopes, the tool, its arguments, the outcome (ok, error or denied, with a reason for denied), whether the user approved it, and durationMs.
  • It is awaited before the answer is sent. A hook that throws is logged and does not change the answer.
  • New exported types: McpCallEvent, McpCallOutcome, McpCallDenial (from gemi/services).

Meta.openGraph without an image, and twitter:card (#961)

New, plus a small behaviour change. Nothing to migrate. See Views & Layouts.

  • image is optional. og:image is rendered only when it is set.
  • twitter:card is always rendered when Meta.openGraph is called: summary_large_image when twitterImage ?? image is set (as before), summary otherwise. Before, a page without twitterImage got no twitter:card. The new twitterCard option picks the card type explicitly.
  • Image paths. image and twitterImage now get the app origin each on their own. Before, a relative image prefixed twitterImage too, even an absolute one, and a relative twitterImage next to an absolute image was left relative. Pages that pass only image render exactly as before.

A trusted client-IP header without route.domains, and ip:port in X-Forwarded-For (#958)

New, plus a small behaviour change. Nothing to migrate. See Configuration → A trusted client-IP header.

  • GEMI_CLIENT_IP_HEADER, GEMI_PROXY_SECRET_HEADER, GEMI_PROXY_SECRET (new). These do what route.domains.trustProxy.clientIpHeader does, for an app without route.domains. On a request whose secret header matches, the client-IP header's first entry becomes the only entry of X-Forwarded-For, before the global middleware, so clientIp(req) and every rate limit see it. Without the secret, the address GEMI_TRUST_PROXY chose is kept. Set all three or none: a partial set, a bad header name or a secret under 16 characters fails the boot. Behind Azure Front Door: GEMI_CLIENT_IP_HEADER=x-azure-clientip, GEMI_PROXY_SECRET_HEADER=x-azure-fdid, GEMI_PROXY_SECRET=<Front Door profile ID>.
  • ip:port entries (behaviour change). The X-Forwarded-For entry GEMI_TRUST_PROXY=<n> picks is now stored without its port (203.0.113.7:51234 gives 203.0.113.7, [2001:db8::1]:443 gives 2001:db8::1). Before, each connection's source port gave the client a fresh rate-limit bucket. A chosen entry that is not an IP address at all now falls back to the socket's peer address instead of being used as sent. clientIp(req) and the broadcast per-IP cap drop the port as well.
  • route.domains.trustProxy.clientIpHeader now accepts a value with a port and reads it without the port. Before, such a value was ignored.