mirror of
https://github.com/go-gitea/gitea
synced 2025-07-15 23:17:19 +00:00
Implement GPG api (#710)
* Implement GPG API * Better handle error * Apply review recommendation + simplify database operations * Remove useless comments
This commit is contained in:
committed by
Lunny Xiao
parent
43c5469f81
commit
ca1c3f1926
@@ -254,6 +254,7 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||
m.Group("/users", func() {
|
||||
m.Group("/:username", func() {
|
||||
m.Get("/keys", user.ListPublicKeys)
|
||||
m.Get("/gpg_keys", user.ListGPGKeys)
|
||||
|
||||
m.Get("/followers", user.ListFollowers)
|
||||
m.Group("/following", func() {
|
||||
@@ -286,6 +287,13 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||
Delete(user.DeletePublicKey)
|
||||
})
|
||||
|
||||
m.Group("/gpg_keys", func() {
|
||||
m.Combo("").Get(user.ListMyGPGKeys).
|
||||
Post(bind(api.CreateGPGKeyOption{}), user.CreateGPGKey)
|
||||
m.Combo("/:id").Get(user.GetGPGKey).
|
||||
Delete(user.DeleteGPGKey)
|
||||
})
|
||||
|
||||
m.Combo("/repos").Get(user.ListMyRepos).
|
||||
Post(bind(api.CreateRepoOption{}), repo.Create)
|
||||
|
||||
|
Reference in New Issue
Block a user