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

System Environment Variable is not working with processEnv #1314

Open
shkumar-adsk opened this issue Oct 21, 2024 · 0 comments
Open

System Environment Variable is not working with processEnv #1314

shkumar-adsk opened this issue Oct 21, 2024 · 0 comments

Comments

@shkumar-adsk
Copy link

  • REST Client Version: v0.25.1
  • VSCode Version:1.94.2
  • OS Version: macOD Sonoma version 14.6.1

Steps to Reproduce:
I am making use of jira apis for this issue but any api can be used. It does not matter

  1. open an empty folder in vscode and add .vscode/settings.json file with following
{
    "rest-client.environmentVariables": {
        "$shared": {
            "defaultContentType": "application/json"
        },
        "local": {
            "jiraHostName": "http://localhost:8080/",
            "jiraToken": "LOCALJIRAPAT",
            "jiraIssueId": "TEST-1"
        },
        "production": {
            "jiraHostName": "https://jira.autodesk.com/",
            "jiraToken": "PRODJIRAPAT",
            "jiraIssueId": "TEST-1000"
        }
 }
  1. add new file jira.http and add following block of code
GET {{jiraHostName}}/rest/api/2/issue/{{jiraIssueId}}
Content-Type: {{defaultContentType}}
Authorization: Bearer {{$processEnv jiraToken}}
  1. open ~/.bashrc file and add
export LOCALJIRAPAT="my-token"
export PRODJIRAPAT="my-secret-tokenj"
  1. Restart the terminal.
  2. Restart the vscode and open the folder with newly written code
  3. open jira.http file and make the GET request you will receive 401
    The processEnv is unable to resolve the system Environment variable
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