Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Rule listing bug #44

Merged
merged 2 commits into from
Sep 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config_examples/waflyctl.toml.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

logpath = "waflyctl.log"
apiendpoint = "https://api.fastly.com"
tags = [""]
tags = []
publisher = ["owasp"]
action = "log"
rules = []
Expand Down
10 changes: 5 additions & 5 deletions waflyctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -1504,7 +1504,7 @@ func getRules(apiEndpoint, apiKey, serviceID, wafID string) bool {

Info.Printf("Reading page: %d out of %d", currentpage, totalpages)
//set our API call
apiCall := apiEndpoint + "/service/" + serviceID + "/wafs/" + wafID + "/rule_statuses?page[size]=200&page[number]=" + strconv.Itoa(currentpage)
apiCall := apiEndpoint + "/service/" + serviceID + "/wafs/" + wafID + "/rule_statuses?page[number]=" + strconv.Itoa(currentpage)

resp, err := resty.R().
SetHeader("Accept", "application/vnd.api+json").
Expand Down Expand Up @@ -1572,7 +1572,7 @@ func getAllRules(apiEndpoint, apiKey, ConfigID string) bool {

if ConfigID == "" {
//set our API call
apiCall := apiEndpoint + "/wafs/rules?page[size]=200&page[number]=1"
apiCall := apiEndpoint + "/wafs/rules?page[number]=1"

resp, err := resty.R().
SetHeader("Accept", "application/vnd.api+json").
Expand Down Expand Up @@ -1609,7 +1609,7 @@ func getAllRules(apiEndpoint, apiKey, ConfigID string) bool {

Info.Printf("Reading page: %d out of %d", currentpage, totalpages)
//set our API call
apiCall := apiEndpoint + "/wafs/rules?page[size]=200&page[number]=" + strconv.Itoa(currentpage)
apiCall := apiEndpoint + "/wafs/rules?page[number]=" + strconv.Itoa(currentpage)

resp, err := resty.R().
SetHeader("Accept", "application/vnd.api+json").
Expand Down Expand Up @@ -1663,7 +1663,7 @@ func getAllRules(apiEndpoint, apiKey, ConfigID string) bool {
} else {

//set our API call
apiCall := apiEndpoint + "/wafs/rules?filter[configuration_set_id]=" + ConfigID + "&page[size]=200&page[number]=1"
apiCall := apiEndpoint + "/wafs/rules?filter[configuration_set_id]=" + ConfigID + "&page[number]=1"

resp, err := resty.R().
SetHeader("Accept", "application/vnd.api+json").
Expand Down Expand Up @@ -1700,7 +1700,7 @@ func getAllRules(apiEndpoint, apiKey, ConfigID string) bool {

Info.Printf("Reading page: %d out of %d", currentpage, totalpages)
//set our API call
apiCall := apiEndpoint + "/wafs/rules?filter[configuration_set_id]=" + ConfigID + "&page[size]=200&page[number]=" + strconv.Itoa(currentpage)
apiCall := apiEndpoint + "/wafs/rules?filter[configuration_set_id]=" + ConfigID + "&page[number]=" + strconv.Itoa(currentpage)

resp, err := resty.R().
SetHeader("Accept", "application/vnd.api+json").
Expand Down