MCPcopy Create free account
hub / github.com/hunvreus/devpush / github_manage_authorization

Function github_manage_authorization

app/routers/github.py:359–379  ·  view source on GitHub ↗

Manage authorized GitHub Apps (OAuth connections)

(
    request: Request,
    next: str | None = None,
    current_user: User = Depends(get_current_user),
    settings: Settings = Depends(get_settings),
)

Source from the content-addressed store, hash-verified

357
358@router.get("/manage/authorization", name="github_manage_authorization")
359async def github_manage_authorization(
360 request: Request,
361 next: str | None = None,
362 current_user: User = Depends(get_current_user),
363 settings: Settings = Depends(get_settings),
364):
365 """Manage authorized GitHub Apps (OAuth connections)"""
366
367 if not settings.github_app_name:
368 flash(request, _("GitHub App not configured."), "error")
369 redirect_url = safe_redirect(
370 request,
371 next_value=next,
372 referer=request.headers.get("Referer"),
373 )
374 return RedirectResponse(redirect_url, status_code=303)
375
376 return RedirectResponse(
377 f"https://github.com/settings/connections/applications/{settings.github_app_client_id}",
378 status_code=303,
379 )
380
381
382@router.get("/manage/installation", name="github_manage_installation")

Callers

nothing calls this directly

Calls 3

flashFunction · 0.90
safe_redirectFunction · 0.90
_Function · 0.50

Tested by

no test coverage detected