Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: require operator authority for Messages selector testing, updates and token extraction (#11449)

[._.]/ Adam Eivy811db86bd9d5
diff --git a/server/lib/hostControlRoutes.js b/server/lib/hostControlRoutes.js
index ae4e20690b..4489565fc9 100644
--- a/server/lib/hostControlRoutes.js
+++ b/server/lib/hostControlRoutes.js
@@ -206,6 +206,12 @@ export const HOST_CONTROL_ROUTES = Object.freeze([
'POST /api/messages/gmail/enable-api',
// Archive and delete act on mail items in the external account (#11434).
'POST /api/messages/:accountId/:messageId/action',
+ // Selector tests drive the host CDP browser against live Outlook/Teams tabs,
+ // selector edits change that automation, and token extraction intercepts
+ // bearer tokens from those sessions (#11449).
+ 'POST /api/messages/selectors/:provider/test',
+ 'PUT /api/messages/selectors/:provider',
+ 'POST /api/messages/debug/test-token',
// Capture activation and existing live feeds require operator authority (#11272).
// HEAD inherits the GET policy because Express invokes the same handler.
diff --git a/server/lib/hostControlRoutes.test.js b/server/lib/hostControlRoutes.test.js
index 5830c0b509..d1dc7ebbd8 100644
--- a/server/lib/hostControlRoutes.test.js
+++ b/server/lib/hostControlRoutes.test.js
@@ -177,6 +177,19 @@ describe('outbound mail host-control policy (#11273)', () => {
expect(isHostControlRoute('GET', '/api/messages/acct-1/msg-1')).toBe(false);
expect(isHostControlRoute('POST', '/api/messages/acct-1/msg-1/read')).toBe(false);
});
+
+ it('gates selector testing/updates and token extraction while keeping selector reads open (#11449)', () => {
+ const mounted = new Set(getApiRouteCatalog().routes.map(({ method, path }) => method + ' ' + path));
+ for (const [method, path, route] of [
+ ['POST', '/api/messages/selectors/outlook/test', 'POST /api/messages/selectors/:provider/test'],
+ ['PUT', '/api/messages/selectors/outlook', 'PUT /api/messages/selectors/:provider'],
+ ['POST', '/api/messages/debug/test-token', 'POST /api/messages/debug/test-token'],
+ ]) {
+ expect(mounted.has(route)).toBe(true);
+ expect(hostControlRouteFor(method, path)).toBe(route);
+ }
+ expect(isHostControlRoute('GET', '/api/messages/selectors')).toBe(false);
+ });
});
describe('X (Twitter) review and browser automation policy', () => {