mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-10 23:24:32 +08:00
Merge pull request #1842 from gravitl/bugfix_empty_extclientid
Do not validate empty ext client ids
This commit is contained in:
commit
1c14e84f34
1 changed files with 34 additions and 41 deletions
|
@ -50,7 +50,6 @@ func checkIngressExists(nodeID string) bool {
|
||||||
//
|
//
|
||||||
// Responses:
|
// Responses:
|
||||||
// 200: extClientSliceResponse
|
// 200: extClientSliceResponse
|
||||||
//
|
|
||||||
func getNetworkExtClients(w http.ResponseWriter, r *http.Request) {
|
func getNetworkExtClients(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
|
@ -75,7 +74,6 @@ func getNetworkExtClients(w http.ResponseWriter, r *http.Request) {
|
||||||
//
|
//
|
||||||
// A separate function to get all extclients, not just extclients for a particular network.
|
// A separate function to get all extclients, not just extclients for a particular network.
|
||||||
//
|
//
|
||||||
//
|
|
||||||
// Schemes: https
|
// Schemes: https
|
||||||
//
|
//
|
||||||
// Security:
|
// Security:
|
||||||
|
@ -133,7 +131,6 @@ func getAllExtClients(w http.ResponseWriter, r *http.Request) {
|
||||||
//
|
//
|
||||||
// Responses:
|
// Responses:
|
||||||
// 200: extClientResponse
|
// 200: extClientResponse
|
||||||
//
|
|
||||||
func getExtClient(w http.ResponseWriter, r *http.Request) {
|
func getExtClient(w http.ResponseWriter, r *http.Request) {
|
||||||
// set header.
|
// set header.
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
|
@ -165,7 +162,6 @@ func getExtClient(w http.ResponseWriter, r *http.Request) {
|
||||||
//
|
//
|
||||||
// Responses:
|
// Responses:
|
||||||
// 200: extClientResponse
|
// 200: extClientResponse
|
||||||
//
|
|
||||||
func getExtClientConf(w http.ResponseWriter, r *http.Request) {
|
func getExtClientConf(w http.ResponseWriter, r *http.Request) {
|
||||||
// set header.
|
// set header.
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
|
@ -297,7 +293,6 @@ Endpoint = %s
|
||||||
//
|
//
|
||||||
// Security:
|
// Security:
|
||||||
// oauth
|
// oauth
|
||||||
//
|
|
||||||
func createExtClient(w http.ResponseWriter, r *http.Request) {
|
func createExtClient(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
|
|
||||||
|
@ -320,7 +315,7 @@ func createExtClient(w http.ResponseWriter, r *http.Request) {
|
||||||
err := json.NewDecoder(r.Body).Decode(&CustomExtClient)
|
err := json.NewDecoder(r.Body).Decode(&CustomExtClient)
|
||||||
|
|
||||||
if err == nil {
|
if err == nil {
|
||||||
if !validName(CustomExtClient.ClientID) {
|
if CustomExtClient.ClientID != "" && !validName(CustomExtClient.ClientID) {
|
||||||
logic.ReturnErrorResponse(w, r, logic.FormatError(errInvalidExtClientID, "badrequest"))
|
logic.ReturnErrorResponse(w, r, logic.FormatError(errInvalidExtClientID, "badrequest"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -392,7 +387,6 @@ func createExtClient(w http.ResponseWriter, r *http.Request) {
|
||||||
//
|
//
|
||||||
// Responses:
|
// Responses:
|
||||||
// 200: extClientResponse
|
// 200: extClientResponse
|
||||||
//
|
|
||||||
func updateExtClient(w http.ResponseWriter, r *http.Request) {
|
func updateExtClient(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
|
|
||||||
|
@ -491,7 +485,6 @@ func updateExtClient(w http.ResponseWriter, r *http.Request) {
|
||||||
//
|
//
|
||||||
// Responses:
|
// Responses:
|
||||||
// 200: successResponse
|
// 200: successResponse
|
||||||
//
|
|
||||||
func deleteExtClient(w http.ResponseWriter, r *http.Request) {
|
func deleteExtClient(w http.ResponseWriter, r *http.Request) {
|
||||||
// Set header
|
// Set header
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
|
|
Loading…
Add table
Reference in a new issue