summaryrefslogtreecommitdiffstats
path: root/routers/api
diff options
context:
space:
mode:
authorVlad Temian <vladtemian@gmail.com>2018-01-07 00:55:53 +0200
committerLauris BH <lauris@nix.lv>2018-01-07 00:55:53 +0200
commite78786ef39526fac6705a831fc291c55f1ca091b (patch)
treec529a79c1460facdf30f04b860cee234d64c229c /routers/api
parent70b6c07590f9014876073e2d69a6278e94db582f (diff)
downloadgitea-e78786ef39526fac6705a831fc291c55f1ca091b.tar.gz
gitea-e78786ef39526fac6705a831fc291c55f1ca091b.zip
Writable deploy keys (closes #671) (#3225)
* Add is_writable checkbox to deploy keys interface * Add writable key option to deploy key form * Add support for writable ssh keys in the interface * Rename IsWritable to ReadOnly * Test: create read-only and read-write deploy keys via api * Add DeployKey access mode migration * Update gitea sdk via govendor * Fix deploykey migration * Add unittests for writable deploy keys * Move template text to locale * Remove implicit column update * Remove duplicate locales * Replace ReadOnly field with IsReadOnly method * Fix deploy_keys related integration test * Rename v54 migration with v55 * Fix migration hell
Diffstat (limited to 'routers/api')
-rw-r--r--routers/api/v1/repo/key.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/api/v1/repo/key.go b/routers/api/v1/repo/key.go
index 42082c3561..a3586d2552 100644
--- a/routers/api/v1/repo/key.go
+++ b/routers/api/v1/repo/key.go
@@ -160,7 +160,7 @@ func CreateDeployKey(ctx *context.APIContext, form api.CreateKeyOption) {
return
}
- key, err := models.AddDeployKey(ctx.Repo.Repository.ID, form.Title, content)
+ key, err := models.AddDeployKey(ctx.Repo.Repository.ID, form.Title, content, form.ReadOnly)
if err != nil {
HandleAddKeyError(ctx, err)
return