Skip to content

feat: added pat to preferences page#297

Merged
bastiandoetsch merged 10 commits intomainfrom
feat/IDE-1188_add-pat
Jun 2, 2025
Merged

feat: added pat to preferences page#297
bastiandoetsch merged 10 commits intomainfrom
feat/IDE-1188_add-pat

Conversation

@acke
Copy link
Copy Markdown
Contributor

@acke acke commented May 20, 2025

Description

This ticket covers enhancing the IDE plugins' settings pages to allow a user to authenticate with PATs. As a minimum, this means:

  • They can select PAT as an authentication mechanism (Snyk Language Server does not support this option yet!)
  • added a dropdown on IDE
  • The “Connect IDE to Snyk“ (Get Authentication Token) button opens the PAT generation page (e.g https://app.snyk.io/account/personal-access-tokens) when PAT is the auth method
  • The Token field allows pasting PATs
  • TBD - Token auth is renamed to API Token
  • Config is updated with the Auth method and PAT when supplied.
  • Auth flow is kicked off when Apply is clicked in settings.

Checklist

  • Tests added and all succeed
  • Linted
  • CHANGELOG.md updated
  • README.md updated, if user-facing

Screenshots / GIFs

Visuals that may help the reviewer. Please add screenshots for any UI change. GIFs are most welcome!

@acke acke force-pushed the feat/IDE-1188_add-pat branch 2 times, most recently from c640b19 to e051972 Compare May 21, 2025 11:32
@acke acke marked this pull request as ready for review May 21, 2025 14:24
@acke acke requested a review from a team as a code owner May 21, 2025 14:24
Comment thread plugin/src/main/java/io/snyk/eclipse/plugin/preferences/AuthConstants.java Outdated
Comment thread plugin/src/main/java/io/snyk/eclipse/plugin/preferences/Preferences.java Outdated
Comment thread plugin/src/main/java/io/snyk/eclipse/plugin/preferences/Preferences.java Outdated
Comment thread plugin/src/main/java/io/snyk/eclipse/plugin/preferences/PreferencesPage.java Outdated
Comment thread plugin/src/main/java/io/snyk/eclipse/plugin/preferences/PreferencesPage.java Outdated
Comment thread tests/src/test/java/io/snyk/languageserver/LsConfigurationUpdaterTest.java Outdated
Comment thread tests/src/test/java/io/snyk/languageserver/LsConfigurationUpdaterTest.java Outdated
@acke acke force-pushed the feat/IDE-1188_add-pat branch from eba8c3a to 1e1c277 Compare May 23, 2025 07:14
Comment thread plugin/src/main/java/io/snyk/eclipse/plugin/preferences/AuthConstants.java Outdated
Comment thread plugin/src/main/java/io/snyk/eclipse/plugin/preferences/Preferences.java Outdated
@acke acke force-pushed the feat/IDE-1188_add-pat branch from 82b0ba8 to 3969e3a Compare May 23, 2025 09:54
@acke acke force-pushed the feat/IDE-1188_add-pat branch from 3969e3a to 818de2c Compare May 23, 2025 10:15
import io.snyk.languageserver.protocolextension.SnykExtendedLanguageClient;

public class PreferencesPage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
private static final String TRUSTING_WORKSPACE_FOLDERS = "Trusting workspace folders...";

Check warning

Code scanning / PMD

Avoid unused private fields such as 'TRUSTING_WORKSPACE_FOLDERS'.

Avoid unused private fields such as 'TRUSTING_WORKSPACE_FOLDERS'.
@bastiandoetsch bastiandoetsch force-pushed the feat/IDE-1188_add-pat branch from 063b114 to 170f896 Compare May 28, 2025 13:31
@bastiandoetsch bastiandoetsch force-pushed the feat/IDE-1188_add-pat branch from 170f896 to 1e02e00 Compare May 28, 2025 13:43
@andrewrobinsonhodges-snyk
Copy link
Copy Markdown
Contributor

TODO - need to bump LS protocol version (once LS changes are in) to handle sending "pat" as an auth type.

@bastiandoetsch
Copy link
Copy Markdown
Contributor

TODO - need to bump LS protocol version (once LS changes are in) to handle sending "pat" as an auth type.

It already has Protocol version 20 - so that should be fine.

@bastiandoetsch bastiandoetsch merged commit e17a1e1 into main Jun 2, 2025
8 checks passed
@bastiandoetsch bastiandoetsch deleted the feat/IDE-1188_add-pat branch June 2, 2025 12:15
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

Successfully merging this pull request may close these issues.

4 participants