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

Integration with Cloudflare Workers #763

Open
alisson-acioli opened this issue Jul 19, 2023 · 5 comments
Open

Integration with Cloudflare Workers #763

alisson-acioli opened this issue Jul 19, 2023 · 5 comments

Comments

@alisson-acioli
Copy link
Contributor

Feature description

I would like to recommend this integration suggestion with Cloudflare Workers. Currently, you can put secret keys directly in the cloudflare panel or using wrangler in the worker publication, but it would be ideal to use infiscal to manage our keys in one place.

Why would it be useful?

Nowadays many applications are migrating to edge computing and cloudflare offers a good service for this, the problem in my view is when we have applications in virtual machines, serverless, among others and we always have to manage where our keys are. Using infisical on Cloudflare Workers would already facilitate management along with the other keys that are managed by infisical on AWS, PM2, Laravel, etc.

@afrieirham
Copy link
Contributor

afrieirham commented Jul 20, 2023

After some research, this integration is half possible. We can only sync encrypted secrets.

For some reason, all of these endpoints can only affect encrypted secrets.

  1. List secrets – GET /accounts/{account_id}/workers/scripts/{script_name}/secrets
  2. Create secrets – PUT /accounts/{account_id}/workers/scripts/{script_name}/secrets
    • request body 👇 but not sure what are other possible type, source code
{
    "name": "DB_NAME",
    "text": "infisical",
    "type": "secret_text"
}
  1. Delete secrets – DELETE /accounts/{account_id}/workers/scripts/{script_name}/secrets/{secret_name}

I've tested all of it and it works perfectly as long as the secrets are encrypted. But nothing happens when it's not encrypted.

Also, I've open an issue in their repo here

Context

I find out about the endpoint from this forum here. The endpoint is not available in their API docs.

@alisson-acioli
Copy link
Contributor Author

Actually, the endpoints to do this are not found in the official documentation, I saw that some people complained about it.

If you can actually integrate it, it will be very useful, especially here in our company =)

@afrieirham
Copy link
Contributor

@alisson-acioli it can be done but is it okay if you can only sync encrypted secrets?

image

also need some opinion from @dangtony98

@alisson-acioli
Copy link
Contributor Author

In the case of adding encrypted variables, they just weren't visible in the wrangler and in the cloudflare panel, would that be it?

Item 6 here https://developers.cloudflare.com/workers/configuration/environment-variables/#add-environment-variables-via-the-dashboard

Anyway, through the Infisical panel, would I be able to visualize it and change it? Because if the sacrifice is not to visualize it in the wrangler/cloudflare panel, it's ok, because with Infisical I can do it.

@akhilmhdh
Copy link
Member

Closing as completd

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

No branches or pull requests

3 participants