Add compatibility assistant module

This commit is contained in:
Daniel
2021-11-17 14:09:42 +01:00
parent 3193cd35b9
commit 113f37dcab
15 changed files with 557 additions and 6 deletions

29
compat/api.go Normal file
View File

@@ -0,0 +1,29 @@
package compat
import (
"github.com/safing/portbase/api"
)
func registerAPIEndpoints() error {
if err := api.RegisterEndpoint(api.Endpoint{
Path: "compat/self-check",
Read: api.PermitUser,
BelongsTo: module,
ActionFunc: selfcheckViaAPI,
Name: "Run Integration Self-Check",
Description: "Runs a couple integration self-checks in order to see if the system integration works.",
}); err != nil {
return err
}
return nil
}
func selfcheckViaAPI(ar *api.Request) (msg string, err error) {
_, err = selfcheck(ar.Context())
if err != nil {
return "", err
}
return "self-check successful", nil
}