diff --git a/internal/rootmux/rootmux.go b/internal/rootmux/rootmux.go index 7c5cd3b8b5855445f33b445769a1b5f8035673fb..f3fadd70f18f059074ec9f84d9796336c4178d1c 100644 --- a/internal/rootmux/rootmux.go +++ b/internal/rootmux/rootmux.go @@ -9,7 +9,6 @@ import ( "forge.grandlyon.com/npernoud/glcpro/internal/adminserver" "forge.grandlyon.com/npernoud/glcpro/internal/matcher" "forge.grandlyon.com/npernoud/glcpro/internal/oidcserver" - "forge.grandlyon.com/npernoud/glcpro/internal/userserver" "forge.grandlyon.com/npernoud/glcpro/pkg/common" "forge.grandlyon.com/npernoud/glcpro/pkg/middlewares" "forge.grandlyon.com/npernoud/glcpro/pkg/tokens" @@ -27,7 +26,6 @@ func CreateRootMux(staticDir string) *http.ServeMux { mainMux.Handle("/api/", http.StripPrefix("/api", apiMux)) mainMux.Handle("/api/oidc/", middlewares.Cors(http.StripPrefix("/api/oidc", oidcserver.CreateOIDCServer()))) mainMux.Handle("/api/matcher/", middlewares.Cors(http.StripPrefix("/api/matcher", matcher.CreateMatcherServer()))) - mainMux.Handle("/api/user/", middlewares.Cors(http.StripPrefix("/api/user", userserver.CreateUserServer()))) allowedRoles := []string{middlewares.AdminRole} mainMux.Handle("/api/admin/", diff --git a/internal/userserver/userserver.go b/internal/userserver/userserver.go deleted file mode 100644 index 31d97982e723778037a2dfd0ed7356518d422da7..0000000000000000000000000000000000000000 --- a/internal/userserver/userserver.go +++ /dev/null @@ -1,38 +0,0 @@ -package userserver - -import ( - "fmt" - "io/ioutil" - "net/http" - "net/url" - "os" - - "forge.grandlyon.com/npernoud/glcpro/internal/apiuser" -) - -func CreateUserServer() *http.ServeMux { - - mux := http.NewServeMux() - - mux.HandleFunc("/oauth", func(w http.ResponseWriter, r *http.Request) { - readBody, _ := ioutil.ReadAll((r.Body)) - query, err := url.ParseQuery(string(readBody)) - if err != nil { - http.Error(w, "request body is malformed", http.StatusBadRequest) - } - - fmt.Fprintln(os.Stderr, query) - - }) - - mux.HandleFunc("/login", apiuser.Login) - mux.HandleFunc("/logout", func(w http.ResponseWriter, r *http.Request) { - http.Error(w, "Handler logout OK", http.StatusNotImplemented) - }) - - //return user data - //TODO put true for xsrfcheck and solve the "authorized" problem - mux.Handle("/whoAmI", apiuser.MiddlewareValidateAuth(apiuser.WhoAmI(), false)) - - return mux -} diff --git a/internal/userserver/userserver_test.go b/internal/userserver/userserver_test.go deleted file mode 100644 index ea63f5f4911240238a67dffd565ff62e89c8bfe8..0000000000000000000000000000000000000000 --- a/internal/userserver/userserver_test.go +++ /dev/null @@ -1,21 +0,0 @@ -package userserver - -import ( - "net/http" - "testing" - - "forge.grandlyon.com/npernoud/glcpro/pkg/tester" -) - -var ( - noH map[string]string -) - -func TestUserServer(t *testing.T) { - h := CreateUserServer() - do := tester.CreateHandlerTester(t, h) - - do("GET", "/login", noH, "", http.StatusNotImplemented, "Handler login OK") - do("GET", "/logout", noH, "", http.StatusNotImplemented, "Handler logout OK") - do("GET", "/whoAmI", noH, "", http.StatusBadRequest, "") -} diff --git a/web/components/clients/clients.js b/web/components/clients/clients.js index a1403ac73bbf49b7b5915898794052a1831f49e0..3b13b71989d574d04173b6de75042ef4a456c2b1 100644 --- a/web/components/clients/clients.js +++ b/web/components/clients/clients.js @@ -1,3 +1,5 @@ +//TODO : fix : there is a bug after created a new client (problem with redirect_uri field ?) + // Imports import { AnimateCSS, RandomString } from "/services/common/common.js"; import { Delete } from "/services/common/delete.js";