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

Support workers plain and secret text bindings #465

Merged
merged 1 commit into from
May 26, 2020

Conversation

blakeembrey
Copy link

@blakeembrey blakeembrey commented May 21, 2020

Closes #464.

Description

Adds support for plain_text and secret_text bindings to workers.

Has your change been tested?

I have included tests locally based on the documentation and results from curl commands on my local account.

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.

Text: text,
}
case WorkerSecretTextBindingType:
bindingListItem.Binding = WorkerSecretTextBinding{}
Copy link
Author

@blakeembrey blakeembrey May 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: There is no text in the list response for secrets values (compared to plain text values).

scriptParams := WorkerScriptParams{
Script: workerScript,
Bindings: map[string]WorkerBinding{
"b1": WorkerSecretTextBinding{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Above you mentioned there isn't a text for WorkerSecretTextBinding. Is this assertion still correct then?

Copy link
Author

@blakeembrey blakeembrey May 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is writing the value, yes. Reading it in List doesn't give a text value back.

Edit: Updated the other comment to clarify it's about List.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha. Thanks for that; it makes sense now 🙂

@patryk
Copy link

patryk commented May 26, 2020

Thanks @blakeembrey !

@patryk patryk merged commit 65ec18a into cloudflare:master May 26, 2020
@blakeembrey blakeembrey deleted the be/add-text-bindings branch June 6, 2020 06:07
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 text bindings in workers
3 participants