Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump github.com/cloudflare/cloudflare-go from 0.45.0 to 0.46.0 #1815

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
3 changes: 3 additions & 0 deletions .changelog/1815.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:dependency
provider: bumps github.com/cloudflare/cloudflare-go from 0.45.0 to 0.46.0
```
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ require (
github.com/apparentlymart/go-cidr v1.1.0 // indirect
github.com/bflad/tfproviderlint v0.28.1
github.com/client9/misspell v0.3.4
github.com/cloudflare/cloudflare-go v0.45.0
github.com/cloudflare/cloudflare-go v0.46.0
github.com/fatih/color v1.13.0 // indirect
github.com/golangci/golangci-lint v1.47.3
github.com/google/go-github v17.0.0+incompatible
github.com/google/uuid v1.3.0
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-changelog v0.0.0-20211005220746-de58f3600ffd
github.com/hashicorp/go-changelog v0.0.0-20220419201213-5edfc0d651d8
github.com/hashicorp/go-cleanhttp v0.5.2
github.com/hashicorp/go-hclog v1.2.1 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
Expand All @@ -33,7 +33,7 @@ require (
github.com/zclconf/go-cty v1.10.0 // indirect
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect
golang.org/x/net v0.0.0-20220722155237-a158d28d115b
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5
golang.org/x/oauth2 v0.0.0-20220718184931-c8730f7fcb92
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20220224211638-0e9765cccd65 // indirect
Expand Down
48 changes: 31 additions & 17 deletions go.sum

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions internal/provider/resource_cloudflare_access_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ func resourceCloudflareAccessApplicationCreate(ctx context.Context, d *schema.Re
Domain: d.Get("domain").(string),
Type: cloudflare.AccessApplicationType(appType),
SessionDuration: d.Get("session_duration").(string),
AutoRedirectToIdentity: d.Get("auto_redirect_to_identity").(bool),
EnableBindingCookie: d.Get("enable_binding_cookie").(bool),
AutoRedirectToIdentity: cloudflare.BoolPtr(d.Get("auto_redirect_to_identity").(bool)),
EnableBindingCookie: cloudflare.BoolPtr(d.Get("enable_binding_cookie").(bool)),
CustomDenyMessage: d.Get("custom_deny_message").(string),
CustomDenyURL: d.Get("custom_deny_url").(string),
HttpOnlyCookieAttribute: cloudflare.BoolPtr(d.Get("http_only_cookie_attribute").(bool)),
SameSiteCookieAttribute: d.Get("same_site_cookie_attribute").(string),
LogoURL: d.Get("logo_url").(string),
SkipInterstitial: d.Get("skip_interstitial").(bool),
AppLauncherVisible: d.Get("app_launcher_visible").(bool),
ServiceAuth401Redirect: d.Get("service_auth_401_redirect").(bool),
SkipInterstitial: cloudflare.BoolPtr(d.Get("skip_interstitial").(bool)),
AppLauncherVisible: cloudflare.BoolPtr(d.Get("app_launcher_visible").(bool)),
ServiceAuth401Redirect: cloudflare.BoolPtr(d.Get("service_auth_401_redirect").(bool)),
}

if len(allowedIDPList) > 0 {
Expand Down Expand Up @@ -157,16 +157,16 @@ func resourceCloudflareAccessApplicationUpdate(ctx context.Context, d *schema.Re
Domain: d.Get("domain").(string),
Type: cloudflare.AccessApplicationType(appType),
SessionDuration: d.Get("session_duration").(string),
AutoRedirectToIdentity: d.Get("auto_redirect_to_identity").(bool),
EnableBindingCookie: d.Get("enable_binding_cookie").(bool),
AutoRedirectToIdentity: cloudflare.BoolPtr(d.Get("auto_redirect_to_identity").(bool)),
EnableBindingCookie: cloudflare.BoolPtr(d.Get("enable_binding_cookie").(bool)),
CustomDenyMessage: d.Get("custom_deny_message").(string),
CustomDenyURL: d.Get("custom_deny_url").(string),
HttpOnlyCookieAttribute: cloudflare.BoolPtr(d.Get("http_only_cookie_attribute").(bool)),
SameSiteCookieAttribute: d.Get("same_site_cookie_attribute").(string),
LogoURL: d.Get("logo_url").(string),
SkipInterstitial: d.Get("skip_interstitial").(bool),
AppLauncherVisible: d.Get("app_launcher_visible").(bool),
ServiceAuth401Redirect: d.Get("service_auth_401_redirect").(bool),
SkipInterstitial: cloudflare.BoolPtr(d.Get("skip_interstitial").(bool)),
AppLauncherVisible: cloudflare.BoolPtr(d.Get("app_launcher_visible").(bool)),
ServiceAuth401Redirect: cloudflare.BoolPtr(d.Get("service_auth_401_redirect").(bool)),
}

if appType != "saas" {
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/resource_cloudflare_access_bookmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func resourceCloudflareAccessBookmarkCreate(ctx context.Context, d *schema.Resou
Name: d.Get("name").(string),
Domain: d.Get("domain").(string),
LogoURL: d.Get("logo_url").(string),
AppLauncherVisible: d.Get("app_launcher_visible").(bool),
AppLauncherVisible: cloudflare.BoolPtr(d.Get("app_launcher_visible").(bool)),
}

tflog.Debug(ctx, fmt.Sprintf("Creating Cloudflare Access Bookmark from struct: %+v", newAccessBookmark))
Expand Down Expand Up @@ -99,7 +99,7 @@ func resourceCloudflareAccessBookmarkUpdate(ctx context.Context, d *schema.Resou
Name: d.Get("name").(string),
Domain: d.Get("domain").(string),
LogoURL: d.Get("logo_url").(string),
AppLauncherVisible: d.Get("app_launcher_visible").(bool),
AppLauncherVisible: cloudflare.BoolPtr(d.Get("app_launcher_visible").(bool)),
}

tflog.Debug(ctx, fmt.Sprintf("Updating Cloudflare Access Bookmark from struct: %+v", updatedAccessBookmark))
Expand Down
8 changes: 4 additions & 4 deletions internal/provider/resource_cloudflare_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func resourceCloudflareFilterCreate(ctx context.Context, d *schema.ResourceData,

tflog.Debug(ctx, fmt.Sprintf("Creating Cloudflare Filter from struct: %+v", newFilter))

r, err := client.CreateFilters(ctx, zoneID, []cloudflare.Filter{newFilter})
r, err := client.CreateFilters(ctx, cloudflare.ZoneIdentifier(zoneID), []cloudflare.Filter{newFilter})

if err != nil {
return diag.FromErr(fmt.Errorf("error creating Filter for zone %q: %w", zoneID, err))
Expand All @@ -74,7 +74,7 @@ func resourceCloudflareFilterRead(ctx context.Context, d *schema.ResourceData, m
zoneID := d.Get("zone_id").(string)

tflog.Debug(ctx, fmt.Sprintf("Getting a Filter record for zone %q, id %s", zoneID, d.Id()))
filter, err := client.Filter(ctx, zoneID, d.Id())
filter, err := client.Filter(ctx, cloudflare.ZoneIdentifier(zoneID), d.Id())

tflog.Debug(ctx, fmt.Sprintf("filter: %#v", filter))
tflog.Debug(ctx, fmt.Sprintf("filter error: %#v", err))
Expand Down Expand Up @@ -124,7 +124,7 @@ func resourceCloudflareFilterUpdate(ctx context.Context, d *schema.ResourceData,

tflog.Debug(ctx, fmt.Sprintf("Updating Cloudflare Filter from struct: %+v", newFilter))

r, err := client.UpdateFilter(ctx, zoneID, newFilter)
r, err := client.UpdateFilter(ctx, cloudflare.ZoneIdentifier(zoneID), newFilter)

if err != nil {
return diag.FromErr(fmt.Errorf("error updating Filter for zone %q: %w", zoneID, err))
Expand All @@ -143,7 +143,7 @@ func resourceCloudflareFilterDelete(ctx context.Context, d *schema.ResourceData,

tflog.Info(ctx, fmt.Sprintf("Deleting Cloudflare Filter: id %s for zone %s", d.Id(), zoneID))

err := client.DeleteFilter(ctx, zoneID, d.Id())
err := client.DeleteFilter(ctx, cloudflare.ZoneIdentifier(zoneID), d.Id())

if err != nil {
return diag.FromErr(fmt.Errorf("error deleting Cloudflare Filter: %w", err))
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/resource_cloudflare_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ func testSweepCloudflareFilterSweeper(r string) error {
}

zoneID := os.Getenv("CLOUDFLARE_ZONE_ID")
filters, filtersErr := client.Filters(context.Background(), zoneID, cloudflare.PaginationOptions{})
filters, _, filtersErr := client.Filters(context.Background(), cloudflare.ZoneIdentifier(zoneID), cloudflare.FilterListParams{})

if filtersErr != nil {
tflog.Error(ctx, fmt.Sprintf("Failed to fetch Cloudflare filters: %s", filtersErr))
}

for _, filter := range filters {
err := client.DeleteFilter(context.Background(), zoneID, filter.ID)
err := client.DeleteFilter(context.Background(), cloudflare.ZoneIdentifier(zoneID), filter.ID)

if err != nil {
tflog.Error(ctx, fmt.Sprintf("Failed to delete Cloudflare filter (%s) in zone ID: %s", filter.ID, zoneID))
Expand Down
8 changes: 4 additions & 4 deletions internal/provider/resource_cloudflare_firewall_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func resourceCloudflareFirewallRuleCreate(ctx context.Context, d *schema.Resourc

var r []cloudflare.FirewallRule

r, err = client.CreateFirewallRules(ctx, zoneID, []cloudflare.FirewallRule{newFirewallRule})
r, err = client.CreateFirewallRules(ctx, cloudflare.ZoneIdentifier(zoneID), []cloudflare.FirewallRule{newFirewallRule})

if err != nil {
return diag.FromErr(fmt.Errorf("error creating Firewall Rule for zone %q: %w", zoneID, err))
Expand All @@ -90,7 +90,7 @@ func resourceCloudflareFirewallRuleRead(ctx context.Context, d *schema.ResourceD
client := meta.(*cloudflare.API)
zoneID := d.Get("zone_id").(string)

firewallRule, err := client.FirewallRule(ctx, zoneID, d.Id())
firewallRule, err := client.FirewallRule(ctx, cloudflare.ZoneIdentifier(zoneID), d.Id())

tflog.Debug(ctx, fmt.Sprintf("firewallRule: %#v", firewallRule))
tflog.Debug(ctx, fmt.Sprintf("firewallRule error: %#v", err))
Expand Down Expand Up @@ -153,7 +153,7 @@ func resourceCloudflareFirewallRuleUpdate(ctx context.Context, d *schema.Resourc

tflog.Debug(ctx, fmt.Sprintf("Updating Cloudflare Firewall Rule from struct: %+v", newFirewallRule))

r, err := client.UpdateFirewallRule(ctx, zoneID, newFirewallRule)
r, err := client.UpdateFirewallRule(ctx, cloudflare.ZoneIdentifier(zoneID), newFirewallRule)

if err != nil {
return diag.FromErr(fmt.Errorf("error updating Firewall Rule for zone %q: %w", zoneID, err))
Expand All @@ -172,7 +172,7 @@ func resourceCloudflareFirewallRuleDelete(ctx context.Context, d *schema.Resourc

tflog.Info(ctx, fmt.Sprintf("Deleting Cloudflare Firewall Rule: id %s for zone %s", d.Id(), zoneID))

err := client.DeleteFirewallRule(ctx, zoneID, d.Id())
err := client.DeleteFirewallRule(ctx, cloudflare.ZoneIdentifier(zoneID), d.Id())

if err != nil {
return diag.FromErr(fmt.Errorf("error deleting Cloudflare Firewall Rule: %w", err))
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/resource_cloudflare_firewall_rule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ func testSweepCloudflareFirewallRuleSweeper(r string) error {
}

zoneID := os.Getenv("CLOUDFLARE_ZONE_ID")
rules, rulesErr := client.FirewallRules(context.Background(), zoneID, cloudflare.PaginationOptions{})
rules, _, rulesErr := client.FirewallRules(context.Background(), cloudflare.ZoneIdentifier(zoneID), cloudflare.FirewallRuleListParams{})

if rulesErr != nil {
tflog.Error(ctx, fmt.Sprintf("Failed to fetch Cloudflare firewall rules: %s", rulesErr))
}

for _, rule := range rules {
err := client.DeleteFirewallRule(context.Background(), zoneID, rule.ID)
err := client.DeleteFirewallRule(context.Background(), cloudflare.ZoneIdentifier(zoneID), rule.ID)

if err != nil {
tflog.Error(ctx, fmt.Sprintf("Failed to delete Cloudflare firewall rule (%s) in zone ID: %s", rule.ID, zoneID))
Expand Down