cloudflare / cloudflare-go

The official Go library for the Cloudflare API
https://developers.cloudflare.com/api
BSD 3-Clause "New" or "Revised" License
1.5k stars 597 forks source link

`cloudflare_branding` field not available in Go struct #3685

Closed iwinux closed 4 days ago

iwinux commented 4 days ago

Confirmation

cloudflare-go version

v0.110.0

Go environment

GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/limbo/Library/Caches/go-build'
GOENV='/Users/limbo/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/limbo/.go/pkg/mod'
GONOPROXY='github.com/AfterShip/*'
GONOSUMDB='github.com/AfterShip/*'
GOOS='darwin'
GOPATH='/Users/limbo/.go'
GOPRIVATE='github.com/AfterShip/*'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/nix/store/44g95npjwgjyrxm1sx54g22w5sfmkz1i-go-1.21.6/share/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/nix/store/44g95npjwgjyrxm1sx54g22w5sfmkz1i-go-1.21.6/share/go/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.21.6'
GCCGO='gccgo'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/Users/limbo/Source/AfterShip/pltf-domains.as-in.com/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/tl/vdx9psv541bc4271016rwshc0000gn/T/go-build559841223=/tmp/go-build -gno-record-gcc-switches -fno-common'

Expected output

Create custom hostname successfully.

Actual output

{
  "result": {
    "ssl": null
  },
  "success": false,
  "errors": [
    {
      "code": 1469,
      "message": "Since no host is 64 characters or fewer, Cloudflare Branding is required. Please check your input and try again."
    }
  ],
  "messages": []
}

Code demonstrating the issue

// there is no way to set `"cloudflare_branding": true` here
    cloudflare.CustomHostname{
        Hostname: hostname,
        SSL: &cloudflare.CustomHostnameSSL{
            Method: "http",
            Type:   "dv",
            Settings: cloudflare.CustomHostnameSSLSettings{
                HTTP2:         "on",
                MinTLSVersion: "1.2",
                TLS13:         "on",
            },
        },
    }

Steps to reproduce

Just write the code and you will see.

References

No response

jacobbednarz commented 4 days ago

best submit this as a feature request to cloudflare support or your account team to have it triaged by the service team.

iwinux commented 4 days ago

I would consider this is a bug.