(session: EncodedSession)
| 285 | } |
| 286 | |
| 287 | function normalizeSession(session: EncodedSession): EncodedSession { |
| 288 | if (session.v !== 1) { |
| 289 | throw new Error("Unsupported session payload version."); |
| 290 | } |
| 291 | const upstream = new URL(session.upstream); |
| 292 | if (upstream.protocol !== "https:") { |
| 293 | throw new Error("SimDeck CI upstream must use https."); |
| 294 | } |
| 295 | return { |
| 296 | ...session, |
| 297 | upstream: upstream.origin, |
| 298 | }; |
| 299 | } |
| 300 | |
| 301 | async function decryptToken( |
| 302 | cipher: CipherPayload, |
no outgoing calls
no test coverage detected