Allow admin to delete user keys via API #1290

Closed
opened 2025-11-02 03:55:40 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @vtemian on GitHub (Nov 28, 2017).

  • Gitea version (or commit ref): 6ad4990
  • Git version: 2.7.4
  • Operating system: Ubuntu 16.04
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

Right now, admins can create keys on behalf of an user, but they can't delete them. (via API)
I suggest that we also support the DELETE operation.

From a bigger perspective, is there any reason why the /user endpoints where implemented instead of /users/{username}? (I guess they were already implemented in gogs)

It's easier for an admin to manage it's users via /users/{username}. It can introduce some overhead and confusion if for each resource type endpoint will exist an equivalent admin endpoint (DELETE: /users/{username}/keys/{id} -> /admin/users/{username}/keys/{id}).

Originally created by @vtemian on GitHub (Nov 28, 2017). - Gitea version (or commit ref): 6ad4990 - Git version: 2.7.4 - Operating system: Ubuntu 16.04 - Database (use `[x]`): - [ ] PostgreSQL - [X] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [X] Not relevant - Log gist: ## Description Right now, admins can create keys on behalf of an user, but they can't delete them. (via API) I suggest that we also support the `DELETE` operation. From a bigger perspective, is there any reason why the `/user` endpoints where implemented instead of `/users/{username}`? (I guess they were already implemented in gogs) It's easier for an admin to manage it's users via `/users/{username}`. It can introduce some overhead and confusion if for each resource type endpoint will exist an equivalent admin endpoint (DELETE: `/users/{username}/keys/{id}` -> `/admin/users/{username}/keys/{id}`).
GiteaMirror added the modifies/api label 2025-11-02 03:55:40 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1290