diff --git a/server/handler/repo.go b/server/handler/repo.go index e15a38f7..f839d5e0 100644 --- a/server/handler/repo.go +++ b/server/handler/repo.go @@ -170,6 +170,8 @@ func (h *RepoHandler) PutRepo(w http.ResponseWriter, r *http.Request) error { Privileged *bool `json:"privileged"` Params *string `json:"params"` Timeout *int64 `json:"timeout"` + PublicKey *string `json:"public_key"` + PrivateKey *string `json:"private_key"` }{} if err := json.NewDecoder(r.Body).Decode(&in); err != nil { return badRequest{err} @@ -197,6 +199,10 @@ func (h *RepoHandler) PutRepo(w http.ResponseWriter, r *http.Request) error { if in.Timeout != nil && user.Admin { repo.Timeout = *in.Timeout } + if in.PrivateKey != nil && in.PublicKey != nil { + repo.PublicKey = *in.PublicKey + repo.PrivateKey = *in.PrivateKey + } // update the repository if err := h.repos.Update(repo); err != nil {