MCPcopy Create free account
hub / github.com/TheSmallHanCat/flow2api / update_api_key

Function update_api_key

src/api/admin.py:1583–1594  ·  view source on GitHub ↗

Update API key (for external API calls, NOT for admin login)

(
    request: UpdateAPIKeyRequest,
    token: str = Depends(verify_admin_token)
)

Source from the content-addressed store, hash-verified

1581
1582@router.post("/api/admin/apikey")
1583async def update_api_key(
1584 request: UpdateAPIKeyRequest,
1585 token: str = Depends(verify_admin_token)
1586):
1587 """Update API key (for external API calls, NOT for admin login)"""
1588 # Update API key in database
1589 await db.update_admin_config(api_key=request.new_api_key)
1590
1591 # 🔥 Hot reload: sync database config to memory
1592 await db.reload_config_to_memory()
1593
1594 return {"success": True, "message": "API Key更新成功"}
1595
1596
1597@router.post("/api/admin/debug")

Callers

nothing calls this directly

Calls 2

update_admin_configMethod · 0.80

Tested by

no test coverage detected