forked from NYANDEV/forgejo
Implement GPG api (#710)
* Implement GPG API * Better handle error * Apply review recommendation + simplify database operations * Remove useless comments
This commit is contained in:
parent
43c5469f81
commit
ca1c3f1926
36 changed files with 7931 additions and 0 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue