MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / buildKeyGenerator

Function buildKeyGenerator

apps/api/src/config/security/security.ts:87–97  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

85 const first = input.forwardedFor.split(",")[0]?.trim();
86
87 if (first !== undefined && first !== "") {
88 return first;
89 }
90 }
91
92 return input.socketAddress ?? "";
93};
94
95const buildKeyGenerator = (): Generator | undefined => {
96 if (!env.TRUST_PROXY) {
97 return undefined;
98 }
99
100 return (request, server) =>

Callers 2

buildRateLimitFunction · 0.85
buildAuthRateLimitFunction · 0.85

Calls 2

extractTrustedClientIpFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected