mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-17 15:37:57 +01:00
Merge pull request #124 from bitwarden/update-service-dep
Update jslib (31a2574
->28e3fff
)
This commit is contained in:
commit
4152f80b78
2
jslib
2
jslib
@ -1 +1 @@
|
|||||||
Subproject commit 31a257407be7f8f47624b0d021363aaf2cfda2d7
|
Subproject commit 28e3fff739e64c2dd80d3d98717e2921895d16df
|
@ -19,7 +19,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"sub:init": "git submodule update --init --recursive",
|
"sub:init": "git submodule update --init --recursive",
|
||||||
"sub:update": "git submodule update --remote",
|
"sub:update": "git submodule update --remote",
|
||||||
"sub:pull": "git submodule foreach git pull",
|
"sub:pull": "git submodule foreach git pull origin master",
|
||||||
"clean": "rimraf dist/**/*",
|
"clean": "rimraf dist/**/*",
|
||||||
"symlink:win": "rmdir /S /Q ./jslib && cmd /c mklink /J .\\jslib ..\\jslib",
|
"symlink:win": "rmdir /S /Q ./jslib && cmd /c mklink /J .\\jslib ..\\jslib",
|
||||||
"symlink:mac": "npm run symlink:lin",
|
"symlink:mac": "npm run symlink:lin",
|
||||||
|
@ -20,7 +20,6 @@ import { EnvironmentService } from 'jslib/services/environment.service';
|
|||||||
import { ExportService } from 'jslib/services/export.service';
|
import { ExportService } from 'jslib/services/export.service';
|
||||||
import { FolderService } from 'jslib/services/folder.service';
|
import { FolderService } from 'jslib/services/folder.service';
|
||||||
import { ImportService } from 'jslib/services/import.service';
|
import { ImportService } from 'jslib/services/import.service';
|
||||||
import { LockService } from 'jslib/services/lock.service';
|
|
||||||
import { LowdbStorageService } from 'jslib/services/lowdbStorage.service';
|
import { LowdbStorageService } from 'jslib/services/lowdbStorage.service';
|
||||||
import { NodeApiService } from 'jslib/services/nodeApi.service';
|
import { NodeApiService } from 'jslib/services/nodeApi.service';
|
||||||
import { NodeCryptoFunctionService } from 'jslib/services/nodeCryptoFunction.service';
|
import { NodeCryptoFunctionService } from 'jslib/services/nodeCryptoFunction.service';
|
||||||
@ -33,6 +32,7 @@ import { SyncService } from 'jslib/services/sync.service';
|
|||||||
import { TokenService } from 'jslib/services/token.service';
|
import { TokenService } from 'jslib/services/token.service';
|
||||||
import { TotpService } from 'jslib/services/totp.service';
|
import { TotpService } from 'jslib/services/totp.service';
|
||||||
import { UserService } from 'jslib/services/user.service';
|
import { UserService } from 'jslib/services/user.service';
|
||||||
|
import { VaultTimeoutService } from 'jslib/services/vaultTimeout.service';
|
||||||
|
|
||||||
import { Program } from './program';
|
import { Program } from './program';
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ export class Main {
|
|||||||
cipherService: CipherService;
|
cipherService: CipherService;
|
||||||
folderService: FolderService;
|
folderService: FolderService;
|
||||||
collectionService: CollectionService;
|
collectionService: CollectionService;
|
||||||
lockService: LockService;
|
vaultTimeoutService: VaultTimeoutService;
|
||||||
syncService: SyncService;
|
syncService: SyncService;
|
||||||
passwordGenerationService: PasswordGenerationService;
|
passwordGenerationService: PasswordGenerationService;
|
||||||
totpService: TotpService;
|
totpService: TotpService;
|
||||||
@ -116,9 +116,9 @@ export class Main {
|
|||||||
this.i18nService);
|
this.i18nService);
|
||||||
this.searchService = new SearchService(this.cipherService, this.platformUtilsService);
|
this.searchService = new SearchService(this.cipherService, this.platformUtilsService);
|
||||||
this.policyService = new PolicyService(this.userService, this.storageService);
|
this.policyService = new PolicyService(this.userService, this.storageService);
|
||||||
this.lockService = new LockService(this.cipherService, this.folderService, this.collectionService,
|
this.vaultTimeoutService = new VaultTimeoutService(this.cipherService, this.folderService, this.collectionService,
|
||||||
this.cryptoService, this.platformUtilsService, this.storageService, this.messagingService,
|
this.cryptoService, this.platformUtilsService, this.storageService, this.messagingService,
|
||||||
this.searchService, this.userService, null);
|
this.searchService, this.userService, null, null);
|
||||||
this.syncService = new SyncService(this.userService, this.apiService, this.settingsService,
|
this.syncService = new SyncService(this.userService, this.apiService, this.settingsService,
|
||||||
this.folderService, this.cipherService, this.cryptoService, this.collectionService,
|
this.folderService, this.cipherService, this.cryptoService, this.collectionService,
|
||||||
this.storageService, this.messagingService, this.policyService,
|
this.storageService, this.messagingService, this.policyService,
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
import * as program from 'commander';
|
import * as program from 'commander';
|
||||||
|
|
||||||
import { LockService } from 'jslib/abstractions/lock.service';
|
import { VaultTimeoutService } from 'jslib/abstractions/vaultTimeout.service';
|
||||||
|
|
||||||
import { Response } from 'jslib/cli/models/response';
|
import { Response } from 'jslib/cli/models/response';
|
||||||
import { MessageResponse } from 'jslib/cli/models/response/messageResponse';
|
import { MessageResponse } from 'jslib/cli/models/response/messageResponse';
|
||||||
|
|
||||||
export class LockCommand {
|
export class LockCommand {
|
||||||
constructor(private lockService: LockService) { }
|
constructor(private vaultTimeoutService: VaultTimeoutService) { }
|
||||||
|
|
||||||
async run(cmd: program.Command) {
|
async run(cmd: program.Command) {
|
||||||
await this.lockService.lock();
|
await this.vaultTimeoutService.lock();
|
||||||
process.env.BW_SESSION = null;
|
process.env.BW_SESSION = null;
|
||||||
const res = new MessageResponse('Your vault is locked.', null);
|
const res = new MessageResponse('Your vault is locked.', null);
|
||||||
return Response.success(res);
|
return Response.success(res);
|
||||||
|
@ -163,7 +163,7 @@ export class Program extends BaseProgram {
|
|||||||
})
|
})
|
||||||
.action(async (cmd) => {
|
.action(async (cmd) => {
|
||||||
await this.exitIfNotAuthed();
|
await this.exitIfNotAuthed();
|
||||||
const command = new LockCommand(this.main.lockService);
|
const command = new LockCommand(this.main.vaultTimeoutService);
|
||||||
const response = await command.run(cmd);
|
const response = await command.run(cmd);
|
||||||
this.processResponse(response);
|
this.processResponse(response);
|
||||||
});
|
});
|
||||||
@ -186,7 +186,7 @@ export class Program extends BaseProgram {
|
|||||||
writeLn('', true);
|
writeLn('', true);
|
||||||
})
|
})
|
||||||
.option('--check', 'Check lock status.', async () => {
|
.option('--check', 'Check lock status.', async () => {
|
||||||
const locked = await this.main.lockService.isLocked();
|
const locked = await this.main.vaultTimeoutService.isLocked();
|
||||||
if (!locked) {
|
if (!locked) {
|
||||||
const res = new MessageResponse('Vault is unlocked!', null);
|
const res = new MessageResponse('Vault is unlocked!', null);
|
||||||
this.processResponse(Response.success(res), true);
|
this.processResponse(Response.success(res), true);
|
||||||
|
Loading…
Reference in New Issue
Block a user