Browse Source

En cours de développement

master
mls-361 9 months ago
parent
commit
02556ce665
  1. 7
      internal/api/middleware.go
  2. 2
      internal/cli/cli.go

7
internal/api/middleware.go

@ -7,6 +7,7 @@
package api
import (
"fmt"
"net/http"
"strings"
@ -37,8 +38,10 @@ func mwAuth(next jsonapi.Handler, crypto components.Crypto) jsonapi.Handler {
}
if strings.HasPrefix(r.URL.RequestURI(), "/api/admin/") && username != "cli" {
status := http.StatusUnauthorized
r.RenderError(status, http.StatusText(status))
r.RenderError(
http.StatusUnauthorized,
fmt.Sprintf("this user does not have the permissions: %s", username),
)
return
}

2
internal/cli/cli.go

@ -102,7 +102,7 @@ The commands are:
-runafter <datetime> (RFC3339)
-retries <int>
-category <string>
logger
logger (admin)
list
setlevel
-id <string> (required)

Loading…
Cancel
Save