Skip to content
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

[ws-proxy] use ecdsa private key for createKey fake api #19211

Merged
merged 1 commit into from
Dec 11, 2023

Conversation

iQQBot
Copy link
Contributor

@iQQBot iQQBot commented Dec 7, 2023

Description

This PR change /_supervisor/v1/ssh_keys/create hook endpoint to use ecdsa key. It provides backward compatibility for vscode desktop because dev-tunnel-ssh does not support ed25519.

This is just a change in the algorithm of the private key. Note that this endpoint does not have any substantive effect, and these keys will not be used for authentication.

Summary generated by Copilot

🤖[deprecated] Generated by Copilot at 39ca671

Use ECDSA keys for SSH authentication in ws-proxy. Update routes.go to generate and marshal ECDSA keys instead of Ed25519 keys.

Related Issue(s)

Fixes #

How to test

  1. start a workspace in preview env
  2. using this version vscode desktop extension use http create key endpoint gitpod-vscode-desktop#101
  3. it should successfully connect with this preview env
  4. you can test with dogfood, it should fail to connect via local SSH, and fallback to the SSH gateway (check the URL if it container vss, vsi)
  5. also test with Jetbrains IDE, make sure it still work like before

Documentation

Preview status

Gitpod was successfully deployed to your preview environment.

Build Options

Build
  • /werft with-werft
    Run the build with werft instead of GHA
  • leeway-no-cache
  • /werft no-test
    Run Leeway with --dont-test
Publish
  • /werft publish-to-npm
  • /werft publish-to-jb-marketplace
Installer
  • analytics=segment
  • with-dedicated-emulation
  • workspace-feature-flags
    Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-gce-vm
    If enabled this will create the environment on GCE infra
  • /werft preemptible
    Saves cost. Untick this only if you're really sure you need a non-preemtible machine.
  • with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh. If enabled, with-preview and with-large-vm will be enabled.
  • with-monitoring

/hold

@iQQBot
Copy link
Contributor Author

iQQBot commented Dec 7, 2023

I tested with both case

image image

Copy link
Contributor

@kylos101 kylos101 left a comment

Choose a reason for hiding this comment

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

I asserted that SSH CA is not broke, and still works as expected. I did not test various IDE scenarios shared here, as I'm not sure how.

@jeanp413 can you help review? I've added you as a reviewer.

For the future, @iQQBot can you share with me via Slack how we typically setup?

  1. JetBrains IDE with a related license Gitpodders use
  2. How to setup a branch version of extension for VS Code Desktop

components/ws-proxy/pkg/proxy/routes.go Show resolved Hide resolved
@kylos101 kylos101 requested review from kylos101 and removed request for jeanp413 December 8, 2023 14:29
@kylos101
Copy link
Contributor

kylos101 commented Dec 8, 2023

you can test with dogfood, it should fail to connect via local SSH, and fallback to the SSH gateway (check the URL if it container vss, vsi)

This test is failing, it is frozen at:

2023-12-08 18:42:16.949 [info] Going to use public API
2023-12-08 18:42:18.187 [info] connecting with local ssh destination {"domain":"vss.dogfood.gitpod.cloud"}

and fallback to the SSH gateway (check the URL if it container vss, vsi)

How long does falling back take? 🤔 It seems like the fallback isn't kicking in for when testing on dogfood.

@kylos101
Copy link
Contributor

kylos101 commented Dec 8, 2023

  • JetBrains IDE with a related license Gitpodders use
  • How to setup a branch version of extension for VS Code Desktop

I added and updated documentation for Experience team in Notion for both things, and pinged you as a reviewer ✅

@iQQBot
Copy link
Contributor Author

iQQBot commented Dec 9, 2023

How long does falling back take? 🤔 It seems like the fallback isn't kicking in for when testing on dogfood.

Whether it can fallback is not the key point, the key point is that this PR can fix this situation.

@kylos101
Copy link
Contributor

How long does falling back take? 🤔 It seems like the fallback isn't kicking in for when testing on dogfood.

Whether it can fallback is not the key point, the key point is that this PR can fix this situation.

@iQQBot and I spoke about this particular test ☝️, it is only necessary to land gitpod-io/gitpod-vscode-desktop#101, which is not needed now. In other words, this test is not on the critical path / not a blocker for this PR.

@iQQBot I will do a brief test in preview with the current vscode extension. So long as it works fine, I'll approve so we can land this PR.

Copy link
Contributor

@kylos101 kylos101 left a comment

Choose a reason for hiding this comment

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

VS Code desktop with extension v0.0.163 still works. 🥳

@iQQBot
Copy link
Contributor Author

iQQBot commented Dec 11, 2023

/unhold

@roboquat roboquat merged commit 9759f00 into main Dec 11, 2023
60 of 64 checks passed
@roboquat roboquat deleted the pd/fake-api-use-ecdsa-key branch December 11, 2023 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants