(params: {
relayId: string
state: string
timeoutMs?: number
})
| 196 | } |
| 197 | |
| 198 | export async function registerOauthCallbackRelay(params: { |
| 199 | relayId: string |
| 200 | state: string |
| 201 | timeoutMs?: number |
| 202 | }): Promise<void> { |
| 203 | try { |
| 204 | await withTransientRetry(() => |
| 205 | axios.post( |
| 206 | getOauthCallbackRelayEndpoint('/oauth/callback-relay/register'), |
| 207 | { |
| 208 | relay_id: params.relayId, |
| 209 | state: params.state, |
| 210 | }, |
| 211 | { |
| 212 | headers: { 'Content-Type': 'application/json' }, |
| 213 | timeout: params.timeoutMs ?? 1000, |
| 214 | }, |
| 215 | ), |
| 216 | ) |
| 217 | } catch (error) { |
| 218 | throw new Error( |
| 219 | `OAuth callback relay registration failed: ${error instanceof Error ? error.message : String(error)}`, |
| 220 | ) |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | export async function pollOauthCallbackRelay( |
| 225 | relayId: string, |
no test coverage detected