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

SetWorkersSecret doesn't work for unencrypted, fails if unencrypted already set #1203

Open
2 tasks done
slester opened this issue Feb 8, 2023 · 1 comment
Open
2 tasks done

Comments

@slester
Copy link
Contributor

slester commented Feb 8, 2023

Confirmation

  • My issue isn't already found on the issue tracker.
  • I have replicated my issue using the latest version of the library and it is still present.

cloudflare-go version

v0.60.0

Go environment

GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/slester/Library/Caches/go-build"
GOENV="/Users/slester/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/slester/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/slester/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/opt/homebrew/Cellar/go/1.19.5/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/homebrew/Cellar/go/1.19.5/libexec/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.19.5"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/slester/src/github.com/cloudflare/cloudflare-go/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/bb/mj30xnl142bg3fpz78c_g1700000gn/T/go-build3396119799=/tmp/go-build -gno-record-gcc-switches -fno-common"

Expected output

I'm trying to use the Workers API to update a secret (SetWorkersSecret with type text). The comment in the Go library says "SetWorkersSecret creates or updates a secret" that already exists as an environment variable (plain text).

Actual output

"global variable VAR_LIST already set (10053)"

Code demonstrating the issue

	res, err := s.api.SetWorkersSecret(ctx, workerName, &cloudflare.WorkersPutSecretRequest{
		Name: key,
		Text: value,
		Type: "text",
	})

Still tries to put it as an encrypted (secret_text) and fails if unencrypted is already set

Steps to reproduce

See code

References

No response

@jacobbednarz
Copy link
Member

can you expand on your steps to reproduce here? a minimal runnable go file would be great to show how/where your issue is happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants