Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: cloudflare/cloudflare-go
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.113.0
Choose a base ref
...
head repository: cloudflare/cloudflare-go
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.114.0
Choose a head ref

Commits on Dec 27, 2024

  1. Copy the full SHA
    cd2b91d View commit details

Commits on Jan 2, 2025

  1. Update README.md

    jacobbednarz authored Jan 2, 2025
    Copy the full SHA
    dcba684 View commit details

Commits on Jan 6, 2025

  1. Bump golang.org/x/time from 0.8.0 to 0.9.0

    Bumps [golang.org/x/time](https://github.com/golang/time) from 0.8.0 to 0.9.0.
    - [Commits](golang/time@v0.8.0...v0.9.0)
    
    ---
    updated-dependencies:
    - dependency-name: golang.org/x/time
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Jan 6, 2025
    Copy the full SHA
    842c010 View commit details
  2. Copy the full SHA
    d1b9b47 View commit details
  3. Copy the full SHA
    cd78667 View commit details

Commits on Jan 7, 2025

  1. Merge pull request #3764 from piperswe/piper/wr-turnstile

    feat: add waiting room turnstile integration fields
    jacobbednarz authored Jan 7, 2025
    Copy the full SHA
    4daa3f5 View commit details
  2. Bump golang.org/x/net from 0.33.0 to 0.34.0

    Bumps [golang.org/x/net](https://github.com/golang/net) from 0.33.0 to 0.34.0.
    - [Commits](golang/net@v0.33.0...v0.34.0)
    
    ---
    updated-dependencies:
    - dependency-name: golang.org/x/net
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Jan 7, 2025
    Copy the full SHA
    ed28cdb View commit details
  3. Copy the full SHA
    c7fd485 View commit details
  4. Copy the full SHA
    1ad4079 View commit details

Commits on Jan 13, 2025

  1. Copy the full SHA
    dc06163 View commit details
  2. Copy the full SHA
    a347f81 View commit details
  3. fix: add placement fields in script response

    Add the `placement` object to script responses in addition to
    the now deprecated `placement_mode`.
    danielrs committed Jan 13, 2025
    Copy the full SHA
    dc887d6 View commit details
  4. chore: changelog for #3825

    danielrs committed Jan 13, 2025
    Copy the full SHA
    9653794 View commit details
  5. Copy the full SHA
    75e7c41 View commit details

Commits on Jan 14, 2025

  1. Copy the full SHA
    43c3b8a View commit details
  2. feat(teams_rules): support internal dns settings

    With this commit, it's possible to create DNS resolver rules configured
    to forward DNS queries to the internal DNS service with the given
    internal DNS view identifier.
    sebassimoes committed Jan 14, 2025
    Copy the full SHA
    75449b0 View commit details
  3. Copy the full SHA
    296bd73 View commit details
  4. add changelog

    jacobbednarz committed Jan 14, 2025
    Copy the full SHA
    3ad51b8 View commit details

Commits on Jan 15, 2025

  1. Copy the full SHA
    ecbef96 View commit details
  2. Copy the full SHA
    42e433d View commit details
  3. Copy the full SHA
    eaf799a View commit details
  4. Copy the full SHA
    ed69723 View commit details
  5. generate changelog

    jacobbednarz committed Jan 15, 2025
    Copy the full SHA
    d558bee View commit details
  6. Update CHANGELOG.md

    jacobbednarz authored Jan 15, 2025
    Copy the full SHA
    d289377 View commit details
Showing with 388 additions and 93 deletions.
  1. +3 −0 .changelog/3764.txt
  2. +3 −0 .changelog/3779.txt
  3. +3 −0 .changelog/3783.txt
  4. +3 −0 .changelog/3796.txt
  5. +3 −0 .changelog/3824.txt
  6. +7 −0 .changelog/3825.txt
  7. +3 −0 .changelog/3829.txt
  8. +20 −1 CHANGELOG.md
  9. +0 −6 README.md
  10. +12 −1 access_application.go
  11. +55 −7 access_application_test.go
  12. +2 −5 convert_types.go
  13. +2 −2 go.mod
  14. +4 −4 go.sum
  15. +0 −2 rulesets.go
  16. +14 −0 teams_rules.go
  17. +202 −57 teams_rules_test.go
  18. +4 −0 waiting_room.go
  19. +10 −2 waiting_room_test.go
  20. +23 −2 workers.go
  21. +15 −4 workers_test.go
3 changes: 3 additions & 0 deletions .changelog/3764.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
waiting_room: add waiting room turnstile integration fields
```
3 changes: 3 additions & 0 deletions .changelog/3779.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
teams_rules: add support for `resolve_dns_internally` settings on dns_resolver rules
```
3 changes: 3 additions & 0 deletions .changelog/3783.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:dependency
deps: bumps golang.org/x/time from 0.8.0 to 0.9.0
```
3 changes: 3 additions & 0 deletions .changelog/3796.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:dependency
deps: bumps golang.org/x/net from 0.33.0 to 0.34.0
```
3 changes: 3 additions & 0 deletions .changelog/3824.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:note
rulesets: remove `http_request_sbfm` phase
```
7 changes: 7 additions & 0 deletions .changelog/3825.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```release-note:note
workers: The `placement_mode` attribute in script upload responses has been deprecated. The new attribute `placement.mode` should be used instead.
```

```release-note:enhancement
workers: Add new `placement` attribute object in script upload responses. It contains the `mode` and `status` attributes.
```
3 changes: 3 additions & 0 deletions .changelog/3829.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
access_application: added more fields to private destinations
```
21 changes: 20 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
## 0.114.0 (Unreleased)
## 0.115.0 (Unreleased)

## 0.114.0 (January 15th, 2025)

NOTES:

* rulesets: remove `http_request_sbfm` phase ([#3824](https://github.com/cloudflare/cloudflare-go/issues/3824))
* workers: The `placement_mode` attribute in script upload responses has been deprecated. The new attribute `placement.mode` should be used instead. ([#3825](https://github.com/cloudflare/cloudflare-go/issues/3825))

ENHANCEMENTS:

* access_application: added more fields to private destinations ([#3829](https://github.com/cloudflare/cloudflare-go/issues/3829))
* teams_rules: add support for `resolve_dns_internally` settings on dns_resolver rules ([#3779](https://github.com/cloudflare/cloudflare-go/issues/3779))
* waiting_room: add waiting room turnstile integration fields ([#3764](https://github.com/cloudflare/cloudflare-go/issues/3764))
* workers: Add new `placement` attribute object in script upload responses. It contains the `mode` and `status` attributes. ([#3825](https://github.com/cloudflare/cloudflare-go/issues/3825))

DEPENDENCIES:

* deps: bumps golang.org/x/net from 0.33.0 to 0.34.0 ([#3796](https://github.com/cloudflare/cloudflare-go/issues/3796))
* deps: bumps golang.org/x/time from 0.8.0 to 0.9.0 ([#3783](https://github.com/cloudflare/cloudflare-go/issues/3783))

## 0.113.0 (January 1st, 2025)

6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -69,12 +69,6 @@ Also refer to the
[API documentation](https://pkg.go.dev/github.com/cloudflare/cloudflare-go) for
how to use this package in-depth.

## Experimental improvements

This library is starting to ship with experimental improvements that are not yet
ready for production but will be introduced before the next major version. See
[experimental README](/docs/experimental.md) for full details.

## Contributing

Pull Requests are welcome, but please open an issue (or comment in an existing
13 changes: 12 additions & 1 deletion access_application.go
Original file line number Diff line number Diff line change
@@ -35,7 +35,18 @@ const (

type AccessDestination struct {
Type AccessDestinationType `json:"type"`
URI string `json:"uri"`
// URI is required and only used for public destinations.
URI string `json:"uri,omitempty"`
// Hostname can only be used for private destinations.
Hostname string `json:"hostname,omitempty"`
// CIDR can only be used for private destinations.
CIDR string `json:"cidr,omitempty"`
// PortRange can only be used for private destinations.
PortRange string `json:"port_range,omitempty"`
// L4Protocol can only be used for private destinations.
L4Protocol string `json:"l4_protocol,omitempty"`
// VnetID can only be used for private destinations.
VnetID string `json:"vnet_id,omitempty"`
}

// AccessApplication represents an Access application.
62 changes: 55 additions & 7 deletions access_application_test.go
Original file line number Diff line number Diff line change
@@ -294,7 +294,14 @@ func TestCreateAccessApplications(t *testing.T) {
"domain_type": "public",
"destinations": [
{"type": "public", "uri": "test.example.com/admin"},
{"type": "public", "uri": "test.example.com/admin2"}
{"type": "private", "hostname": "test.private.domain"},
{
"type": "private",
"cidr": "192.168.1.0/24",
"port_range": "8080-8081",
"vnet_id": "e69219cb-095a-4839-a352-b25b3d43aaac",
"l4_protocol": "udp"
}
],
"type": "self_hosted",
"session_duration": "24h",
@@ -342,8 +349,21 @@ func TestCreateAccessApplications(t *testing.T) {
Domain: "test.example.com/admin",
DomainType: AccessDestinationPublic,
Destinations: []AccessDestination{
{Type: AccessDestinationPublic, URI: "test.example.com/admin"},
{Type: AccessDestinationPublic, URI: "test.example.com/admin2"},
{
Type: AccessDestinationPublic,
URI: "test.example.com/admin",
},
{
Type: AccessDestinationPrivate,
Hostname: "test.private.domain",
},
{
Type: AccessDestinationPrivate,
CIDR: "192.168.1.0/24",
PortRange: "8080-8081",
VnetID: "e69219cb-095a-4839-a352-b25b3d43aaac",
L4Protocol: "udp",
},
},
Type: "self_hosted",
SessionDuration: "24h",
@@ -429,7 +449,14 @@ func TestUpdateAccessApplication(t *testing.T) {
"domain_type": "public",
"destinations": [
{"type": "public", "uri": "test.example.com/admin"},
{"type": "public", "uri": "test.example.com/admin2"}
{"type": "private", "hostname": "test.private.domain"},
{
"type": "private",
"cidr": "192.168.1.0/24",
"port_range": "8080-8081",
"vnet_id": "e69219cb-095a-4839-a352-b25b3d43aaac",
"l4_protocol": "udp"
}
],
"type": "self_hosted",
"session_duration": "24h",
@@ -476,7 +503,14 @@ func TestUpdateAccessApplication(t *testing.T) {
DomainType: AccessDestinationPublic,
Destinations: []AccessDestination{
{Type: AccessDestinationPublic, URI: "test.example.com/admin"},
{Type: AccessDestinationPublic, URI: "test.example.com/admin2"},
{Type: AccessDestinationPrivate, Hostname: "test.private.domain"},
{
Type: AccessDestinationPrivate,
CIDR: "192.168.1.0/24",
PortRange: "8080-8081",
VnetID: "e69219cb-095a-4839-a352-b25b3d43aaac",
L4Protocol: "udp",
},
},
Type: "self_hosted",
SessionDuration: "24h",
@@ -519,7 +553,14 @@ func TestUpdateAccessApplication(t *testing.T) {
DomainType: AccessDestinationPublic,
Destinations: []AccessDestination{
{Type: AccessDestinationPublic, URI: "test.example.com/admin"},
{Type: AccessDestinationPublic, URI: "test.example.com/admin2"},
{Type: AccessDestinationPrivate, Hostname: "test.private.domain"},
{
Type: AccessDestinationPrivate,
CIDR: "192.168.1.0/24",
PortRange: "8080-8081",
VnetID: "e69219cb-095a-4839-a352-b25b3d43aaac",
L4Protocol: "udp",
},
},
Type: "self_hosted",
SessionDuration: "24h",
@@ -557,7 +598,14 @@ func TestUpdateAccessApplication(t *testing.T) {
DomainType: AccessDestinationPublic,
Destinations: []AccessDestination{
{Type: AccessDestinationPublic, URI: "test.example.com/admin"},
{Type: AccessDestinationPublic, URI: "test.example.com/admin2"},
{Type: AccessDestinationPrivate, Hostname: "test.private.domain"},
{
Type: AccessDestinationPrivate,
CIDR: "192.168.1.0/24",
PortRange: "8080-8081",
VnetID: "e69219cb-095a-4839-a352-b25b3d43aaac",
L4Protocol: "udp",
},
},
Type: "self_hosted",
SessionDuration: "24h",
7 changes: 2 additions & 5 deletions convert_types.go
Original file line number Diff line number Diff line change
@@ -15,7 +15,6 @@
package cloudflare

import (
"reflect"
"time"
)

@@ -42,10 +41,8 @@ import (
// var _ *uint16 = AnyPtr(uint16(16)).(*uint16)
// var _ *uint32 = AnyPtr(uint32(32)).(*uint32)
// var _ *uint64 = AnyPtr(uint64(64)).(*uint64)
func AnyPtr(v interface{}) interface{} {
r := reflect.New(reflect.TypeOf(v))
reflect.ValueOf(r.Interface()).Elem().Set(reflect.ValueOf(v))
return r.Interface()
func AnyPtr[T any](v T) *T {
return &v
}

// BytePtr is a helper routine that allocates a new byte value to store v and
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -8,8 +8,8 @@ require (
github.com/olekukonko/tablewriter v0.0.5
github.com/stretchr/testify v1.10.0
github.com/urfave/cli/v2 v2.27.5
golang.org/x/net v0.33.0
golang.org/x/time v0.8.0
golang.org/x/net v0.34.0
golang.org/x/time v0.9.0
)

require gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -39,12 +39,12 @@ github.com/urfave/cli/v2 v2.27.5 h1:WoHEJLdsXr6dDWoJgMq/CboDmyY/8HMMH1fTECbih+w=
github.com/urfave/cli/v2 v2.27.5/go.mod h1:3Sevf16NykTbInEnD0yKkjDAeZDS0A6bzhBH5hrMvTQ=
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4=
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM=
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg=
golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY=
golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
2 changes: 0 additions & 2 deletions rulesets.go
Original file line number Diff line number Diff line change
@@ -35,7 +35,6 @@ const (
RulesetPhaseHTTPRequestOrigin RulesetPhase = "http_request_origin"
RulesetPhaseHTTPRequestRedirect RulesetPhase = "http_request_redirect"
RulesetPhaseHTTPRequestSanitize RulesetPhase = "http_request_sanitize"
RulesetPhaseHTTPRequestSBFM RulesetPhase = "http_request_sbfm"
RulesetPhaseHTTPRequestTransform RulesetPhase = "http_request_transform"
RulesetPhaseHTTPResponseCompression RulesetPhase = "http_response_compression"
RulesetPhaseHTTPResponseFirewallManaged RulesetPhase = "http_response_firewall_managed"
@@ -104,7 +103,6 @@ func RulesetPhaseValues() []string {
string(RulesetPhaseHTTPRequestOrigin),
string(RulesetPhaseHTTPRequestRedirect),
string(RulesetPhaseHTTPRequestSanitize),
string(RulesetPhaseHTTPRequestSBFM),
string(RulesetPhaseHTTPRequestTransform),
string(RulesetPhaseHTTPResponseCompression),
string(RulesetPhaseHTTPResponseFirewallManaged),
14 changes: 14 additions & 0 deletions teams_rules.go
Original file line number Diff line number Diff line change
@@ -67,6 +67,8 @@ type TeamsRuleSettings struct {
// Resolver policy settings.
DnsResolverSettings *TeamsDnsResolverSettings `json:"dns_resolvers,omitempty"`

ResolveDnsInternallySettings *TeamsResolveDnsInternallySettings `json:"resolve_dns_internally,omitempty"`

NotificationSettings *TeamsNotificationSettings `json:"notification_settings"`
Quarantine *TeamsQuarantine `json:"quarantine,omitempty"`
ForensicCopySettings *TeamsForensicCopySettings `json:"forensic_copy,omitempty"`
@@ -150,6 +152,18 @@ type (
VnetID string `json:"vnet_id,omitempty"`
RouteThroughPrivateNetwork *bool `json:"route_through_private_network,omitempty"`
}

TeamsResolveDnsInternallySettings struct {
ViewID string `json:"view_id"`
Fallback TeamsResolveDnsInternallyFallbackStrategy `json:"fallback"`
}

TeamsResolveDnsInternallyFallbackStrategy string
)

const (
None TeamsResolveDnsInternallyFallbackStrategy = "none"
PublicDns TeamsResolveDnsInternallyFallbackStrategy = "public_dns"
)

type TeamsDlpPayloadLogSettings struct {
Loading