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

fix: extension secrets should not be lost when workspace restart #340

Merged
merged 33 commits into from
May 16, 2024

Conversation

vitaliy-guliy
Copy link
Contributor

@vitaliy-guliy vitaliy-guliy commented Mar 28, 2024

What does this PR do?

Allows to keep encrypted extension secrets in the browser local storage.

Screenshot from 2024-05-15 09-53-39

Launcher output

# Injecting server public key to che-code...
  > foud key file /etc/ssh/default-1611150837256.pub
  > out/vs/code/browser/workbench/workbench.js has been updated

What issues does this PR fix?

eclipse-che/che#22837

How to test this PR?

  1. Create a workspace with
    https://github.com/vitaliy-guliy/vscode-test-extension/tree/persisting-secrets?che-editor=https://gist.githubusercontent.com/vitaliy-guliy/4fedeef3dbf8e902af94240780c442e6/raw/f08e91485b8529c6761b73f375fccde8d62ae94f/editor.yaml&new

  2. Build test extension from sources or download the binary from https://github.com/vitaliy-guliy/vscode-test-extension/releases/tag/0.0.2

  3. Go to extensions view, install the extension from .vsix file

  4. Run Secrets: Add secret command and add the secret entering any value

  5. Delete the workspace and create it again with the link above, or just restart the workspace (chose what do you prefer). If you recreated workspace, it needs to install test extension again.

  6. Run Secrets: Get Secret command. You should get the value entered before.

You can create any workspace using che-code image provided by this pull request and experiment with any extension you want. For instance, it is possible to install sonarlint extension, open extension settings, configure it and then restart the workspace. All the settings should be saved.

Does this PR contain changes that override default upstream Code-OSS behavior?

  • the PR contains changes in the code folder (you can skip it if your changes are placed in a che extension )
  • the corresponding items were added to the CHANGELOG.md file
  • rules for automatic git rebase were added to the .rebase folder

Signed-off-by: vitaliy-guliy <[email protected]>
Copy link

github-actions bot commented Mar 28, 2024

Click here to review and test in web IDE: Contribute

Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-340-dev-amd64

Copy link

Pull Request Che-Code image published:
👉 quay.io/che-incubator-pull-requests/che-code:pr-340-amd64

Signed-off-by: vitaliy-guliy <[email protected]>
Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-340-dev-amd64

Copy link

Pull Request Che-Code image published:
👉 quay.io/che-incubator-pull-requests/che-code:pr-340-amd64

Signed-off-by: vitaliy-guliy <[email protected]>
Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-340-dev-amd64

Signed-off-by: vitaliy-guliy <[email protected]>
Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-340-dev-amd64

Copy link

Pull Request Che-Code image published:
👉 quay.io/che-incubator-pull-requests/che-code:pr-340-amd64

Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-340-dev-amd64

Copy link

Pull Request Che-Code image published:
👉 quay.io/che-incubator-pull-requests/che-code:pr-340-amd64

Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-340-dev-amd64

Copy link

Pull Request Che-Code image published:
👉 quay.io/che-incubator-pull-requests/che-code:pr-340-amd64

Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-340-dev-amd64

Copy link

Pull Request Che-Code image published:
👉 quay.io/che-incubator-pull-requests/che-code:pr-340-amd64

Signed-off-by: vitaliy-guliy <[email protected]>
Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-340-dev-amd64

Copy link

Pull Request Che-Code image published:
👉 quay.io/che-incubator-pull-requests/che-code:pr-340-amd64

Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-340-dev-amd64

Copy link

Pull Request Che-Code image published:
👉 quay.io/che-incubator-pull-requests/che-code:pr-340-amd64

Signed-off-by: vitaliy-guliy <[email protected]>
Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-340-dev-amd64

Signed-off-by: vitaliy-guliy <[email protected]>
@ibuziuk ibuziuk requested a review from svor May 15, 2024 13:07
Copy link
Member

@azatsarynnyy azatsarynnyy left a comment

Choose a reason for hiding this comment

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

@vitaliy-guliy thanks for providing the test projects and steps for testing the PR.
I tested the PR following the suggested instructions. In a new workspace, I was able to get the secret, stored in another workspace.
👍

Copy link
Contributor

@svor svor left a comment

Choose a reason for hiding this comment

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

Works good with the Ansible extension

screencast-bpconcjcammlapcogcnnelfmaeghhagj-2024.05.15-19_27_00.mp4

launcher/src/local-storage-key-provider.ts Outdated Show resolved Hide resolved
launcher/src/local-storage-key-provider.ts Outdated Show resolved Hide resolved
launcher/src/local-storage-key-provider.ts Outdated Show resolved Hide resolved
launcher/src/local-storage-key-provider.ts Show resolved Hide resolved
launcher/src/main.ts Outdated Show resolved Hide resolved
launcher/tests/local-storage-key-provider.spec.ts Outdated Show resolved Hide resolved
launcher/tests/main.spec.ts Outdated Show resolved Hide resolved
launcher/tests/main.spec.ts Outdated Show resolved Hide resolved
launcher/tests/main.spec.ts Outdated Show resolved Hide resolved
launcher/tests/main.spec.ts Outdated Show resolved Hide resolved
Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-340-dev-amd64

Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-340-dev-amd64

Co-authored-by: Valerii Svydenko <[email protected]>
Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-340-dev-amd64

Co-authored-by: Valerii Svydenko <[email protected]>
Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-340-dev-amd64

2 similar comments
Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-340-dev-amd64

Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-340-dev-amd64

Copy link

Pull Request Che-Code image published:
👉 quay.io/che-incubator-pull-requests/che-code:pr-340-amd64

@vitaliy-guliy vitaliy-guliy merged commit a553e5c into main May 16, 2024
7 checks passed
@vitaliy-guliy vitaliy-guliy deleted the keep-extension-secrets branch May 16, 2024 20:32
@musienko-maxim
Copy link

Verification completed from my side

@RomanNikitenko RomanNikitenko mentioned this pull request Oct 4, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
made-with-che Changes made with Che-Code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants