(header: string)
| 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 | |
| 105 | export class FetchedAgent { |