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

Function createAuthServer

benchmarks/auth.js:17–30  ·  view source on GitHub ↗

* Creates a test server with authentication enabled

(authConfig)

Source from the content-addressed store, hash-verified

15 * Creates a test server with authentication enabled
16 */
17function createAuthServer (authConfig) {
18 return tenso({
19 port: 0,
20 silent: true,
21 logging: { enabled: false },
22 auth: {
23 protect: ["/protected.*"],
24 unprotect: [],
25 ...authConfig
26 },
27 rate: { enabled: false },
28 security: { csrf: false }
29 });
30}
31
32/**
33 * Creates mock request objects for testing

Callers 2

benchmarkBasicAuthFunction · 0.85
benchmarkBearerAuthFunction · 0.85

Calls 1

tensoFunction · 0.90

Tested by

no test coverage detected