From e992d5c8c83f805c5d4482aaec839ba3d4b5b433 Mon Sep 17 00:00:00 2001 From: Weida Hong Date: Tue, 4 Feb 2025 14:00:38 +0800 Subject: [PATCH 1/4] feat: simplify wording for user messages - Extract UI message box logic from core part - Remove message for key changed related event - Replace some long message with two existing, shorter message - Avoid double confirm for cache delete operation - No need to translate error for pre-condition violation --- l10n/bundle.l10n.zh-cn.json | 11 ++----- package.nls.json | 2 +- package.nls.zh-cn.json | 2 +- src/extension.ts | 50 +++++++++++++++++++++---------- src/manager.ts | 60 ++++++++++++++++++++++--------------- src/message.ts | 11 ++----- 6 files changed, 76 insertions(+), 60 deletions(-) diff --git a/l10n/bundle.l10n.zh-cn.json b/l10n/bundle.l10n.zh-cn.json index 24a4c53..65d22af 100644 --- a/l10n/bundle.l10n.zh-cn.json +++ b/l10n/bundle.l10n.zh-cn.json @@ -4,12 +4,10 @@ "Don't ask again": "不再询问", "OK": "好的", "Open setting": "打开设置", - ", ": "、", "Unable to retrieve any key in current folder.": "无法检索当前文件夹中的任何密钥。", "Input the passphrase for the signing key": "输入密钥密码", - "Input the passphrase for the signing key, passphrase cache enabled": "输入密钥密码,密码安全存储功能已开启", "For the key associated with {0}": "该密钥关联用户:{0}", - "Key unlocked, and the passphrase is stored in the SecretStorage of VSCode.": "密钥已解锁,密码已被安全存储在 VSCode 的机密存储区中。", + "The passphrase is stored in the SecretStorage of VSCode.": "密码已被安全存储在 VSCode 的机密存储区中。", "Key unlocked.": "密钥已解锁。", "Failed to unlock: {0}": "密钥解锁失败:{0}", "There is no cached passphrase for your current key.": "您的当前密钥的密码并未被存储", @@ -20,14 +18,9 @@ "Current key": "当前密钥", "Rest keys": "其他密钥", "List of keys with stored passphrases:": "已存储密码的密钥列表:", - "Do you really want to clear all your cached passphrase? This action CANNOT be reverted.": "您确认真的要删除您存储中的全部密码吗?该操作无法被撤销。", "All Your cached passphrase has been cleared.": "您的全部密码已被从机密存储区中删除。", - "Key changed, and unlocked automatically using the previous-used stored passphrase.": "密钥已变更,并被通过机密存储区中的关联密码自动解锁。", - "Key re-locked, and unlocked automatically using the previous-used stored passphrase.": "密钥被自动锁定,现已被通过机密存储区中的关联密码自动解锁。", "Key unlocked automatically using the previous-used stored passphrase.": "密钥已被通过机密存储区中的关联密码自动解锁。", - "Key changed, but the previous-used stored passphrase for this key is unable to unlock the key, so the passphrase has been deleted and you need to unlock the key manually.": "密钥已变更,但机密存储区中的关联密码无法解锁该密钥,故该密码已被删除,您需要手动解锁该密钥。", - "Key re-locked automatically, but the previous-used stored passphrase is unable to unlock the key, so the passphrase has been deleted and you need to unlock the key manually.": "密钥被自动锁定,但机密存储区中的关联密码无法解锁该密钥,故该密码已被删除,您需要手动解锁该密钥", - "The previous-used stored passphrase is unable to unlock current key, so the passphrase has been deleted and you need to unlock the key manually.": "机密存储区中的关联密码无法解锁当前密钥,故该密码已被删除,您需要手动解锁该密钥。", + "The previous-used stored passphrase is unable to unlock current key.": "机密存储区中的关联密码无法解锁当前密钥。", "Key changed.": "密钥已变更。", "Key re-locked.": "密钥被自动锁定。", "No active folder": "当前无活动中的文件夹。", diff --git a/package.nls.json b/package.nls.json index eafc4e8..56a29e8 100644 --- a/package.nls.json +++ b/package.nls.json @@ -5,7 +5,7 @@ "gpgIndicator.l10n.commands.listPassphraseCache": "List your passphrase cache", "gpgIndicator.l10n.configuration.statusRefreshInterval": "Background refresh interval (in seconds) for key status.", "gpgIndicator.l10n.configuration.outputLogLevel": "Log level for extension log output.", - "gpgIndicator.l10n.configuration.enableSecurelyPassphraseCache": "Specifies whether to use the `SecretStorage` of VSCode to store your passphrase or not. [Read more](https://github.com/wdhongtw/vscode-gpg-indicator#passphrase-cache).\n\n**WARNING**: Turn off this option will clear all your passphrase cache, and cannot be reverted.", + "gpgIndicator.l10n.configuration.enableSecurelyPassphraseCache": "Specifies whether to use the `SecretStorage` of VSCode to store your passphrase or not. [Read more](https://github.com/wdhongtw/vscode-gpg-indicator#passphrase-cache).", "gpgIndicator.l10n.configuration.statusStyle": "Specifies what to show about the current key in the status bar element", "gpgIndicator.l10n.configuration.statusStyle.enumDescriptions.fingerprintWithUserId": "Show both fingerprint and user id (if any), if no user id found, show fingerprint only.\n\nExample: `0123456789ABCDEF - Example User `", "gpgIndicator.l10n.configuration.statusStyle.enumDescriptions.fingerprint": "Show fingerprint only.\n\nExample: `0123456789ABCDEF`", diff --git a/package.nls.zh-cn.json b/package.nls.zh-cn.json index 944a37d..e699790 100644 --- a/package.nls.zh-cn.json +++ b/package.nls.zh-cn.json @@ -5,7 +5,7 @@ "gpgIndicator.l10n.commands.listPassphraseCache": "列举存有密码的密钥", "gpgIndicator.l10n.configuration.statusRefreshInterval": "后台刷新间隔,以秒为单位。", "gpgIndicator.l10n.configuration.outputLogLevel": "扩展日志输出等级,低于该等级的日志将不会被输出。", - "gpgIndicator.l10n.configuration.enableSecurelyPassphraseCache": "启用密钥密码的机密存储区存储功能,[查看详情](https://github.com/wdhongtw/vscode-gpg-indicator#passphrase-cache)。\n\n**警告**:禁用该功能会删除所有已存储的密钥,且无法撤销。", + "gpgIndicator.l10n.configuration.enableSecurelyPassphraseCache": "启用密钥密码的机密存储区存储功能,[查看详情](https://github.com/wdhongtw/vscode-gpg-indicator#passphrase-cache)。", "gpgIndicator.l10n.configuration.statusStyle": "选择状态栏按钮显示的密钥信息内容。", "gpgIndicator.l10n.configuration.statusStyle.enumDescriptions.fingerprintWithUserId": "同时显示密钥指纹和关联用户信息,若无关联用户信息则只显示密钥指纹。\n\n例如:`0123456789ABCDEF - Example User `", "gpgIndicator.l10n.configuration.statusStyle.enumDescriptions.fingerprint": "只显示密钥指纹。\n\n例如:`0123456789ABCDEF`", diff --git a/src/extension.ts b/src/extension.ts index 10f2a4e..d9c01b1 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -6,6 +6,7 @@ import * as util from 'util'; import * as git from './indicator/git'; import * as gpg from './indicator/gpg'; import * as locker from './indicator/locker'; +import * as core from './manager'; import { Logger } from "./manager"; import KeyStatusManager from "./manager"; import { Storage, KeyStatusEvent } from "./manager"; @@ -77,6 +78,27 @@ async function generateKeyList(secretStorage: PassphraseStorage, keyStatusManage return items; } +/** MessageEventReceiver transform event into VSCode information message. */ +class MessageEventReceiver implements core.EventReceiver { + + async onEvent(event: core.Event): Promise { + const message: string = (() => { + switch (event) { + case core.Event.StoredPassphraseUnlockSucceed: + return vscode.l10n.t(m['keyAutomaticallyUnlocked']); + case core.Event.StoredPassphraseUnlockFailed: + return vscode.l10n.t(m['keyAutomaticallyUnlockFailed']); + case core.Event.StoredPassphraseBeDeleted: + return vscode.l10n.t(m['passphraseDeleted']); + case core.Event.LockedStateEntered: + return vscode.l10n.t(m['keyRelocked']); + } + })(); + + await vscode.window.showInformationMessage(message); + } +} + export async function activate(context: vscode.ExtensionContext) { const masterKey = await initializeMasterKey(context.secrets); @@ -99,6 +121,7 @@ export async function activate(context: vscode.ExtensionContext) { new git.CliGit(), new gpg.CliGpg(logger), secretStorage, + new MessageEventReceiver(), configuration.get('enablePassphraseCache', false), vscode.workspace.isTrusted, os.homedir(), @@ -118,9 +141,7 @@ export async function activate(context: vscode.ExtensionContext) { return; } const passphrase = await vscode.window.showInputBox({ - prompt: keyStatusManager.enablePassphraseCache - ? vscode.l10n.t(m['passphraseInputPromptTitleWhenSecurelyPassphraseCacheEnabled']) - : vscode.l10n.t(m['passphraseInputPromptTitle']), + prompt: vscode.l10n.t(m['passphraseInputPromptTitle']), password: true, placeHolder: currentKey.userId ? vscode.l10n.t(m['keyDescriptionWithUserId'], currentKey.userId) @@ -138,11 +159,10 @@ export async function activate(context: vscode.ExtensionContext) { if (keyStatusManager.enablePassphraseCache) { await secretStorage.set(currentKey.fingerprint, passphrase); - vscode.window.showInformationMessage(vscode.l10n.t(m['keyUnlockedWithCachedPassphrase'])); - } else { - vscode.window.showInformationMessage(vscode.l10n.t(m['keyUnlocked'])); - await introduceCacheFeature(context); + vscode.window.showInformationMessage(vscode.l10n.t(m['passphraseStored'])); } + vscode.window.showInformationMessage(vscode.l10n.t(m['keyUnlocked'])); + await introduceCacheFeature(context); })); keyStatusItem.tooltip = 'Unlock this key'; keyStatusItem.command = commandId; @@ -186,14 +206,9 @@ export async function activate(context: vscode.ExtensionContext) { vscode.window.showInformationMessage(vscode.l10n.t(m['noCachedPassphrase'])); return; } - if ((await vscode.window.showInformationMessage( - vscode.l10n.t(m["passphraseClearanceConfirm"]), - { modal: true }, - { title: actions.YES }, - { title: actions.NO, isCloseAffordance: true }, - ))?.title !== actions.YES) { - return; - } + + // We do not confirm again whether user really want to delete, just trust our user. + await Promise.all([...secretStorage].map((key) => secretStorage.delete(key))); vscode.window.showInformationMessage(vscode.l10n.t(m['passphraseCleared'])); })); @@ -299,6 +314,9 @@ export async function deactivate() { async function introduceCacheFeature(context: vscode.ExtensionContext) { const configuration = vscode.workspace.getConfiguration('gpgIndicator'); + if (configuration.get('enablePassphraseCache', false)) { + return; + } if (await context.globalState.get("user:is-cache-notice-read")) { return; @@ -315,7 +333,7 @@ async function introduceCacheFeature(context: vscode.ExtensionContext) { } await context.globalState.update("user:is-cache-notice-read", true); if (result === actions.YES) { - configuration.update("enablePassphraseCache", true, true); + await configuration.update("enablePassphraseCache", true, true); } let postMessage: string; diff --git a/src/manager.ts b/src/manager.ts index 07bff60..baea70b 100644 --- a/src/manager.ts +++ b/src/manager.ts @@ -1,8 +1,5 @@ -import * as vscode from 'vscode'; - import * as process from './indicator/process'; import { Mutex } from "./indicator/locker"; -import { m } from "./message"; /** * Logger is a sample interface for basic logging ability. @@ -64,19 +61,13 @@ export default class KeyStatusManager { private git: GitAdapter, private gpg: GpgAdapter, private secretStorage: Storage, + private receiver: EventReceiver, public enablePassphraseCache: boolean, private isWorkspaceTrusted: boolean, private defaultFolder: string, ) { } - private show(isChanged: boolean, changedMsg: string, defaultMsg: string) { - vscode.window.showInformationMessage(isChanged - ? vscode.l10n.t(changedMsg) - : vscode.l10n.t(defaultMsg), - ); - } - /** Trigger key status update once, coroutine-safe is ensured. */ async syncStatus(): Promise { await this.syncStatusLock.with(async () => { @@ -144,22 +135,15 @@ export default class KeyStatusManager { try { await this.unlockCurrentKey(passphrase); - if (isUnlockedPrev) { - this.show(isChanged, m['keyChangedAndAutomaticallyUnlocked'], m['keyRelockedAndAutomaticallyUnlocked']); - } else { - this.show(isChanged, m['keyChangedAndAutomaticallyUnlocked'], m['keyAutomaticallyUnlocked']); - } + await this.receiver.onEvent(Event.StoredPassphraseUnlockSucceed); } catch (err) { if (!(err instanceof Error)) { throw err; } this.logger.error(`Cannot unlock the key with the cached passphrase: ${err.message}`); await this.secretStorage.delete(keyInfo.fingerprint); - if (isUnlockedPrev) { - this.show(isChanged, m['keyChangedButAutomaticallyUnlockFailed'], m['keyRelockedButAutomaticallyUnlockFailed']); - } else { - this.show(isChanged, m['keyChangedButAutomaticallyUnlockFailed'], m['keyAutomaticallyUnlockFailed']); - } + await this.receiver.onEvent(Event.StoredPassphraseBeDeleted); + await this.receiver.onEvent(Event.StoredPassphraseUnlockFailed); } return await this.gpg.isKeyUnlocked(keyInfo.keygrip); @@ -173,8 +157,11 @@ export default class KeyStatusManager { */ private async showInfoOnly(isChanged: boolean, isUnlockedPrev: boolean, keyInfo: GpgKeyInfo): Promise { const isUnlocked = await this.gpg.isKeyUnlocked(keyInfo.keygrip); - if (isUnlockedPrev && !isUnlocked) { - this.show(isChanged, m['keyChanged'], m['keyRelocked']); + + // We do not notify key changed event, since that it could be noisy potentially. + // For the same key, we only notify the change from "unlocked" to "locked". + if (!isChanged && isUnlockedPrev && !isUnlocked) { + await this.receiver.onEvent(Event.LockedStateEntered); } return isUnlocked; @@ -259,11 +246,13 @@ export default class KeyStatusManager { /** Lock or unlock current key */ async unlockCurrentKey(passphrase: string): Promise { if (this.activateFolder === undefined) { - throw new Error(vscode.l10n.t(m['noActiveFolder'])); + this.logger.error("No activate folder"); + return; } if (this.currentKey === undefined) { - throw new Error(vscode.l10n.t(m['noKeyForCurrentFolder'])); + this.logger.error("No current key"); + return; } if (await this.gpg.isKeyUnlocked(this.currentKey.keygrip)) { @@ -276,6 +265,29 @@ export default class KeyStatusManager { } } +/** Types for events from key manager. */ +export enum Event { + + /** Use stored passphrase to unlock and succeed. */ + StoredPassphraseUnlockSucceed, + + /** Use stored passphrase to unlock buf failed. */ + StoredPassphraseUnlockFailed, + + /** Previously stored passphrase be deleted. */ + StoredPassphraseBeDeleted, + + /** Some key changed into locked state. */ + LockedStateEntered, +}; + +/** Receiver interface for events from key manager. */ +export interface EventReceiver { + + /** Handle given event. */ + onEvent(event: Event): Promise; +} + /** The abstract storage for our application, focusing on string type. */ export interface Storage { diff --git a/src/message.ts b/src/message.ts index d653a6d..445af9d 100644 --- a/src/message.ts +++ b/src/message.ts @@ -4,12 +4,10 @@ export const m = { "actionDoNotAskAgain": "Don't ask again", "actionOK": "OK", "actionOpenSetting": "Open setting", - "separator": ", ", "noKeyInCurrentFolder": "Unable to retrieve any key in current folder.", "passphraseInputPromptTitle": "Input the passphrase for the signing key", - "passphraseInputPromptTitleWhenSecurelyPassphraseCacheEnabled": "Input the passphrase for the signing key, passphrase cache enabled", "keyDescriptionWithUserId": "For the key associated with {0}", - "keyUnlockedWithCachedPassphrase": "Key unlocked, and the passphrase is stored in the SecretStorage of VSCode.", + "passphraseStored": "The passphrase is stored in the SecretStorage of VSCode.", "keyUnlocked": "Key unlocked.", "keyUnlockFailedWithId": "Failed to unlock: {0}", "noCachedPassphraseForCurrentKey": "There is no cached passphrase for your current key.", @@ -20,14 +18,9 @@ export const m = { "currentKey": "Current key", "restKey": "Rest keys", "cachedPassphraseList": "List of keys with stored passphrases:", - "passphraseClearanceConfirm": "Do you really want to clear all your cached passphrase? This action CANNOT be reverted.", "passphraseCleared": "All Your cached passphrase has been cleared.", - "keyChangedAndAutomaticallyUnlocked": "Key changed, and unlocked automatically using the previous-used stored passphrase.", - "keyRelockedAndAutomaticallyUnlocked": "Key re-locked, and unlocked automatically using the previous-used stored passphrase.", "keyAutomaticallyUnlocked": "Key unlocked automatically using the previous-used stored passphrase.", - "keyChangedButAutomaticallyUnlockFailed": "Key changed, but the previous-used stored passphrase for this key is unable to unlock the key, so the passphrase has been deleted and you need to unlock the key manually.", - "keyRelockedButAutomaticallyUnlockFailed": "Key re-locked automatically, but the previous-used stored passphrase is unable to unlock the key, so the passphrase has been deleted and you need to unlock the key manually.", - "keyAutomaticallyUnlockFailed": "The previous-used stored passphrase is unable to unlock current key, so the passphrase has been deleted and you need to unlock the key manually.", + "keyAutomaticallyUnlockFailed": "The previous-used stored passphrase is unable to unlock current key.", "keyChanged": "Key changed.", "keyRelocked": "Key re-locked.", "noActiveFolder": "No active folder", From c90b62ba5d7af583807c1d359c1e711e29bada8f Mon Sep 17 00:00:00 2001 From: Weida Hong Date: Tue, 4 Feb 2025 14:00:45 +0800 Subject: [PATCH 2/4] chore: remove unused import --- src/manager.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/manager.ts b/src/manager.ts index baea70b..c566c8d 100644 --- a/src/manager.ts +++ b/src/manager.ts @@ -1,4 +1,3 @@ -import * as process from './indicator/process'; import { Mutex } from "./indicator/locker"; /** From 34c71c3ee5f0e71199d53964d6ccc28638c9a5bc Mon Sep 17 00:00:00 2001 From: Weida Hong Date: Tue, 4 Feb 2025 14:00:46 +0800 Subject: [PATCH 3/4] refactor: avoid bypassing core module --- src/extension.ts | 2 +- src/manager.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/extension.ts b/src/extension.ts index d9c01b1..bf61654 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -37,7 +37,7 @@ async function generateKeyList(secretStorage: PassphraseStorage, keyStatusManage return false; } const items: vscode.QuickPickItem[] = []; - const keyInfos = await gpg.getKeyInfos(); + const keyInfos = await keyStatusManager.getKeyInfos(); const keyToUser = keyInfos.map(({ userId, fingerprint }): [string, string?] => [fingerprint, userId]); const withUsers = keyToUser.filter((pair): pair is [string, string] => pair[1] !== undefined); const keyList = new Map(withUsers); diff --git a/src/manager.ts b/src/manager.ts index c566c8d..45c6356 100644 --- a/src/manager.ts +++ b/src/manager.ts @@ -262,6 +262,11 @@ export default class KeyStatusManager { this.logger.info(`Try to unlock current key: ${this.currentKey.fingerprint}`); await this.gpg.unlockByKey(this.currentKey.keygrip, passphrase); } + + /** Fetch all available GPG key information in user global scope. */ + async getKeyInfos(): Promise { + return await this.gpg.getKeyInfos(); + } } /** Types for events from key manager. */ From 10971f33dc914db9f67cbedd43d5d0a6897a7e22 Mon Sep 17 00:00:00 2001 From: Weida Hong Date: Tue, 4 Feb 2025 14:00:46 +0800 Subject: [PATCH 4/4] refactor: restructure project logic heirarchy The final part for my DDD project structure. --- src/{indicator => adapter}/assuan.ts | 0 src/{indicator => adapter}/git.spec.ts | 0 src/{indicator => adapter}/git.ts | 2 +- src/{indicator => adapter}/gpg.spec.ts | 0 src/{indicator => adapter}/gpg.ts | 6 +++--- src/{indicator => common}/locker.spec.ts | 0 src/{indicator => common}/locker.ts | 0 src/{indicator => common}/process.ts | 0 src/{indicator => common}/tempfile.ts | 0 src/{manager.ts => core.ts} | 2 +- src/extension.test.ts | 3 ++- src/extension.ts | 14 +++++++------- 12 files changed, 14 insertions(+), 13 deletions(-) rename src/{indicator => adapter}/assuan.ts (100%) rename src/{indicator => adapter}/git.spec.ts (100%) rename src/{indicator => adapter}/git.ts (98%) rename src/{indicator => adapter}/gpg.spec.ts (100%) rename src/{indicator => adapter}/gpg.ts (98%) rename src/{indicator => common}/locker.spec.ts (100%) rename src/{indicator => common}/locker.ts (100%) rename src/{indicator => common}/process.ts (100%) rename src/{indicator => common}/tempfile.ts (100%) rename src/{manager.ts => core.ts} (99%) diff --git a/src/indicator/assuan.ts b/src/adapter/assuan.ts similarity index 100% rename from src/indicator/assuan.ts rename to src/adapter/assuan.ts diff --git a/src/indicator/git.spec.ts b/src/adapter/git.spec.ts similarity index 100% rename from src/indicator/git.spec.ts rename to src/adapter/git.spec.ts diff --git a/src/indicator/git.ts b/src/adapter/git.ts similarity index 98% rename from src/indicator/git.ts rename to src/adapter/git.ts index 8aa2d8b..39c01c1 100644 --- a/src/indicator/git.ts +++ b/src/adapter/git.ts @@ -1,6 +1,6 @@ import * as util from 'util'; -import * as core from '../manager'; +import * as core from '../core'; const exec = util.promisify(require('child_process').exec); // exec with default utf-8 encoding always return stdout as string diff --git a/src/indicator/gpg.spec.ts b/src/adapter/gpg.spec.ts similarity index 100% rename from src/indicator/gpg.spec.ts rename to src/adapter/gpg.spec.ts diff --git a/src/indicator/gpg.ts b/src/adapter/gpg.ts similarity index 98% rename from src/indicator/gpg.ts rename to src/adapter/gpg.ts index 3123064..c7d2789 100644 --- a/src/indicator/gpg.ts +++ b/src/adapter/gpg.ts @@ -1,8 +1,8 @@ -import * as process from './process'; +import * as process from '../common/process'; import * as assuan from './assuan'; -import type { Logger } from '../manager'; -import * as core from '../manager'; +import type { Logger } from '../core'; +import * as core from '../core'; /** * Get the path of socket file for communication with GPG agent. diff --git a/src/indicator/locker.spec.ts b/src/common/locker.spec.ts similarity index 100% rename from src/indicator/locker.spec.ts rename to src/common/locker.spec.ts diff --git a/src/indicator/locker.ts b/src/common/locker.ts similarity index 100% rename from src/indicator/locker.ts rename to src/common/locker.ts diff --git a/src/indicator/process.ts b/src/common/process.ts similarity index 100% rename from src/indicator/process.ts rename to src/common/process.ts diff --git a/src/indicator/tempfile.ts b/src/common/tempfile.ts similarity index 100% rename from src/indicator/tempfile.ts rename to src/common/tempfile.ts diff --git a/src/manager.ts b/src/core.ts similarity index 99% rename from src/manager.ts rename to src/core.ts index 45c6356..f1671b5 100644 --- a/src/manager.ts +++ b/src/core.ts @@ -1,4 +1,4 @@ -import { Mutex } from "./indicator/locker"; +import { Mutex } from "./common/locker"; /** * Logger is a sample interface for basic logging ability. diff --git a/src/extension.test.ts b/src/extension.test.ts index 341bf1f..087c54b 100644 --- a/src/extension.test.ts +++ b/src/extension.test.ts @@ -1,8 +1,9 @@ import * as vscode from 'vscode'; import * as assert from 'assert'; +import * as core from './core'; + import * as extension from './extension'; -import * as core from './manager'; class FakeCipher implements extension.Cipher { constructor() { } diff --git a/src/extension.ts b/src/extension.ts index bf61654..58136af 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -3,13 +3,13 @@ import * as os from 'os'; import * as crypto from 'crypto'; import * as util from 'util'; -import * as git from './indicator/git'; -import * as gpg from './indicator/gpg'; -import * as locker from './indicator/locker'; -import * as core from './manager'; -import { Logger } from "./manager"; -import KeyStatusManager from "./manager"; -import { Storage, KeyStatusEvent } from "./manager"; +import * as git from './adapter/git'; +import * as gpg from './adapter/gpg'; +import * as locker from './common/locker'; +import * as core from './core'; +import { Logger } from "./core"; +import KeyStatusManager from "./core"; +import { Storage, KeyStatusEvent } from "./core"; import { m } from "./message"; type statusStyleEnum = "fingerprintWithUserId" | "fingerprint" | "userId";