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

RFC: Extend Bru script to allow for get of process.env values #170

Closed
dcoomber opened this issue Aug 11, 2023 · 1 comment
Closed

RFC: Extend Bru script to allow for get of process.env values #170

dcoomber opened this issue Aug 11, 2023 · 1 comment

Comments

@dcoomber
Copy link
Member

dcoomber commented Aug 11, 2023

Problem statement

I have several collections that rely on the use of authentication tokens that are specific to each developer and may not be shared or committed to version control.

Proposed solution

Being able to load these tokens from the system environment (process.env) would support my needs for local usage as well as future usage on CI/CD pipeline.

Example

// Pre request script
bru.setVar("esp_token", bru.getProcessEnv("ESP_TOKEN"));
  1. Environment variable ESP_TOKEN set in my local machine .bashrc(e.g. export ESP_TOKEN=SUPER_SECRET_KEY)
  2. Request header token set to a collection variable (e.g. token: {{esp_token}} )
  3. Pre-request script sets the value using a new Bru method getProcessEnv to retrieve the value from local machine ENV (e.g. bru.setVar("esp_token", bru.getProcessEnv("ESP_TOKEN"));)
dcoomber added a commit to dcoomber/bruno that referenced this issue Aug 11, 2023
@dcoomber dcoomber changed the title Proposal: Extend Bru script to allow for get of process.env values RFC: Extend Bru script to allow for get of process.env values Aug 12, 2023
helloanoop added a commit that referenced this issue Aug 17, 2023
RFC: Support process.env in Bru script Re #170
@dcoomber
Copy link
Member Author

Thank you, @helloanoop

Closing off the issue.

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

No branches or pull requests

1 participant