Link api endpoints and http handlers to their modules
This commit is contained in:
@@ -10,6 +10,7 @@ func registerAPIEndpoints() error {
|
||||
return api.RegisterEndpoint(api.Endpoint{
|
||||
Path: "ui/reload",
|
||||
Write: api.PermitUser,
|
||||
BelongsTo: module,
|
||||
ActionFunc: reloadUI,
|
||||
Name: "Reload UI Assets",
|
||||
Description: "Removes all assets from the cache and reloads the current (possibly updated) version from disk when requested.",
|
||||
|
||||
@@ -13,6 +13,7 @@ import (
|
||||
|
||||
"github.com/safing/portbase/api"
|
||||
"github.com/safing/portbase/log"
|
||||
"github.com/safing/portbase/modules"
|
||||
"github.com/safing/portbase/updater"
|
||||
"github.com/safing/portmaster/updates"
|
||||
)
|
||||
@@ -53,6 +54,8 @@ type bundleServer struct {
|
||||
defaultModuleName string
|
||||
}
|
||||
|
||||
func (bs *bundleServer) BelongsTo() *modules.Module { return module }
|
||||
|
||||
func (bs *bundleServer) ReadPermission(*http.Request) api.Permission { return api.PermitAnyone }
|
||||
|
||||
func (bs *bundleServer) WritePermission(*http.Request) api.Permission { return api.NotSupported }
|
||||
|
||||
Reference in New Issue
Block a user