MCPcopy Create free account
hub / github.com/CommonstackAI/UncommonRoute / handle_provider_detail

Function handle_provider_detail

uncommon_route/proxy.py:3322–3345  ·  view source on GitHub ↗
(request: Request)

Source from the content-addressed store, hash-verified

3320 return JSONResponse(payload)
3321
3322 async def handle_provider_detail(request: Request) -> JSONResponse:
3323 denied = _admin_auth_failure(request)
3324 if denied is not None:
3325 return denied
3326 name = str(request.path_params["name"]).strip().lower()
3327 if request.method == "DELETE":
3328 removed = remove_provider(name)
3329 _reload_providers()
3330 return JSONResponse({"ok": True, "removed": removed, **_providers_payload()})
3331
3332 entry = _providers.providers.get(name)
3333 if entry is None:
3334 return JSONResponse({"error": "Provider not found"}, status_code=404)
3335 verified, detail = verify_key(entry.base_url, entry.api_key)
3336 return JSONResponse({
3337 "ok": verified,
3338 "detail": detail,
3339 "provider": {
3340 "name": entry.name,
3341 "base_url": entry.base_url,
3342 "model_count": len(entry.models),
3343 "api_key_preview": mask_api_key(entry.api_key),
3344 },
3345 }, status_code=200 if verified else 502)
3346
3347 _dashboard_mount = None
3348 try:

Callers

nothing calls this directly

Calls 7

remove_providerFunction · 0.90
verify_keyFunction · 0.90
mask_api_keyFunction · 0.90
_admin_auth_failureFunction · 0.85
_reload_providersFunction · 0.85
_providers_payloadFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected