MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / fixedTokenAuth

Function fixedTokenAuth

packages/server/test/helpers/serverHarness.ts:43–50  ·  view source on GitHub ↗
(token: string = DEFAULT_TOKEN)

Source from the content-addressed store, hash-verified

41 * subprotocol helpers) stay consistent; `isValid` accepts only that token.
42 */
43export function fixedTokenAuth(token: string = DEFAULT_TOKEN): ServiceOverride {
44 const impl: IAuthTokenServiceType = {
45 _serviceBrand: undefined,
46 getToken: () => token,
47 isValid: async (candidate) => candidate === token,
48 };
49 return [IAuthTokenService, impl];
50}
51
52/** An `Authorization: Bearer <token>` header bag, for spreading into `headers`. */
53export function authHeaders(token: string = DEFAULT_TOKEN): { Authorization: string } {

Callers 15

bootFunction · 0.90
bootDaemonFunction · 0.90
bootDaemonFunction · 0.90
bootDaemonFunction · 0.90
bootDaemonFunction · 0.90
spawnFunction · 0.90
bootFunction · 0.90
bootDaemonFunction · 0.90
bootDaemonFunction · 0.90
bootDaemonFunction · 0.90
bootDaemonFunction · 0.90

Calls

no outgoing calls

Tested by 15

bootFunction · 0.72
bootDaemonFunction · 0.72
bootDaemonFunction · 0.72
bootDaemonFunction · 0.72
bootDaemonFunction · 0.72
spawnFunction · 0.72
bootFunction · 0.72
bootDaemonFunction · 0.72
bootDaemonFunction · 0.72
bootDaemonFunction · 0.72
bootDaemonFunction · 0.72
bootFunction · 0.72