MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / verifyChannelStillPrivate

Function verifyChannelStillPrivate

server/src/slack/client.ts:427–454  ·  view source on GitHub ↗
(
  channelId: string,
)

Source from the content-addressed store, hash-verified

425 * #2735
426 */
427export async function verifyChannelStillPrivate(
428 channelId: string,
429): Promise<ChannelPrivacyState> {
430 const info = await getChannelInfo(channelId);
431 if (!info) {
432 logger.warn(
433 { channelId, event: 'channel_privacy_verify_unavailable' },
434 'Could not verify Slack channel privacy state — caller must decide whether to proceed',
435 );
436 return 'unknown';
437 }
438 if (info.is_private !== true) {
439 // Drop the stale cache entry so a rapid re-privatize by an admin
440 // is picked up on the very next send rather than after the remaining
441 // TTL. `getChannelInfo`'s next call will re-fetch.
442 channelCache.delete(channelId);
443 logger.warn(
444 {
445 channelId,
446 channelName: info.name,
447 event: 'channel_privacy_drift',
448 },
449 'Configured Slack channel is no longer private — refusing to post sensitive content. Admin action required to re-privatize or unlink.',
450 );
451 return 'public';
452 }
453 return 'private';
454}
455
456/**
457 * Result of `verifyChannelPrivacyForWrite` — the write-time gate that

Callers 3

runChannelPrivacyAuditFunction · 0.85
sendChannelMessageFunction · 0.85

Calls 3

getChannelInfoFunction · 0.85
warnMethod · 0.80
deleteMethod · 0.80

Tested by

no test coverage detected