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

Commit

Permalink
Merge pull request #44 from fastly/rule_listing_bug
Browse files Browse the repository at this point in the history
Rule listing bug
  • Loading branch information
josehelps authored Sep 13, 2018
2 parents 5d94b45 + 2ae4601 commit a34128a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
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

0 comments on commit a34128a

Please sign in to comment.