mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 14:01:15 +02:00
fix: Hard-delete API keys instead of soft delete (revoked flag)
Removing the soft-delete approach — revoked keys are now deleted from the database entirely via DELETE endpoint. This prevents the api_keys table from accumulating stale records.
This commit is contained in:
1 file changed
+3
-3
@@ -119,9 +119,9 @@ async def revoke_api_key(
|
||||
from fastapi import HTTPException
|
||||
raise HTTPException(status_code=404, detail="API key not found")
|
||||
|
||||
# Only the key owner can revoke it
|
||||
# Only the key owner can delete it
|
||||
if key.user_id != current_user.user_id:
|
||||
from fastapi import HTTPException
|
||||
raise HTTPException(status_code=403, detail="Cannot revoke another user's API key")
|
||||
raise HTTPException(status_code=403, detail="Cannot delete another user's API key")
|
||||
|
||||
await api_keys_repo.revoke_api_key(api_key_id)
|
||||
await api_keys_repo.delete_api_key(api_key_id)
|
||||
Reference in new issue
Block a user