Releases: cloudflare/cloudflare-go
v0.95.0
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
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
- api: OpenAPI spec update via Stainless API (#1785) (c46158d)
- api: OpenAPI spec update via Stainless API (#1786) (371672b)
- api: OpenAPI spec update via Stainless API (#1787) (47ad405)
- api: OpenAPI spec update via Stainless API (#1788) (49d6aec)
- api: OpenAPI spec update via Stainless API (#1789) (1bfe1dc)
- api: OpenAPI spec update via Stainless API (#1791) (b9acc0b)
- api: OpenAPI spec update via Stainless API (#1792) (dcabc90)
- api: OpenAPI spec update via Stainless API (#1793) (b45cf89)
- api: OpenAPI spec update via Stainless API (#1794) (04ad9cb)
- api: OpenAPI spec update via Stainless API (#1795) (0c33f28)
- api: OpenAPI spec update via Stainless API (#1796) (6e3fe04)
- api: OpenAPI spec update via Stainless API (#1797) (b1502e0)
- api: OpenAPI spec update via Stainless API (#1798) (18a026c)
- api: OpenAPI spec update via Stainless API (#1800) (c0c9b23)
- api: OpenAPI spec update via Stainless API (#1801) (5a77eae)
- api: OpenAPI spec update via Stainless API (#1802) (ab55f0c)
- api: OpenAPI spec update via Stainless API (#1803) (3bcc682)
- api: OpenAPI spec update via Stainless API (#1804) (01f9e5a)
- api: OpenAPI spec update via Stainless API (#1805) (9d6c74e)
- api: OpenAPI spec update via Stainless API (#1806) (a229e9e)
- api: OpenAPI spec update via Stainless API (#1807) (dc7ff76)
- api: OpenAPI spec update via Stainless API (#1808) (eb3189d)
- api: OpenAPI spec update via Stainless API (#1809) (7832d67)
- api: OpenAPI spec update via Stainless API (#1810) (2745e9f)
- api: OpenAPI spec update via Stainless API (#1816) (03cca00)
- api: OpenAPI spec update via Stainless API (#1820) (b6b38ee)
- api: OpenAPI spec update via Stainless API (#1829) (22a0cf2)
- api: OpenAPI spec update via Stainless API (#1830) (3c07f23)
- api: OpenAPI spec update via Stainless API (#1831) (66a8c6a)
- api: OpenAPI spec update via Stainless API (#1835) (b496234)
- api: OpenAPI spec update via Stainless API (#1838) (c11a40c)
- api: update via SDK Studio (#1782) (0adf3e1)
- api: update via SDK Studio (#1784) (1079b16)
- api: update via SDK Studio (#1799) (476c601)
- api: update via SDK Studio (#1812) (5e44bc5)
- api: update via SDK Studio (#1813) (2409946)
- api: update via SDK Studio (#1814) (438a7c9)
- api: update via SDK Studio (#1815) (39d96df)
- api: update via SDK Studio (#1817) (6f304fa)
- api: update via SDK Studio (#1818) (8570aec)
- api: update via SDK Studio (#1819) (cceb524)
- api: update via SDK Studio (#1821) (a035789)
- api: update via SDK Studio (#1822) (b0878be)
- api: update via SDK Studio (#1823) ([8e49406](https://github.com/c...
v0.94.0
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
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....
v0.93.0
v2.0.0-beta.17
2.0.0-beta.17 (2024-04-01)
Full Changelog: v2.0.0-beta.16...v2.0.0-beta.17
Features
- api: OpenAPI spec update via Stainless API (#1631) (27b4179)
- api: OpenAPI spec update via Stainless API (#1634) (20f16c0)
- api: OpenAPI spec update via Stainless API (#1635) (6038f94)
- api: OpenAPI spec update via Stainless API (#1636) (a814464)
- api: OpenAPI spec update via Stainless API (#1637) (54af1a2)
- api: update via SDK Studio (#1621) (b8f3a51)
- api: update via SDK Studio (#1623) (c4193da)
- api: update via SDK Studio (#1624) (494ceb3)
- api: update via SDK Studio (#1625) (8a8fde1)
- api: update via SDK Studio (#1626) (c8a70d6)
- api: update via SDK Studio (#1627) (5582b65)
- api: update via SDK Studio (#1628) (97be28e)
- api: update via SDK Studio (#1629) (b8cefc2)
- api: update via SDK Studio (#1630) (bd3a57e)
- api: update via SDK Studio (#1632) (2176b4e)