Skip to content

Commit

Permalink
fix: include proposedCidrs from akamai siteshield map
Browse files Browse the repository at this point in the history
  • Loading branch information
schnoddelbotz committed Nov 14, 2017
1 parent 6e4406a commit 2fff299
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 4 additions & 3 deletions akamai.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ type siteShieldMaps struct {
}

type siteShieldMap struct {
Acknowledged bool `json:"acknowledged"`
ID int `json:"id"`
CurrentCidrs []string `json:"currentCidrs"`
Acknowledged bool `json:"acknowledged"`
ID int `json:"id"`
CurrentCidrs []string `json:"currentCidrs"`
ProposedCidrs []string `json:"proposedCidrs"`
}

func getAkamaiConfig() edgegrid.Config {
Expand Down
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ func run() {
for _, cidr := range ssMap.CurrentCidrs {
ssCidrs[cidr] = struct{}{}
}
// add proposed (i.e. non-acknowledged) CIDRs
for _, cidr := range ssMap.ProposedCidrs {
if _, ok := ssCidrs[cidr]; !ok {
ssCidrs[cidr] = struct{}{}
}
}
}

// compare current with desired state
Expand Down

0 comments on commit 2fff299

Please sign in to comment.