MCPcopy Create free account
hub / github.com/avoidwork/tenso / bearerAuthCheck

Function bearerAuthCheck

benchmarks/auth.js:160–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158
159 // Mock bearer token validation
160 const bearerAuthCheck = req => {
161 const auth = req.headers.authorization;
162 if (!auth || !auth.startsWith("Bearer ")) return false;
163
164 const token = auth.slice(7);
165 const validTokens = ["token123", "token456", "secret789", "admin-token"];
166
167 return validTokens.includes(token);
168 };
169
170 suite
171 .add("Bearer Auth - Valid token", () => {

Callers 1

benchmarkBearerAuthFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected