Allow disabling users from adding SSH keys #10844

Closed
opened 2025-11-02 09:19:50 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @panangam on GitHub (May 14, 2023).

Feature Description

It would be great if we have the option to disable SSH key adding by users, for when keys are entirely externally managed by an admin. Seems like removing the front end button is easy enough using a template, but from my understanding, to be secure we will also need to disable the API endpoint. I don't think such a feature exists right now.

In my mind, an implementation could be to

  1. Add an SSH configuration option to "allow non-admin users to add SSH keys" (default to true).
  2. Make the front end check for this setting and set the "Add SSH Key" button to disabled.
  3. Make the api endpoint check this setting.

Would this be a good idea? Or is there a configuration to achieve this already? If this will be a good contribution, I plan to make a PR of it.

Issue #13983 seems relevant, but it only deals with deleting keys.

(I have asked this on Discord and was advised to make a proposal here)

Screenshots

No response

Originally created by @panangam on GitHub (May 14, 2023). ### Feature Description It would be great if we have the option to disable SSH key adding by users, for when keys are entirely externally managed by an admin. Seems like removing the front end button is easy enough using a template, but from my understanding, to be secure we will also need to disable the API endpoint. I don't think such a feature exists right now. In my mind, an implementation could be to 1. Add an SSH configuration option to "allow non-admin users to add SSH keys" (default to true). 2. Make the front end check for this setting and set the "Add SSH Key" button to disabled. 3. Make the api endpoint check this setting. Would this be a good idea? Or is there a configuration to achieve this already? If this will be a good contribution, I plan to make a PR of it. Issue #13983 seems relevant, but it only deals with deleting keys. (I have [asked this on Discord](https://discord.com/channels/322538954119184384/322910365237248000/1107263750723076216) and was advised to make a proposal here) ### Screenshots _No response_
GiteaMirror added the type/proposaltype/feature labels 2025-11-02 09:19:50 -06:00
Author
Owner

@panangam commented on GitHub (May 14, 2023):

@wxiaoguang Oras from discord here :).

@panangam commented on GitHub (May 14, 2023): @wxiaoguang Oras from discord here :).
Author
Owner

@wxiaoguang commented on GitHub (May 15, 2023):

It seems related to https://github.com/go-gitea/gitea/pull/20549

@wxiaoguang commented on GitHub (May 15, 2023): It seems related to https://github.com/go-gitea/gitea/pull/20549
Author
Owner

@panangam commented on GitHub (Mar 4, 2024):

🎉

On Mon, Mar 4, 2024, 14:50 Lunny Xiao @.***> wrote:

Closed #24716 https://github.com/go-gitea/gitea/issues/24716 as
completed via #29447 https://github.com/go-gitea/gitea/pull/29447.


Reply to this email directly, view it on GitHub
https://github.com/go-gitea/gitea/issues/24716#event-11994616511, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AEDXAK4UMWTTZYXXBENP7JTYWQRUVAVCNFSM6AAAAAAYBJB4RKVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJRHE4TINRRGY2TCMI
.
You are receiving this because you authored the thread.Message ID:
@.***>

@panangam commented on GitHub (Mar 4, 2024): 🎉 On Mon, Mar 4, 2024, 14:50 Lunny Xiao ***@***.***> wrote: > Closed #24716 <https://github.com/go-gitea/gitea/issues/24716> as > completed via #29447 <https://github.com/go-gitea/gitea/pull/29447>. > > — > Reply to this email directly, view it on GitHub > <https://github.com/go-gitea/gitea/issues/24716#event-11994616511>, or > unsubscribe > <https://github.com/notifications/unsubscribe-auth/AEDXAK4UMWTTZYXXBENP7JTYWQRUVAVCNFSM6AAAAAAYBJB4RKVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJRHE4TINRRGY2TCMI> > . > You are receiving this because you authored the thread.Message ID: > ***@***.***> >
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10844