mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-01 04:12:10 +00:00
Allow addition of gpg keyring with multiple keys (#12487)
Related #6778 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
parent
ae23bbdae3
commit
7c2cf236f8
4 changed files with 86 additions and 68 deletions
|
@ -118,12 +118,12 @@ func GetGPGKey(ctx *context.APIContext) {
|
|||
|
||||
// CreateUserGPGKey creates new GPG key to given user by ID.
|
||||
func CreateUserGPGKey(ctx *context.APIContext, form api.CreateGPGKeyOption, uid int64) {
|
||||
key, err := models.AddGPGKey(uid, form.ArmoredKey)
|
||||
keys, err := models.AddGPGKey(uid, form.ArmoredKey)
|
||||
if err != nil {
|
||||
HandleAddGPGKeyError(ctx, err)
|
||||
return
|
||||
}
|
||||
ctx.JSON(http.StatusCreated, convert.ToGPGKey(key))
|
||||
ctx.JSON(http.StatusCreated, convert.ToGPGKey(keys[0]))
|
||||
}
|
||||
|
||||
// swagger:parameters userCurrentPostGPGKey
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue