Skip to content

Commit

Permalink
fix: remove unnecessary token related env variables (#134)
Browse files Browse the repository at this point in the history
Co-authored-by: Peter Schäfer <101886095+PeterSchafer@users.noreply.github.com>
  • Loading branch information
bastiandoetsch and PeterSchafer authored Apr 24, 2023
1 parent b51671a commit 5214c76
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,6 @@ String getOs() {
}

public void updateEnvironment(Map<String, String> 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);
Expand Down

0 comments on commit 5214c76

Please sign in to comment.