Skip to content

Add Option for Pre-Scan command, fix auth race [IDE-908][IDE-939] #764

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 7, 2025

Conversation

bastiandoetsch
Copy link
Collaborator

@bastiandoetsch bastiandoetsch commented Jan 30, 2025

Description

  • add command that is called before a scan
  • refactor: move dependency-less test helpers to package testsupport
  • adds a helper target to the Makefile: lint-fix fixes findings the linter can fix
  • fixes the following auth race:

A potential race condition related to authentication has been identified in IntelliJ.

  1. IDE starts up CLI with initializationOptions incl. OAuth2 token
  2. LS starts WHOAMI workflow with (expired) credentials
  3. WHOAMI workflow refreshes OAuth2 token
  4. LS saves token and triggers $/hasAuthenticated with new token
  5. At the same time, IDE sends the current configuration with DidChangeConfiguration, with the old credentials
  6. LS updates the credentials to the old credentials
  7. Next call to API returns not authenticated and creds are deleted in LS
  8. LS forwards the logout to the IDE.

Solution: when updating the token, do not accept super-seded tokens (check Expiry)

Note
The high line change count is due to the license update, which pulled in a few files into the license folder.

Checklist

  • Tests added and all succeed
  • Linted
  • README.md updated, if user-facing
  • License file updated, if new 3rd-party dependency is introduced

@bastiandoetsch bastiandoetsch requested a review from a team as a code owner January 30, 2025 08:35
@bastiandoetsch bastiandoetsch marked this pull request as draft January 30, 2025 08:36
@bastiandoetsch bastiandoetsch force-pushed the feat/IDE-908_add-option-for-pre-scan-command branch from c2a0c27 to 48d0dca Compare January 30, 2025 08:57
@bastiandoetsch bastiandoetsch force-pushed the feat/IDE-908_add-option-for-pre-scan-command branch from 10a3980 to 67528a5 Compare January 30, 2025 09:02
@bastiandoetsch bastiandoetsch force-pushed the feat/IDE-908_add-option-for-pre-scan-command branch from 67528a5 to 21497fe Compare January 30, 2025 09:05
@bastiandoetsch bastiandoetsch changed the title Add Option for Pre-Scan command [IDE-908] Add Option for Pre-Scan command, fix auth race [IDE-908][IDE-939] Feb 7, 2025
Copy link
Contributor

@acke acke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bastiandoetsch bastiandoetsch merged commit 816d51d into main Feb 7, 2025
18 checks passed
@bastiandoetsch bastiandoetsch deleted the feat/IDE-908_add-option-for-pre-scan-command branch February 7, 2025 14:18
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