Skip to content

Allow admin to delete user keys via API #3014

@vtemian

Description

@vtemian
  • 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}).

Metadata

Metadata

Assignees

No one assigned

    Labels

    modifies/apiThis PR adds API routes or modifies them

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions