edgeworkers-examples icon indicating copy to clipboard operation
edgeworkers-examples copied to clipboard

Compiling rollup bundles without secrets

Open roastlechon opened this issue 2 years ago • 5 comments

Currently need a way to produce a rollup bundle without secrets.

Example would be to compile a rollup bundle with different edgekv_tokens so that the same bundle can be deployed to different environments, but use different keys (without having to compile a new bundle each time).

This use case should also apply to anything that may rely on environment variables. The Edgeworker may use a different set of Environment Variables to point to different systems or APIs.

Due to the fact that EdgeKv has to be copied into the source project of the Edgeworker, compilation of the project will fail because it needs credentials for Akamai CLI to download the edgekv_tokens. If it were injected in a different manner, it would not need to be recompiled each time edgekv_tokens change.

roastlechon avatar Aug 12 '22 20:08 roastlechon

@roastlechon We are building a way to no longer require the access token’s JWT value to be included in the EW bundle. Its in the design phase now. Adding @mryakan to this thread for visibility into your requirements.

cosjef avatar Aug 15 '22 17:08 cosjef

Awesome! Thank you guys so much. Is this expandable for any arbitrary variables that can be injected?

roastlechon avatar Aug 15 '22 18:08 roastlechon

@roastlechon, EdgeWorkers can both set and access Property Manager variables as described here: https://techdocs.akamai.com/edgeworkers/docs/request-object#getvariable

Can you elaborate if you were thinking of a different use case that would require a different solution?

ananner avatar Aug 17 '22 18:08 ananner

I think that should be okay. Can variables be secrets and stored or retrieved securely in Property Manager?

roastlechon avatar Aug 18 '22 17:08 roastlechon

Secrets are not recommended to be stored in Property Manager, since that workflow of storing secrets is not supported by a myriad of compliance regimes.

ananner avatar Aug 24 '22 20:08 ananner