Skip to content

Commit

Permalink
BUG/MEDIUM: make ACL Value optional
Browse files Browse the repository at this point in the history
  • Loading branch information
hdurand0710 committed Aug 1, 2023
1 parent 278d806 commit a0b117c
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 20 deletions.
7 changes: 4 additions & 3 deletions configuration/acl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down Expand Up @@ -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 {
Expand All @@ -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)
Expand Down
1 change: 1 addition & 0 deletions configuration/configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 1 addition & 15 deletions models/acl.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion specification/build/haproxy_spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6962,7 +6962,6 @@ definitions:
- index
- acl_name
- criterion
- value
title: ACL Lines
type: object
acls:
Expand Down
1 change: 0 additions & 1 deletion specification/models/configuration/acl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ acl:
- index
- acl_name
- criterion
- value
properties:
index:
type: integer
Expand Down

0 comments on commit a0b117c

Please sign in to comment.