MCPcopy Create free account
hub / github.com/dwgx/WindsurfAPI / nativeBridgeCallerKeyForRequest

Function nativeBridgeCallerKeyForRequest

src/server.js:105–113  ·  view source on GitHub ↗
(req, token, body, callerKey = '')

Source from the content-addressed store, hash-verified

103}
104
105function nativeBridgeCallerKeyForRequest(req, token, body, callerKey = '') {
106 const key = callerKey || callerKeyFromRequest(req, token, body);
107 const tokenAllowlist = String(process.env.WINDSURFAPI_NATIVE_TOOL_BRIDGE_API_KEYS || '')
108 .split(',')
109 .map(s => s.trim())
110 .filter(Boolean);
111 if (!tokenAllowlist.length) return key;
112 return tokenAllowlist.includes(String(token || '').trim()) ? `${key}:api_key_allowed` : key;
113}
114
115function json(res, status, body) {
116 const data = JSON.stringify(body);

Callers 1

routeFunction · 0.85

Calls 1

callerKeyFromRequestFunction · 0.90

Tested by

no test coverage detected