mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add API key scope to restrict access to user data (#17692)
This commit is contained in:
@@ -145,6 +145,10 @@ func (api *API) agentGitSSHKey(rw http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
gitSSHKey, err := api.Database.GetGitSSHKey(ctx, workspace.OwnerID)
|
||||
if httpapi.IsUnauthorizedError(err) {
|
||||
httpapi.Forbidden(rw)
|
||||
return
|
||||
}
|
||||
if err != nil {
|
||||
httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{
|
||||
Message: "Internal error fetching git SSH key.",
|
||||
|
||||
Reference in New Issue
Block a user