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

Trusted extensions #2717

Merged
merged 17 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
68a5f27
Update devfile.yaml
vitaliy-guliy Apr 8, 2024
084085e
docs: explain how to define VS Code trusted extensions
vitaliy-guliy Apr 8, 2024
718e46c
docs: explain how to define VS Code trusted extensions
vitaliy-guliy Apr 8, 2024
7b352dd
Update modules/administration-guide/pages/trusted-extensions-for-micr…
vitaliy-guliy Apr 8, 2024
fd315a7
Update modules/administration-guide/pages/trusted-extensions-for-micr…
vitaliy-guliy Apr 8, 2024
383229c
Update modules/administration-guide/pages/trusted-extensions-for-micr…
vitaliy-guliy Apr 8, 2024
984c31b
Update modules/administration-guide/pages/trusted-extensions-for-micr…
vitaliy-guliy Apr 8, 2024
5103810
Update modules/administration-guide/pages/trusted-extensions-for-micr…
vitaliy-guliy Apr 8, 2024
3eff38c
Update modules/administration-guide/pages/trusted-extensions-for-micr…
vitaliy-guliy Apr 8, 2024
7e36762
docs: explain how to define VS Code trusted extensions
vitaliy-guliy Apr 9, 2024
503ff28
docs: explain how to define VS Code trusted extensions
vitaliy-guliy Apr 9, 2024
2de0560
Update modules/administration-guide/pages/trusted-extensions-for-micr…
vitaliy-guliy Apr 9, 2024
5a68f97
Update modules/administration-guide/pages/trusted-extensions-for-micr…
vitaliy-guliy Apr 9, 2024
5ac77f9
Update modules/administration-guide/pages/trusted-extensions-for-micr…
vitaliy-guliy Apr 9, 2024
bc113c1
Update modules/administration-guide/pages/trusted-extensions-for-micr…
vitaliy-guliy Apr 9, 2024
48affee
Update modules/administration-guide/pages/trusted-extensions-for-micr…
vitaliy-guliy Apr 9, 2024
e3165c8
Update modules/administration-guide/pages/trusted-extensions-for-micr…
vitaliy-guliy Apr 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions devfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
schemaVersion: 2.2.2
metadata:
name: che-docs
attributes:
controller.devfile.io/storage-type: ephemeral
vitaliy-guliy marked this conversation as resolved.
Show resolved Hide resolved
components:
- name: tools
container:
Expand Down
1 change: 1 addition & 0 deletions modules/administration-guide/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
** xref:configuring-fuse.adoc[]
* xref:managing-ide-extensions.adoc[]
** xref:extensions-for-microsoft-visual-studio-code-open-source.adoc[]
** xref:trusted-extensions-for-microsoft-visual-studio-code.adoc[]
* xref:managing-workloads-using-the-che-server-api.adoc[]
* xref:upgrading-che.adoc[]
** xref:upgrading-the-chectl-management-tool.adoc[]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
:_content-type: PROCEDURE
:description: Configure trusted extensions for Microsoft Visual Studio Code
:keywords: extensions, vs-code, vsx, open-vsx, marketplace
:navtitle: Configure trusted extensions for Microsoft Visual Studio Code

[id="visual-studio-code-trusted-extensions"]
= Configure trusted extensions for Microsoft Visual Studio Code


You can use the `trustedExtensionAuthAccess` field in the `product.json` file of Microsoft Visual Studio Code to specify which extensions are trusted to access authentication tokens.
[source,json]
----
"trustedExtensionAuthAccess": [
"<publisher1>.<extension1>",
"<publisher2>.<extension2>"
]
----

This is particularly useful when you have extensions that require access to services such as GitHub, Microsoft, or any other service that requires OAuth. By adding the extension IDs to this field, you are granting them the permission to access these tokens.

vitaliy-guliy marked this conversation as resolved.
Show resolved Hide resolved
You can define the variable in the devfile or in the ConfigMap. Pick the option that better suits your needs.
With a ConfigMap, the variable will be propagated on all your workspaces and you do not need to add the variable to each the devfile you are using.
[WARNING]
====
Use the `trustedExtensionAuthAccess` field with caution as it could potentially lead to security risks if misused. Give access only to trusted extensions.
====

.Procedure
[IMPORTANT]
====
Since the Microsoft Visual Studio Code editor is bundled within `che-code` image, you can only change the `product.json` file when the workspace is started up.
====


. Define the __VSCODE_TRUSTED_EXTENSIONS__ environment variable. Choose between defining the variable in devfile.yaml or mounting a ConfigMap with the variable instead.
.. Define the __VSCODE_TRUSTED_EXTENSIONS__ environment variable in devfile.yaml:
+
====
[source,yaml]
----
env:
- name: VSCODE_TRUSTED_EXTENSIONS
value: "<publisher1>.<extension1>,<publisher2>.<extension2>"
----
====

.. Mount a ConfigMap with __VSCODE_TRUSTED_EXTENSIONS__ environment variable:
+
====
[source,yaml]
----
kind: ConfigMap
apiVersion: v1
metadata:
name: trusted-extensions
labels:
controller.devfile.io/mount-to-devworkspace: 'true'
controller.devfile.io/watch-configmap: 'true'
annotations:
controller.devfile.io/mount-as: env
data:
VSCODE_TRUSTED_EXTENSIONS: '<publisher1>.<extension1>,<publisher2>.<extension2>'
----
====

.Verification

* The value of the variable will be parsed on the workspace startup and the corresponding `trustedExtensionAuthAccess` section will be added to the `product.json`.
Loading