1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-22 23:09:41 +02:00

feat(global): multi endpoint management (#407)

This commit is contained in:
Anthony Lapenna 2016-12-26 09:34:02 +13:00 committed by GitHub
parent a08ea134fc
commit d54d30a7be
47 changed files with 1837 additions and 161 deletions

View file

@ -4,11 +4,12 @@ import (
"github.com/portainer/portainer"
"encoding/json"
"github.com/asaskevich/govalidator"
"github.com/gorilla/mux"
"log"
"net/http"
"os"
"github.com/asaskevich/govalidator"
"github.com/gorilla/mux"
)
// AuthHandler represents an HTTP API handler for managing authentication.
@ -27,7 +28,7 @@ const (
ErrInvalidCredentials = portainer.Error("Invalid credentials")
)
// NewAuthHandler returns a new instance of DialHandler.
// NewAuthHandler returns a new instance of AuthHandler.
func NewAuthHandler() *AuthHandler {
h := &AuthHandler{
Router: mux.NewRouter(),
@ -38,8 +39,8 @@ func NewAuthHandler() *AuthHandler {
}
func (handler *AuthHandler) handlePostAuth(w http.ResponseWriter, r *http.Request) {
if r.Method != "POST" {
handleNotAllowed(w, []string{"POST"})
if r.Method != http.MethodPost {
handleNotAllowed(w, []string{http.MethodPost})
return
}