*/
export function secretStorageKey(key: string): string {
}
/**
Frontier kind: Code frontier
unlabeled · c_208a3c58ca15
13 tests · 13046 LOC · 52 files · introduces 0 tests · 72 LOC · 1 file
The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.
Introduced files, introduced tests, and structurally relevant concept specialization
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 native relationship evidence on this page.
Graph controls are ready.
Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.
Every exact file and test below is linked only from the concept that introduces it.
mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/secrets/test/common/secrets.test|title=secrets BaseSecretStorageService useInMemoryStorage=false, encryption not available set and get|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/secrets/test/common/secrets.test|title=secrets BaseSecretStorageService useInMemoryStorage=true set and get|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/secrets/test/common/secrets.test|title=secrets BaseSecretStorageService useInMemoryStorage=false, encryption not available type|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/secrets/test/common/secrets.test|title=secrets BaseSecretStorageService useInMemoryStorage=true type|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/lifecycle.test|title=Lifecycle Action bar has broken accessibility #100273|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/lifecycle.test|title=Lifecycle dispose disposable array|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/languageStatus/test/common/languageStatusDedupe.test|title=LanguageStatus - Dedicated Entry Deduplication creates new entry when none exists|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/languageStatus/test/common/languageStatusDedupe.test|title=LanguageStatus - Dedicated Entry Deduplication duplicate IDs with existing entry - fixed version reuses existing|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/languageStatus/test/common/languageStatusDedupe.test|title=LanguageStatus - Dedicated Entry Deduplication duplicate status IDs - buggy version leaks entry|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/languageStatus/test/common/languageStatusDedupe.test|title=LanguageStatus - Dedicated Entry Deduplication duplicate status IDs - fixed version reuses entry from current update|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/languageStatus/test/common/languageStatusDedupe.test|title=LanguageStatus - Dedicated Entry Deduplication mixed unique and duplicate IDs|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/languageStatus/test/common/languageStatusDedupe.test|title=LanguageStatus - Dedicated Entry Deduplication reuses existing entry from previous update|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/charCode.test|title=CharCode has good values|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/path.test|title=Paths (Node Implementation) path|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/uri.test|title=URI File paths containing apostrophes break URI parsing and cannot be opened #276075|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/uri.test|title=URI URI#file, win-speciale|occurrence=1Every collected test enters the hierarchy at exactly one concept.
No tests are introduced at this concept. Its intent tests are introduced by other concepts.
Every collected source range enters the hierarchy at exactly one concept.
1 file ranked by introduced lines: 72 introduced LOC across 15 ranges. Expand a file to inspect source; the > gutter marks introduced lines.
*/
export function secretStorageKey(key: string): string {
}
/**
* @param logService Optional logger for trace output.
*/
key: string,
value: string,
storageSet: (fullKey: string, encrypted: string) => void,
encrypt: (value: string) => Promise<string>,
logService?: ILogService,
): Promise<void> {
logService?.trace('[secrets] encrypting secret for key:', key);
const encrypted = await encrypt(value);
const fullKey = secretStorageKey(key);
logService?.trace('[secrets] storing encrypted secret for key:', fullKey);
storageSet(fullKey, encrypted);
logService?.trace('[secrets] stored encrypted secret for key:', fullKey);
}
/**
constructor(
@IStorageService private _storageService: IStorageService,
@IEncryptionService protected _encryptionService: IEncryptionService,
@ILogService protected readonly _logService: ILogService,
) {
super();
}
protected useSharedStorage(key: string): boolean {
return isWindows && CROSS_APP_SHARED_SECRET_KEYS.includes(key);
}
/**
* @Note initialize must be called first so that this can be resolved properly
* otherwise it will return 'unknown'.
*/
get type() {
return this._type;
}
private _lazyStorageService: Lazy<Promise<IStorageService>> = new Lazy(() => this.initialize());
protected get resolvedStorageService() {
}
get(key: string): Promise<string | undefined> {
set(key: string, value: string): Promise<void> {
const storageService = await this.resolvedStorageService;
try {
await writeEncryptedSecret(
key,
value,
(fullKey, encrypted) => this.setValueInStorage(key, fullKey, encrypted, storageService),
// If the storage service is in-memory, we don't need to encrypt
this._type === 'in-memory' ? (v) => Promise.resolve(v) : (v) => this._encryptionService.encrypt(v),
this._logService,
);
} catch (e) {
this._logService.error(e);
throw e;
}
}
delete(key: string): Promise<void> {
private setValueInStorage(key: string, fullKey: string, value: string, storageService: IStorageService): void {
this._logService.trace(`[SecretStorageService] Setting value for cross-app shared secret: ${fullKey}`);
storageService.store(fullKey, value, StorageScope.APPLICATION_SHARED, StorageTarget.MACHINE);
}
storageService.store(fullKey, value, StorageScope.APPLICATION, StorageTarget.MACHINE);
private async initialize(): Promise<IStorageService> {
if (!this._useInMemoryStorage && await this._encryptionService.isEncryptionAvailable()) {
this._logService.trace(`[SecretStorageService] Encryption is available, using persisted storage`);
this._type = 'persisted';
storageService = this._storageService;
// If we already have an in-memory storage service, we don't need to recreate it
if (this._type === 'in-memory') {
storageService = this._register(new InMemoryStorageService());
}
this._onDidChangeValueDisposable.clear();
this._onDidChangeValueDisposable.add(Event.any<IStorageValueChangeEvent>(
storageService.onDidChangeValue(StorageScope.APPLICATION, undefined, this._onDidChangeValueDisposable),
storageService.onDidChangeValue(StorageScope.APPLICATION_SHARED, undefined, this._onDidChangeValueDisposable),
)(e => {
this.onDidChangeValue(e.key);
}));
return storageService;
}
protected reinitialize(): void {
private onDidChangeValue(key: string): void {
return;
}
const secretKey = key.slice(SECRET_STORAGE_PREFIX.length);
this._logService.trace(`[SecretStorageService] Notifying change in value for secret: ${secretKey}`);
this.onDidChangeSecretEmitter.fire(secretKey);
}
}