Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 20, 2025

This PR implements secure password storage for remote Jupyter servers, addressing a highly requested feature where users need to re-enter passwords every time they open VS Code.

Changes Made

Core Implementation

  • Enhanced JupyterPasswordConnect to accept IEncryptedStorage dependency and implement password caching
  • Added secure storage methods using VS Code's secrets API for password persistence
  • Modified authentication flow to try stored passwords first, falling back to user prompts only when needed
  • Implemented automatic cleanup of stored passwords when servers are removed

Authentication Flow

  1. First connection: User enters password → authentication succeeds → password stored securely
  2. Subsequent connections: Stored password retrieved automatically → seamless authentication
  3. Authentication failure: Stored password cleared → user prompted for new password
  4. Server removal: Associated passwords automatically deleted

Security & Storage

  • Uses VS Code's secure extensionContext.secrets API for password storage
  • Passwords stored with service name "jupyter-server-password"
  • Unique storage keys based on server handles: "password-{server-handle}"
  • Automatic password cleanup when servers are removed from the server list

Testing

  • Updated existing unit tests to work with new constructor signature
  • Added 2 new unit tests specifically for password storage functionality
  • All 8 JupyterPasswordConnect tests passing
  • Verified 1161 total unit tests still pass (no regressions)

User Experience

Before this change, users had to enter their password every time they opened VS Code or reconnected to a remote Jupyter server. Now passwords are securely stored and automatically retrieved, providing a seamless connection experience while maintaining security through VS Code's encrypted secrets storage.

The implementation preserves all existing behavior for backwards compatibility - users without stored passwords will continue to see the same prompts as before.

Fixes #13671.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 0.0.0.123
    • Triggering command: node /home/REDACTED/work/vscode-jupyter/vscode-jupyter/node_modules/.bin/mocha --config ./build/.mocha.unittests.js.json ./out/interactive-window/generatedCodeStorageManager.unit.test.js ./out/interactive-window/shiftEnterBanner.unit.test.js ./out/kernels/helpers.unit.test.js ./out/kernels/kernelAutoReConnectMonitor.unit.test.js ./out/kernels/kernelAutoRestartMonitor.unit.test.js ./out/kernels/kernelCrashMonitor.unit.test.js ./out/kernels/kernelDependencyService.unit.test.js ./out/kernels/kernelFinder.unit.test.js ./out/kernels/kernelProvider.node.unit.test.js ./out/kernels/kernelProvider.web.unit.test.js ./out/kernels/kernelRefreshIndicator.node.unit.test.js ./out/kernels/kernelRefreshIndicator.web.unit.test.js ./out/test/package.nls.json.unit.test.js (packet block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@Copilot Copilot AI changed the title [WIP] Save Remote Server Password Implement password storage for remote Jupyter servers Aug 20, 2025
@Copilot Copilot AI requested a review from DonJayamanne August 20, 2025 00:39
Copilot finished work on behalf of DonJayamanne August 20, 2025 00:39
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.

Save Remote Server Password
2 participants