-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
api: Allow unauthenticated access to user's SSH keys #30717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
api: Allow unauthenticated access to user's SSH keys #30717
Conversation
This patch relaxes constraints on getting user's SSH keys via the JSON API. The same has been allowed by both GitHub and Gitlab and the output is already readable via http://domain/user.keys endpoint. The benefit of allowing it via the API are twofold: first this is a structured output and second it can be CORS-enabled. As a privacy precaution the `Title` property is set to an empty string if the request is unauthenticated. Fixes: go-gitea#30681
69afd9d
to
693db80
Compare
I think we should just expose the id and key like what Github did. i.e. https://api.github.com/users/lunny/keys |
There's a slight problem that the time cannot be Just for the record the API for returning "signing SSH keys" does include creation time and title: https://api.github.com/users/wiktor-k/ssh_signing_keys |
If you don't mind, I can send some commits to your PR. |
I would be very glad if you could help 🙏 thank you in advance! 🙇 |
This patch relaxes constraints on getting user's SSH keys via the JSON API. The same has been allowed by both GitHub and Gitlab and the output is already readable via http://domain/user.keys endpoint.
The benefit of allowing it via the API are twofold: first this is a structured output and second it can be CORS-enabled.
As a privacy precaution the
Title
property is set to an empty string if the request is unauthenticated.Fixes: #30681