Skip to content

Commit

Permalink
remove name validation
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishek9686 committed Dec 5, 2024
1 parent 5049359 commit 5509b96
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
8 changes: 0 additions & 8 deletions controllers/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -488,14 +488,6 @@ func createNetwork(w http.ResponseWriter, r *http.Request) {
return
}

if len(network.Name) > 32 {
err := errors.New("network name shouldn't exceed 32 characters")
logger.Log(0, r.Header.Get("user"), "failed to create network: ",
err.Error())
logic.ReturnErrorResponse(w, r, logic.FormatError(err, "badrequest"))
return
}

if network.AddressRange == "" && network.AddressRange6 == "" {
err := errors.New("IPv4 or IPv6 CIDR required")
logger.Log(0, r.Header.Get("user"), "failed to create network: ",
Expand Down
2 changes: 1 addition & 1 deletion models/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
// Network Struct - contains info for a given unique network
// At some point, need to replace all instances of Name with something else like Identifier
type Network struct {
Name string `json:"name" validate:"required,min=1,max=32,netid_valid"`
Name string `json:"name"`
AddressRange string `json:"addressrange" bson:"addressrange" validate:"omitempty,cidrv4"`
AddressRange6 string `json:"addressrange6" bson:"addressrange6" validate:"omitempty,cidrv6"`
NetID string `json:"netid"`
Expand Down

0 comments on commit 5509b96

Please sign in to comment.