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

feat(workers): Adds support for Workers secrets #475

Merged
merged 1 commit into from
Aug 13, 2020

Conversation

pims
Copy link

@pims pims commented Jun 1, 2020

Description

TODO
Closes #474

Has your change been tested?

go test
PASS
ok  	github.com/cloudflare/cloudflare-go	0.218s

Types of changes

What sort of change does your code introduce/modify?

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

SetWorkersSecret creates or updates a secret
DeleteWorkersSecret deletes a secret
ListWorkersSecrets lists all secrets
@jacobbednarz
Copy link
Member

Support for worker plain keys and secrets was added in #465 last week. Are there any differences in this PR not in that one?

@pims
Copy link
Author

pims commented Jun 1, 2020

@jacobbednarz this PR does not require uploading a Worker script to set a secret.
It is more or less similar to using wrangler: https://developers.cloudflare.com/workers/tooling/wrangler/secrets/

It uses the WorkerBindingType created in #465.

@jacobbednarz
Copy link
Member

🙌 thanks for the explanation

@pims
Copy link
Author

pims commented Jun 1, 2020

@jacobbednarz let me know if this is a PR you'd consider merging.
I'll take a stab at updating the api documentation if this PR moves forward.

@jacobbednarz
Copy link
Member

The only real prerequisites I have for changes are:

  • That the endpoints used are publicly documented; and
  • Functionality has tests

Other than that, I’m happy to review the PR.

@pims
Copy link
Author

pims commented Jun 2, 2020

That the endpoints used are publicly documented

They're used by Wrangler but I can't find the relevant documentation on api.cloudflare.com, so I guess these are non-public endpoints. 😞

@jacobbednarz
Copy link
Member

I couldn’t find them on developers.cloudflare.com either but if we can get the documentation added, I’m a 👍 to the PR.

@pims
Copy link
Author

pims commented Jun 2, 2020

@jacobbednarz any pointers on how to update the documentation? I couldn't find a repo for the api-schema, just the repo for developers.cloudflare.com/api/.

@jacobbednarz
Copy link
Member

I don’t think there is a public repository for it. If you’re internal to Cloudflare, drop @patryk a message and he can walk you through the steps to get it into a backlog. Otherwise, a support ticket to Cloudflare Support will get routed to the right place.

I’m just an interested party/contributed outside of Cloudflare as I maintain the Terraform provider 😊

@pims
Copy link
Author

pims commented Jun 2, 2020

@jacobbednarz ah! No wonder I hadn't seen your name in our internal chat 😅 I'll file a JIRA.
Thanks again for taking the time to look at this PR.

@jacobbednarz
Copy link
Member

Don’t worry, you’re not the first to be confused😄 Happy for you to ping me when you’re ready here as this is something that would definitely be useful upstream in Terraform too.

@pims pims marked this pull request as ready for review July 13, 2020 16:21
@patryk patryk merged commit 8829567 into cloudflare:master Aug 13, 2020
@patryk
Copy link

patryk commented Aug 13, 2020

Thanks!

@pims pims deleted the workers-secrets branch August 18, 2020 17:28
Justin-Holmes pushed a commit to Justin-Holmes/cloudflare-go that referenced this pull request Sep 17, 2020
SetWorkersSecret creates or updates a secret
DeleteWorkersSecret deletes a secret
ListWorkersSecrets lists all secrets
Justin-Holmes pushed a commit to Justin-Holmes/cloudflare-go that referenced this pull request Sep 18, 2020
SetWorkersSecret creates or updates a secret
DeleteWorkersSecret deletes a secret
ListWorkersSecrets lists all secrets
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

Successfully merging this pull request may close these issues.

Add support for creating/deleting/listing Workers secrets
3 participants