MCPcopy Create free account
hub / github.com/METR/vivaria / parseAuthHeader

Method parseAuthHeader

server/src/docker/agents.ts:92–102  ·  view source on GitHub ↗
(header: string)

Source from the content-addressed store, hash-verified

90 }
91
92 static parseAuthHeader(header: string): FakeLabApiKey | null {
93 if (!header.includes(FAKE_LAB_API_KEY_SEPARATOR)) {
94 return null
95 }
96 const [runId, agentBranchNumber, accessToken] = header.replace('Bearer ', '').split(FAKE_LAB_API_KEY_SEPARATOR)
97 return new FakeLabApiKey(
98 RunId.parse(Number(runId)),
99 AgentBranchNumber.parse(Number(agentBranchNumber)),
100 accessToken,
101 )
102 }
103}
104
105export class FetchedAgent {

Callers 5

openaiV1EmbeddingsFunction · 0.80
parseFakeLabApiKeyFunction · 0.80
parseFakeLabApiKeyMethod · 0.80
parseFakeLabApiKeyMethod · 0.80
agents.test.tsFile · 0.80

Calls 1

parseMethod · 0.80

Tested by 1

parseFakeLabApiKeyFunction · 0.64