Skip to content

Commit

Permalink
chore: update token auth default to 'false' (#195)
Browse files Browse the repository at this point in the history
* chore: update token auth default to 'false'

* chore: update changelog
  • Loading branch information
bastiandoetsch authored Aug 27, 2024
1 parent 145426a commit a9405f4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

## [2.2.0] - Unreleased
### Changes
- update required protocol version to 12
- update required protocol version to 14
- integrate latest docs incl. troubleshooting
- default to oauth2 when authenticating

## [2.2.0] - v20240619.131238
### Changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public static synchronized Preferences getInstance(PreferenceStore store) {
}

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

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, true)) {
if (Preferences.getInstance().getBooleanPref(Preferences.USE_TOKEN_AUTH, false)) {
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,7 +51,7 @@ 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, true);
boolean useTokenAuth = preferences.getBooleanPref(Preferences.USE_TOKEN_AUTH, false);
var authMethod = "oauth";
if (useTokenAuth) {
authMethod = "token";
Expand Down

0 comments on commit a9405f4

Please sign in to comment.