mirror of
https://github.com/outline/outline.git
synced 2026-11-20 21:23:06 +03:00
* 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>
19 lines
753 B
TypeScript
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,
|
|
});
|
|
}
|
|
}
|
|
}
|