mirror of
https://github.com/GlueOps/autoglue.git
synced 2026-02-13 21:00:06 +01:00
21 lines
511 B
Go
21 lines
511 B
Go
package api
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/glueops/autoglue/internal/handlers"
|
|
"github.com/go-chi/chi/v5"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
func mountSSHRoutes(r chi.Router, db *gorm.DB, authOrg func(http.Handler) http.Handler) {
|
|
r.Route("/ssh", func(s chi.Router) {
|
|
s.Use(authOrg)
|
|
s.Get("/", handlers.ListPublicSshKeys(db))
|
|
s.Post("/", handlers.CreateSSHKey(db))
|
|
s.Get("/{id}", handlers.GetSSHKey(db))
|
|
s.Delete("/{id}", handlers.DeleteSSHKey(db))
|
|
s.Get("/{id}/download", handlers.DownloadSSHKey(db))
|
|
})
|
|
}
|