src/vs/platform/encryption/common/encryptionService.ts

71 LOC · 63 covered · 8 uncovered · 2 ranges · 1161 concepts · 1 introducers · 591 tests

File neighbourhood

The centred file is linked to every concept that introduces one of its ranges, every test that runs code from the file, and the gray connector concepts standing between those tests and the file's own introducer concepts. Undirected links join concepts to every file where they introduce source and concepts to the tests they introduce; arrows show specialization between the displayed concepts and bridge only concepts omitted from this view. Concept colors match the source ranges below; connector concepts have no source color and are shown in gray.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the file

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the related-file, concept, and source links on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the related-file, concept, and source links on this page while the interactive map is unavailable.

1 > /*--------------------------------------------------------------------------------------------- secrets.ts ×15
2 > * Copyright (c) Microsoft Corporation. All rights reserved.
3 > * Licensed under the MIT License. See License.txt in the project root for license information.
4 > *--------------------------------------------------------------------------------------------*/
5 >
6 > import { createDecorator } from '../../instantiation/common/instantiation.js';
7 >
8 > export const IEncryptionService = createDecorator<IEncryptionService>('encryptionService');
9 > export interface IEncryptionService extends ICommonEncryptionService {
10 > setUsePlainTextEncryption(): Promise<void>;
11 > getKeyStorageProvider(): Promise<KnownStorageProvider>;
12 > }
13 >
14 > export const IEncryptionMainService = createDecorator<IEncryptionMainService>('encryptionMainService');
15 > export interface IEncryptionMainService extends IEncryptionService { }
16 >
17 > export interface ICommonEncryptionService {
18 >
19 > readonly _serviceBrand: undefined;
20 >
21 > encrypt(value: string): Promise<string>;
22 >
23 > decrypt(value: string): Promise<string>;
24 >
25 > isEncryptionAvailable(): Promise<boolean>;
26 > }
27 >
28 > // The values provided to the `password-store` command line switch.
29 > // Notice that they are not the same as the values returned by
30 > // `getSelectedStorageBackend` in the `safeStorage` API.
31 > export const enum PasswordStoreCLIOption {
32 > kwallet = 'kwallet',
33 > kwallet5 = 'kwallet5',
34 > gnomeLibsecret = 'gnome-libsecret',
35 > basic = 'basic'
36 > }
37 >
38 > // The values returned by `getSelectedStorageBackend` in the `safeStorage` API.
39 > export const enum KnownStorageProvider {
40 > unknown = 'unknown',
41 > basicText = 'basic_text',
42 >
43 > // Linux
44 > gnomeAny = 'gnome_any',
45 > gnomeLibsecret = 'gnome_libsecret',
46 > gnomeKeyring = 'gnome_keyring',
47 > kwallet = 'kwallet',
48 > kwallet5 = 'kwallet5',
49 > kwallet6 = 'kwallet6',
50 >
51 > // The rest of these are not returned by `getSelectedStorageBackend`
52 > // but these were added for platform completeness.
53 >
54 > // Windows
55 > dplib = 'dpapi',
56 >
57 > // macOS
58 > keychainAccess = 'keychain_access',
59 > }
60 >
61 > export function isKwallet(backend: string): boolean {
62 return backend === KnownStorageProvider.kwallet
63 || backend === KnownStorageProvider.kwallet5
64 || backend === KnownStorageProvider.kwallet6;
65 }
67 > export function isGnome(backend: string): boolean {
68 return backend === KnownStorageProvider.gnomeAny
69 || backend === KnownStorageProvider.gnomeLibsecret
70 || backend === KnownStorageProvider.gnomeKeyring;
71 }