bindBackupApi registers the file api endpoints and the corresponding handlers.
(app core.App, rg *router.RouterGroup[*core.RequestEvent])
| 15 | |
| 16 | // bindBackupApi registers the file api endpoints and the corresponding handlers. |
| 17 | func bindBackupApi(app core.App, rg *router.RouterGroup[*core.RequestEvent]) { |
| 18 | sub := rg.Group("/backups") |
| 19 | sub.GET("", backupsList).Bind(RequireSuperuserAuth()) |
| 20 | sub.POST("", backupCreate).Bind(RequireSuperuserAuth()) |
| 21 | sub.POST("/upload", backupUpload).Bind(BodyLimit(0), RequireSuperuserAuth()) |
| 22 | sub.GET("/{key}", backupDownload) // relies on superuser file token |
| 23 | sub.DELETE("/{key}", backupDelete).Bind(RequireSuperuserAuth()) |
| 24 | sub.POST("/{key}/restore", backupRestore).Bind(RequireSuperuserAuth()) |
| 25 | } |
| 26 | |
| 27 | type backupFileInfo struct { |
| 28 | Modified types.DateTime `json:"modified"` |
no test coverage detected
searching dependent graphs…