Skip to content

Commit

Permalink
remove egress validation on extclient to support mobile apis
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishek9686 committed Aug 3, 2024
1 parent 0807bd0 commit 535224f
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions controllers/ext_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,15 +387,15 @@ func createExtClient(w http.ResponseWriter, r *http.Request) {
return
}

var gateway models.EgressGatewayRequest
gateway.NetID = params["network"]
gateway.Ranges = customExtClient.ExtraAllowedIPs
err := logic.ValidateEgressRange(gateway)
if err != nil {
logger.Log(0, r.Header.Get("user"), "error validating egress range: ", err.Error())
logic.ReturnErrorResponse(w, r, logic.FormatError(err, "badrequest"))
return
}
// var gateway models.EgressGatewayRequest
// gateway.NetID = params["network"]
// gateway.Ranges = customExtClient.ExtraAllowedIPs
// err := logic.ValidateEgressRange(gateway)
// if err != nil {
// logger.Log(0, r.Header.Get("user"), "error validating egress range: ", err.Error())
// logic.ReturnErrorResponse(w, r, logic.FormatError(err, "badrequest"))
// return
// }

node, err := logic.GetNodeByID(nodeid)
if err != nil {
Expand Down Expand Up @@ -542,15 +542,15 @@ func updateExtClient(w http.ResponseWriter, r *http.Request) {
}
}

var gateway models.EgressGatewayRequest
gateway.NetID = params["network"]
gateway.Ranges = update.ExtraAllowedIPs
err = logic.ValidateEgressRange(gateway)
if err != nil {
logger.Log(0, r.Header.Get("user"), "error validating egress range: ", err.Error())
logic.ReturnErrorResponse(w, r, logic.FormatError(err, "badrequest"))
return
}
// var gateway models.EgressGatewayRequest
// gateway.NetID = params["network"]
// gateway.Ranges = update.ExtraAllowedIPs
// err = logic.ValidateEgressRange(gateway)
// if err != nil {
// logger.Log(0, r.Header.Get("user"), "error validating egress range: ", err.Error())
// logic.ReturnErrorResponse(w, r, logic.FormatError(err, "badrequest"))
// return
// }

var changedID = update.ClientID != oldExtClient.ClientID

Expand Down

0 comments on commit 535224f

Please sign in to comment.