From 5214c7642207c8f01fc351592904ec320124aa61 Mon Sep 17 00:00:00 2001 From: Bastian Doetsch Date: Mon, 24 Apr 2023 20:24:06 +0530 Subject: [PATCH] fix: remove unnecessary token related env variables (#134) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Peter Schäfer <101886095+PeterSchafer@users.noreply.github.com> --- .../java/io/snyk/eclipse/plugin/runner/ProcessRunner.java | 3 +++ .../java/io/snyk/languageserver/LsRuntimeEnvironment.java | 8 -------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/plugin/src/main/java/io/snyk/eclipse/plugin/runner/ProcessRunner.java b/plugin/src/main/java/io/snyk/eclipse/plugin/runner/ProcessRunner.java index fdda9f3a..ec7c277d 100644 --- a/plugin/src/main/java/io/snyk/eclipse/plugin/runner/ProcessRunner.java +++ b/plugin/src/main/java/io/snyk/eclipse/plugin/runner/ProcessRunner.java @@ -125,8 +125,11 @@ private void setupProcessBuilderBase(ProcessBuilder pb) { if (token != null && authMethod.equals(Preferences.AUTH_METHOD_OAUTH)) { pb.environment().put(EnvironmentConstants.ENV_INTERNAL_SNYK_OAUTH_ENABLED, "1"); pb.environment().put(EnvironmentConstants.ENV_INTERNAL_OAUTH_TOKEN_STORAGE, token); + pb.environment().remove(EnvironmentConstants.ENV_SNYK_TOKEN); } else { pb.environment().put(EnvironmentConstants.ENV_SNYK_TOKEN, token); + pb.environment().remove(EnvironmentConstants.ENV_INTERNAL_OAUTH_TOKEN_STORAGE); + } String insecure = Preferences.getInstance().getPref(Preferences.INSECURE_KEY); diff --git a/plugin/src/main/java/io/snyk/languageserver/LsRuntimeEnvironment.java b/plugin/src/main/java/io/snyk/languageserver/LsRuntimeEnvironment.java index 1de6058f..812fb49a 100644 --- a/plugin/src/main/java/io/snyk/languageserver/LsRuntimeEnvironment.java +++ b/plugin/src/main/java/io/snyk/languageserver/LsRuntimeEnvironment.java @@ -74,14 +74,6 @@ String getOs() { } public void updateEnvironment(Map env) { - String authToken = Preferences.getInstance().getAuthToken(); - if (authToken != null && !authToken.isBlank()) { - env.put("SNYK_TOKEN", authToken); - } - String endpoint = Preferences.getInstance().getEndpoint(); - if (endpoint != null && !endpoint.isEmpty()) { - env.put("SNYK_API", endpoint); - } addPath(env); addIntegrationInfoToEnv(env); addProxyToEnv(env);