Files
Tom MoorandClaude Opus 5 c74fd2e649 fix: Apply MCP preference to dynamically registered OAuth clients (#13418)
* fix: Apply MCP preference to dynamically registered OAuth clients

Dynamically registered clients exist only to serve MCP, but the preference
was only consulted at registration time. They are now unreadable once the
preference is off, and their outstanding grants are revoked at the point it
changes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: Keep default retry options on revocation task

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* refactor: Rename MCPDisabledProcessor to TeamUpdatedProcessor

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-13 21:43:56 -04:00

19 lines
753 B
TypeScript

import { TeamPreference } from "@shared/types";
import type { Event as TEvent, TeamEvent } from "@server/types";
import RevokeDynamicOAuthClientsTask from "../tasks/RevokeDynamicOAuthClientsTask";
import BaseProcessor from "./BaseProcessor";
export default class TeamUpdatedProcessor extends BaseProcessor {
static applicableEvents: TEvent["name"][] = ["teams.update"];
async perform(event: TeamEvent) {
// Dynamically registered clients exist only to serve MCP, so their
// outstanding access is revoked when the workspace turns the feature off.
if (event.changes?.attributes.preferences?.[TeamPreference.MCP] === false) {
await new RevokeDynamicOAuthClientsTask().schedule({
teamId: event.teamId,
});
}
}
}