Skip to content

Commit

Permalink
chore: keep token auth as default for now
Browse files Browse the repository at this point in the history
  • Loading branch information
bastiandoetsch committed Jul 9, 2024
1 parent bed19e3 commit 9a06a76
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ public static synchronized Preferences getInstance(PreferenceStore store) {
if (getPref(SCANNING_MODE_AUTOMATIC) == null) {
store.put(SCANNING_MODE_AUTOMATIC, "true");
}

if (getPref(USE_TOKEN_AUTH) == null) {
store.put(USE_TOKEN_AUTH, "false");
store.put(USE_TOKEN_AUTH, "true");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private void setupProcessBuilderBase(ProcessBuilder pb) {

String token = Preferences.getInstance().getAuthToken();
if (token != null && !token.isBlank()) {
if (Preferences.getInstance().getBooleanPref(Preferences.USE_TOKEN_AUTH, false)) {
if (Preferences.getInstance().getBooleanPref(Preferences.USE_TOKEN_AUTH, true)) {
pb.environment().put(EnvironmentConstants.ENV_SNYK_TOKEN, token);
pb.environment().remove(EnvironmentConstants.ENV_OAUTH_ACCESS_TOKEN);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ Settings getCurrentSettings() {
}
String enableTrustedFolderFeature = Boolean.TRUE.toString();
String scanningMode = preferences.getBooleanPref(Preferences.SCANNING_MODE_AUTOMATIC) ? "automatic" : "manual";
Boolean useTokenAuth = preferences.getBooleanPref(Preferences.USE_TOKEN_AUTH, false);
boolean useTokenAuth = preferences.getBooleanPref(Preferences.USE_TOKEN_AUTH, true);
var authMethod = "oauth";
if (useTokenAuth) {
authMethod = "token";
}
}
return new Settings(activateSnykOpenSource, activateSnykCode, activateSnykIac, insecure, endpoint, additionalParams,
additionalEnv, path, sendErrorReports, enableTelemetry, organization, manageBinariesAutomatically, cliPath,
token, integrationName, integrationVersion, automaticAuthentication, trustedFolders, enableTrustedFolderFeature,
Expand Down

0 comments on commit 9a06a76

Please sign in to comment.