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

Function sendBanResponse

server/src/middleware/auth.ts:140–149  ·  view source on GitHub ↗

* Send a 403 ban response.

(res: Response, ban: Ban)

Source from the content-addressed store, hash-verified

138 * Send a 403 ban response.
139 */
140function sendBanResponse(res: Response, ban: Ban): void {
141 const body: Record<string, unknown> = {
142 error: 'Account suspended',
143 reason: ban.reason,
144 };
145 if (ban.expires_at) {
146 body.expires_at = ban.expires_at;
147 }
148 res.status(403).json(body);
149}
150
151function hashSessionCookie(cookie: string): string {
152 return createHash('sha256').update(cookie).digest('hex');

Callers 1

requireAuthFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected