Hi,
I am using JSON web tokens (as seen in this tutorial Node JS JSON Web Tokens) to secure an API application and I have been reading that I should not store my secret in a config.js file in the Node App, but instead I should use an environment variable and that on BitBucket, the environment variable should be "secure".
I can see on the BitBucket site where I can add a secure environment variables, but I am not sure how to access them. I assume there is something I need to write in my Pipeline to decrypt and use the token, but I am not sure how. I am currently deploying to heroku and using a simple script as my pipeline:
image: node:8.9.4
clone: depth: full
pipelines: branches: master:
- step: script:
- npm install
- git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git master
Can anyone shed any light on how to access the secure environment variable in the pipeline script?
Thank you