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:
|
||||
// 200: extClientSliceResponse
|
||||
//
|
||||
func getNetworkExtClients(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
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.
|
||||
//
|
||||
//
|
||||
// Schemes: https
|
||||
//
|
||||
// Security:
|
||||
|
@ -133,7 +131,6 @@ func getAllExtClients(w http.ResponseWriter, r *http.Request) {
|
|||
//
|
||||
// Responses:
|
||||
// 200: extClientResponse
|
||||
//
|
||||
func getExtClient(w http.ResponseWriter, r *http.Request) {
|
||||
// set header.
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
|
@ -165,7 +162,6 @@ func getExtClient(w http.ResponseWriter, r *http.Request) {
|
|||
//
|
||||
// Responses:
|
||||
// 200: extClientResponse
|
||||
//
|
||||
func getExtClientConf(w http.ResponseWriter, r *http.Request) {
|
||||
// set header.
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
|
@ -297,7 +293,6 @@ Endpoint = %s
|
|||
//
|
||||
// Security:
|
||||
// oauth
|
||||
//
|
||||
func createExtClient(w http.ResponseWriter, r *http.Request) {
|
||||
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)
|
||||
|
||||
if err == nil {
|
||||
if !validName(CustomExtClient.ClientID) {
|
||||
if CustomExtClient.ClientID != "" && !validName(CustomExtClient.ClientID) {
|
||||
logic.ReturnErrorResponse(w, r, logic.FormatError(errInvalidExtClientID, "badrequest"))
|
||||
return
|
||||
}
|
||||
|
@ -392,7 +387,6 @@ func createExtClient(w http.ResponseWriter, r *http.Request) {
|
|||
//
|
||||
// Responses:
|
||||
// 200: extClientResponse
|
||||
//
|
||||
func updateExtClient(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
|
||||
|
@ -491,7 +485,6 @@ func updateExtClient(w http.ResponseWriter, r *http.Request) {
|
|||
//
|
||||
// Responses:
|
||||
// 200: successResponse
|
||||
//
|
||||
func deleteExtClient(w http.ResponseWriter, r *http.Request) {
|
||||
// Set header
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
|
|
Loading…
Add table
Reference in a new issue