MCPcopy Index your code
hub / github.com/callstack/agent-device / isAuthorized

Function isAuthorized

src/remote/daemon-proxy.ts:342–345  ·  view source on GitHub ↗
(req: IncomingMessage, expectedToken: string, rpcBody: string | undefined)

Source from the content-addressed store, hash-verified

340}
341
342function isAuthorized(req: IncomingMessage, expectedToken: string, rpcBody: string | undefined) {
343 const requestToken = resolveRequestToken(req, rpcBody);
344 return requestToken.length > 0 && timingSafeStringEqual(requestToken, expectedToken);
345}
346
347function resolveRequestToken(req: IncomingMessage, rpcBody: string | undefined): string {
348 const authHeader = typeof req.headers.authorization === 'string' ? req.headers.authorization : '';

Callers 1

handleProxyRequestFunction · 0.85

Calls 2

timingSafeStringEqualFunction · 0.90
resolveRequestTokenFunction · 0.85

Tested by

no test coverage detected