MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / loadOrMintLocalAuthToken

Function loadOrMintLocalAuthToken

apps/local/src/auth.ts:64–65  ·  view source on GitHub ↗
(dataDir: string = resolveExecutorDataDir())

Source from the content-addressed store, hash-verified

62 * call. Idempotent: subsequent calls return the same token.
63 */
64export const loadOrMintLocalAuthToken = (dataDir: string = resolveExecutorDataDir()): string =>
65 readToken(localAuthTokenPath(dataDir)) ?? writeToken(dataDir, mintToken());
66
67/**
68 * Rotate the local bearer token: mint a fresh one and overwrite the file.

Callers 2

configureServerFunction · 0.90
startServerFunction · 0.90

Calls 5

resolveExecutorDataDirFunction · 0.70
readTokenFunction · 0.70
localAuthTokenPathFunction · 0.70
writeTokenFunction · 0.70
mintTokenFunction · 0.70

Tested by

no test coverage detected