You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 scriptbru.setVar("esp_token",bru.getProcessEnv("ESP_TOKEN"));
Environment variable ESP_TOKEN set in my local machine .bashrc(e.g. export ESP_TOKEN=SUPER_SECRET_KEY)
Request header token set to a collection variable (e.g. token: {{esp_token}} )
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"));)
The text was updated successfully, but these errors were encountered:
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
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
ESP_TOKEN
set in my local machine.bashrc
(e.g.export ESP_TOKEN=SUPER_SECRET_KEY
)token
set to a collection variable (e.g.token: {{esp_token}}
)getProcessEnv
to retrieve the value from local machine ENV (e.g.bru.setVar("esp_token", bru.getProcessEnv("ESP_TOKEN"));
)The text was updated successfully, but these errors were encountered: