Skip to content

Releases: cloudflare/cloudflare-go

v2.2.0

09 May 05:04
de79501
Compare
Choose a tag to compare

Warning

v2.x of this library is a ground-up rewrite of the SDK, using code generation from our OpenAPI spec.

This package should be in a usable state for many projects, but expect frequent minor breaking
changes as we rename methods and types. If this isn't suitable for you project, we recommend
pinning to the 0.x releases for now.

2.2.0 (2024-05-08)

Full Changelog: v2.1.0...v2.2.0

Features

Read more

v0.95.0

08 May 00:14
4788db7
Compare
Choose a tag to compare

ENHANCEMENTS:

  • access_application: add support for policies array (#1956)
  • access_application: add support for scim_config (#1921)
  • access_policy: add support for reusable policies (#1956)
  • dlp: add support for zt risk behavior configuration (#1887)

BUG FIXES:

  • access_application: fix scim configuration authentication json marshalling (#1959)

DEPENDENCIES:

  • deps: bumps dependabot/fetch-metadata from 2.0.0 to 2.1.0 (#1839)
  • deps: bumps github.com/urfave/cli/v2 from 2.27.1 to 2.27.2 (#1861)
  • deps: bumps golang.org/x/net from 0.24.0 to 0.25.0 (#1974)
  • deps: bumps golangci/golangci-lint-action from 4 to 5 (#1845)
  • deps: bumps golangci/golangci-lint-action from 5 to 6 (#1975)

v2.1.0

24 Apr 04:47
Compare
Choose a tag to compare

Warning

v2.x of this library is a ground-up rewrite of the SDK, using code generation from our OpenAPI spec.

This package should be in a usable state for many projects, but expect frequent minor breaking
changes as we rename methods and types. If this isn't suitable for you project, we recommend
pinning to the 0.x releases for now.

2.1.0 (2024-04-23)

Full Changelog: v2.0.0...v2.1.0

Features

Read more

v0.94.0

24 Apr 02:40
4cfc90f
Compare
Choose a tag to compare

ENHANCEMENTS:

  • access_application: support options_preflight_bypass for access_application (#1790)
  • gateway: added ecs_support field to teams_location resource (#1826)
  • teams_account: adds custom certificate setting to teams account configuration (#1811)
  • workers: support deleting namespaced Workers (#1737)

DEPENDENCIES:

  • deps: bumps golang.org/x/net from 0.19.0 to 0.23.0 (#1825)

v2.0.0

12 Apr 02:58
2158081
Compare
Choose a tag to compare

Warning

v2.x of this library is a ground-up rewrite of the SDK, using code generation from our OpenAPI spec.

This package should be in a usable state for many projects, but expect frequent minor breaking
changes as we rename methods and types. If this isn't suitable for you project, we recommend
pinning to the 0.x releases for now.

Install

go get -u github.com/cloudflare/cloudflare-go/v2

Migration guide

What's changed

v2.x of this library is a ground-up rewrite of the SDK, using code generation from our OpenAPI spec.

Automatic migration

For assisting with automatic migrations, we have provided a GritQL pattern. Once you install Grit locally, you can run the following to handle some of the upgrade.

grit apply go_cloudflare_v2

Note

Due to the massive rewrite, not all methods have a way to represent the previous method signatures or structs they relied on. Instead of writing a migration that will likely incorrectly identify these, we have instead provided the method renames which will allow you to inspect the method usage and what values it requires.

Future migrations will be more seamless as we will be automatically generating these based on version diffs instead.

Manual migration

Client construction with API key and email

Old:

package main

func main() {
  api, err := cloudflare.New(os.Getenv("CLOUDFLARE_API_KEY"), os.Getenv("CLOUDFLARE_API_EMAIL"))
}

New:

package main

func main() {
  api := cloudflare.NewClient(
    option.WithAPIKey(os.Getenv("CLOUDFLARE_API_KEY")),
    option.WithAPIEmail(os.Getenv("CLOUDFLARE_API_EMAIL"))
  )
}

Client construction with API token

Old:

package main

func main() {
  api, err := cloudflare.NewWithAPIToken(os.Getenv("CLOUDFLARE_API_TOKEN"))
}

New:

package main

func main() {
  api := cloudflare.NewClient(
    option.WithAPIToken(os.Getenv("CLOUDFLARE_API_TOKEN"))
  )
}

Client construction with user service key

Old:

package main

func main() {
  api, err := cloudflare.NewWithUserServiceKey(os.Getenv("CLOUDFLARE_USER_SERVICE_KEY"))
}

New:

package main

func main() {
  api := cloudflare.NewClient(
    option.WithUserServiceKey(os.Getenv("CLOUDFLARE_USER_SERVICE_KEY"))
  )
}

Method renames

  • AccessAuditLogs -> ZeroTrust.Access.Logs
  • ListHyperdriveConfigs -> Hyperdrive.Configs.List
  • CreateHyperdriveConfig -> Hyperdrive.Config.New
  • DeleteHyperdriveConfig -> Hyperdrive.Config.Delete
  • GetHyperdriveConfig -> Hyperdrive.Config.Get
  • UpdateHyperdriveConfig -> Hyperdrive.Config.Update
  • CreateDevicePostureIntegration -> ZeroTrust.Devices.Posture.Integrations.New
  • UpdateDevicePostureIntegration -> ZeroTrust.Devices.Posture.Integrations.Update
  • DevicePostureIntegration -> ZeroTrust.Devices.Posture.Integration.Get
  • DevicePostureIntegrations -> ZeroTrust.Devices.Posture.Integrations.List
  • DeleteDevicePostureIntegration -> ZeroTrust.Devices.Posture.Integrations.Delete
  • ListEmailRoutingDestinationAddresses -> EmailRouting.Destination.Addresses.List
  • CreateEmailRoutingDestinationAddress -> EmailRouting.Destination.Address.New
  • GetEmailRoutingDestinationAddress -> EmailRouting.Destination.Address.Get
  • DeleteEmailRoutingDestinationAddress -> EmailRouting.Destination.Address.Delete
  • DevicePostureRules -> ZeroTrust.Devices.Postures.List
  • DevicePostureRule -> ZeroTrust.Devices.Posture.Get
  • CreateDevicePostureRule -> ZeroTrust.Devices.Posture.New
  • UpdateDevicePostureRule -> ZeroTrust.Devices.Posture.Update
  • DeleteDevicePostureRule -> ZeroTrust.Devices.Posture.Delete
  • ListR2Buckets -> R2.Buckets.List
  • CreateR2Bucket -> R2.Buckets.New
  • GetR2Bucket -> R2.Buckets.Get
  • DeleteR2Bucket -> R2.Buckets.Delete
  • DeleteWorker -> Workers.Scripts.Delete
  • GetWorker -> Workers.Scripts.Get
  • GetWorkerWithDispatchNamespace -> WorkersForPlatforms.Dispatch.Namespaces.Scripts.Get
  • ListWorkers -> Workers.Scripts.List
  • UploadWorker -> Workers.Scripts.New
  • GetWorkersScriptContent -> Workers.Scripts.Content.Get
  • UpdateWorkersScriptContent -> Workers.Scripts.Content.Update
  • GetWorkersScriptSettings -> Workers.Scripts.Settings.Get
  • UpdateWorkersScriptSettings -> Workers.Scripts.Settings.Update
  • GetDLPPayloadLogSettings -> ZeroTrust.DLP.PayloadLogs.Get
  • UpdateDLPPayloadLogSettings -> ZeroTrust.DLP.PayloadLogs.Update
  • ListAccessCACertificates -> ZeroTrust.Access.Applications.CAs.List
  • GetAccessCACertificate -> ZeroTrust.Access.Applications.CAs.Get
  • CreateAccessCACertificate -> ZeroTrust.Access.Applications.CAs.New
  • DeleteAccessCACertificate -> ZeroTrust.Access.Applications.CAs.Delete
  • ListPageShieldScripts -> PageShield.List
  • GetPageShieldScript -> PageShield.Get
  • GetTotalTLS -> ACM.TotalTLS.Get
  • SetTotalTLS -> ACM.TotalTLS.New
  • RegistrarDomain -> Registrar.Domains.Get
  • RegistrarDomains -> Registrar.Domains.List
  • UpdateRegistrarDomain -> Registrar.Domains.Update
  • CreateWorkersAccountSettings -> Workers.AccountSettings.Update
  • WorkersAccountSettings -> Workers.AccountSettings.Get
  • ListPermissionGroups -> User.Tokens.PermissionGroups.List
  • ListMagicTransitIPsecTunnels -> MagicTransit.IPSECTunnels.List
  • GetMagicTransitIPsecTunnel -> MagicTransit.IPSECTunnels.Get
  • CreateMagicTransitIPsecTunnels -> MagicTransit.IPSECTunnels.New
  • UpdateMagicTransitIPsecTunnel -> MagicTransit.IPSECTunnels.Update
  • DeleteMagicTransitIPsecTunnel -> MagicTransit.IPSECTunnels.Delete
  • GenerateMagicTransitIPsecTunnelPSK -> MagicTransit.IPSECTunnels.PSKGenerate
  • CreateZoneHold -> Zones.Holds.New
  • DeleteZoneHold -> Zones.Holds.Delete
  • GetZoneHold -> Zones.Holds.Get
  • ListZoneManagedHeaders -> ManagedHeaders.List
  • UpdateZoneManagedHeaders -> ManagedHeaders.Update
  • ListAccessPolicies -> ZeroTrust.Access.Applications.Policies.List
  • GetAccessPolicy -> ZeroTrust.Access.Applications.Policies.Get
  • CreateAccessPolicy -> ZeroTrust.Access.Applications.Policies.New
  • UpdateAccessPolicy -> ZeroTrust.Access.Applications.Policies.Update
  • DeleteAccessPolicy -> ZeroTrust.Access.Applications.Policies.Delete
  • CreateSSL -> CustomCertificates.New
  • ListSSL -> CustomCertificates.List
  • SSLDetails -> CustomCertificates.Get
  • UpdateSSL -> CustomCertificates.Update
  • ReprioritizeSSL -> CustomCertificates.Prioritize.Update
  • DeleteSSL -> CustomCertificates.Delete
  • GetCustomNameservers -> CustomNameservers.Get
  • CreateCustomNameservers -> CustomNameservers.New
  • DeleteCustomNameservers -> CustomNameservers.Delete
  • ListDexTests -> ZeroTrust.Devices.DEXTests.List
  • CreateDeviceDexTest -> ZeroTrust.Devices.DEXTests.New
  • UpdateDeviceDexTest -> ZeroTrust.Devices.DEXTests.Update
  • GetDeviceDexTest -> ZeroTrust.Devices.DEXTests.Get
  • DeleteDexTest -> ZeroTrust.Devices.DEXTests.Delete
  • AccessBookmarks -> ZeroTrust.Access.Bookmarks.List
  • ZoneLevelAccessBookmarks -> ZeroTrust.Access.Bookmarks.List
  • AccessBookmark -> ZeroTrust.Access.Bookmarks.Get
  • ZoneLevelAccessBookmark -> ZeroTrust.Access.Bookmarks.Get
  • CreateAccessBookmark -> ZeroTrust.Access.Bookmarks.New
  • CreateZoneLevelAccessBookmark -> ZeroTrust.Access.Bookmarks.New
  • UpdateAccessBookmark -> ZeroTrust.Access.Bookmarks.Update
  • UpdateZoneLevelAccessBookmark -> ZeroTrust.Access.Bookmarks.Update
  • DeleteAccessBookmark -> ZeroTrust.Access.Bookmarks.Delete
  • DeleteZoneLevelAccessBookmark -> ZeroTrust.Access.Bookmarks.Delete
  • CreateZoneLockdown -> Firewall.Lockdowns.New
  • UpdateZoneLockdown -> Firewall.Lockdowns.Update
  • DeleteZoneLockdown -> Firewall.Lockdowns.Delete
  • ZoneLockdown -> Firewall.Lockdowns.Get
  • ListZoneLockdowns -> Firewall.Lockdowns.List
  • GetRegionalTieredCache -> Cache.RegionalTieredCache.Get
  • UpdateRegionalTieredCache -> Cache.RegionalTieredCache.Edit
  • CreateWorkerRoute -> Workers.Routes.New
  • DeleteWorkerRoute -> Workers.Routes.Delete
  • ListWorkerRoutes -> Workers.Routess.List
  • GetWorkerRoute -> Workers.Routes.Get
  • UpdateWorkerRoute -> Workers.Routes.Update
  • CreateWaitingRoom -> WaitingRooms.New
  • ListWaitingRooms -> WaitingRooms.List
  • WaitingRoom -> WaitingRooms.Get
  • ChangeWaitingRoom -> WaitingRooms.Edit
  • UpdateWaitingRoom -> WaitingRooms.Update
  • DeleteWaitingRoom -> WaitingRooms.Delete
  • WaitingRoomStatus -> WaitingRooms.Status
  • WaitingRoomPagePreview -> WaitingRooms.Page.Preview
  • CreateWaitingRoomEvent -> WaitingRooms.Events.New
  • ListWaitingRoomEvents -> WaitingRooms.Events.List
  • WaitingRoomEvent -> WaitingRooms.Events.List
  • WaitingRoomEventPreview -> WaitingRooms.Events.Preview
  • ChangeWaitingRoomEvent -> WaitingRooms.Events.Edit
  • UpdateWaitingRoomEvent -> WaitingRooms.Events.Update
  • DeleteWaitingRoomEvent -> WaitingRooms.Events.Delete
  • ListWaitingRoomRules -> WaitingRooms.Rules.List
  • CreateWaitingRoomRule -> WaitingRooms.Rules.New
  • ReplaceWaitingRoomRules -> WaitingRooms.Rules.Update
  • UpdateWaitingRoomRule -> WaitingRooms.Rules.Edit
  • DeleteWaitingRoomRule -> WaitingRooms.Rules.Delete
  • GetWaitingRoomSettings -> WaitingRooms.Settings.Get
  • PatchWaitingRoomSettings -> WaitingRooms.Settings.Edit
  • UpdateWaitingRoomSettings -> WaitingRooms.Settings.Update
  • ListAccessMutualTLSCertificates -> ZeroTrust.Access.Certificates.List
  • GetAccessMutualTLSCertificate -> `ZeroTrust....
Read more

v0.93.0

10 Apr 04:43
04b1c77
Compare
Choose a tag to compare

BREAKING CHANGES:

  • dns: Remove "locked" flag which is always false (#1618)

ENHANCEMENTS:

  • magic_transit_ipsec_tunnel: Adds support for replay_protection boolean flag (#1710)

DEPENDENCIES:

  • deps: bumps golang.org/x/net from 0.22.0 to 0.24.0 (#1688)

v2.0.0-beta.17

02 Apr 00:59
Compare
Choose a tag to compare
v2.0.0-beta.17 Pre-release
Pre-release

2.0.0-beta.17 (2024-04-01)

Full Changelog: v2.0.0-beta.16...v2.0.0-beta.17

Features

v2.0.0-beta.16

27 Mar 20:46
Compare
Choose a tag to compare
v2.0.0-beta.16 Pre-release
Pre-release

2.0.0-beta.16 (2024-03-27)

Full Changelog: v2.0.0-beta.15...v2.0.0-beta.16

Features

v0.92.0

27 Mar 01:52
228b052
Compare
Choose a tag to compare

ENHANCEMENTS:

  • dlp: Adds support for ocr_enabled boolean flag (#1600)

BUG FIXES:

  • teams_rules: add "resolve" to allowable actions (#1615)

DEPENDENCIES:

  • deps: bumps dependabot/fetch-metadata from 1.6.0 to 1.7.0 (#1593)
  • deps: bumps dependabot/fetch-metadata from 1.7.0 to 2.0.0 (#1607)

v2.0.0-beta.15

26 Mar 20:59
3a0bb65
Compare
Choose a tag to compare
v2.0.0-beta.15 Pre-release
Pre-release

2.0.0-beta.15 (2024-03-26)

Full Changelog: v2.0.0-beta.14...v2.0.0-beta.15

Features