ccproxy.auth.oauth.flows¶
ccproxy.auth.oauth.flows
¶
OAuth flow engines for CLI authentication.
CLICallbackServer
¶
Temporary HTTP server for handling OAuth callbacks in CLI flows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
port
|
int
|
Port to bind the server to |
required |
callback_path
|
str
|
Path to handle OAuth callbacks |
'/callback'
|
Source code in ccproxy/auth/oauth/flows.py
start
async
¶
Start the callback server.
Source code in ccproxy/auth/oauth/flows.py
stop
async
¶
Stop the callback server.
Source code in ccproxy/auth/oauth/flows.py
wait_for_callback
async
¶
Wait for OAuth callback with optional state validation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
expected_state
|
str | None
|
Expected OAuth state parameter for validation |
None
|
timeout
|
float
|
Timeout in seconds |
300
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Callback data dictionary |
Raises:
| Type | Description |
|---|---|
TimeoutError
|
If callback is not received within timeout |
ValueError
|
If state validation fails |
Source code in ccproxy/auth/oauth/flows.py
BrowserFlow
¶
Browser-based OAuth flow with callback server.
run
async
¶
Execute browser OAuth flow with fallback handling.
Source code in ccproxy/auth/oauth/flows.py
243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 | |
DeviceCodeFlow
¶
OAuth device code flow for headless environments.
run
async
¶
Execute device code flow with polling.
Source code in ccproxy/auth/oauth/flows.py
ManualCodeFlow
¶
Manual authorization code entry for restricted environments.
run
async
¶
Execute manual code entry flow.
Source code in ccproxy/auth/oauth/flows.py
render_qr_code
¶
Render QR code for URL when TTY supports it.