diff --git a/configuration/acl_test.go b/configuration/acl_test.go index 5c5f14a1..877baf04 100644 --- a/configuration/acl_test.go +++ b/configuration/acl_test.go @@ -79,6 +79,7 @@ func TestClient_GetACLs(t *testing.T) { &models.ACL{ACLName: "invalid_src", Criterion: "src", Index: misc.Int64P(0), Value: "0.0.0.0/7 224.0.0.0/3"}, &models.ACL{ACLName: "invalid_src", Criterion: "src_port", Index: misc.Int64P(1), Value: "0:1023"}, &models.ACL{ACLName: "local_dst", Criterion: "hdr(host)", Index: misc.Int64P(2), Value: "-i localhost"}, + &models.ACL{ACLName: "waf_wafTest_drop", Criterion: "var(txn.wafTest.drop),bool", Index: misc.Int64P(3), Value: ""}, }, wantErr: false, }, @@ -246,7 +247,7 @@ func TestCreateEditDeleteACL(t *testing.T) { } // TestDeleteACL - err = clientTest.DeleteACL(3, "frontend", "test", "", version) + err = clientTest.DeleteACL(4, "frontend", "test", "", version) if err != nil { t.Error(err.Error()) } else { @@ -257,9 +258,9 @@ func TestCreateEditDeleteACL(t *testing.T) { t.Error("Version not incremented") } - _, _, err = clientTest.GetACL(3, "frontend", "test", "") + _, _, err = clientTest.GetACL(4, "frontend", "test", "") if err == nil { - t.Error("DeleteACL failed, ACL Rule 3 still exists") + t.Error("DeleteACL failed, ACL Rule 4 still exists") } err = clientTest.DeleteACL(2, "backend", "test_2", "", version) diff --git a/configuration/configuration_test.go b/configuration/configuration_test.go index fdc3e857..d7b405d1 100644 --- a/configuration/configuration_test.go +++ b/configuration/configuration_test.go @@ -335,6 +335,7 @@ frontend test acl invalid_src src 0.0.0.0/7 224.0.0.0/3 acl invalid_src src_port 0:1023 acl local_dst hdr(host) -i localhost + acl waf_wafTest_drop var(txn.wafTest.drop),bool monitor-uri /healthz monitor fail if site_dead filter trace name BEFORE-HTTP-COMP random-parsing hexdump diff --git a/models/acl.go b/models/acl.go index e55e5be1..db79f36c 100644 --- a/models/acl.go +++ b/models/acl.go @@ -53,8 +53,7 @@ type ACL struct { Index *int64 `json:"index"` // value - // Required: true - Value string `json:"value"` + Value string `json:"value,omitempty"` } // Validate validates this acl @@ -73,10 +72,6 @@ func (m *ACL) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateValue(formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -118,15 +113,6 @@ func (m *ACL) validateIndex(formats strfmt.Registry) error { return nil } -func (m *ACL) validateValue(formats strfmt.Registry) error { - - if err := validate.RequiredString("value", "body", m.Value); err != nil { - return err - } - - return nil -} - // ContextValidate validates this acl based on context it is used func (m *ACL) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil diff --git a/specification/build/haproxy_spec.yaml b/specification/build/haproxy_spec.yaml index eaf56ba0..d7ac61ff 100644 --- a/specification/build/haproxy_spec.yaml +++ b/specification/build/haproxy_spec.yaml @@ -6962,7 +6962,6 @@ definitions: - index - acl_name - criterion - - value title: ACL Lines type: object acls: diff --git a/specification/models/configuration/acl.yaml b/specification/models/configuration/acl.yaml index a8225382..4ca27157 100644 --- a/specification/models/configuration/acl.yaml +++ b/specification/models/configuration/acl.yaml @@ -10,7 +10,6 @@ acl: - index - acl_name - criterion - - value properties: index: type: integer