mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-02 08:40:08 +01:00
updates for encrypted export and import (#198)
* react to changes for encrypted import * support encrypted json export * default back to csv
This commit is contained in:
parent
16d53b7f6f
commit
30b7b93fab
2
jslib
2
jslib
@ -1 +1 @@
|
||||
Subproject commit abb54f007305eabd77996623dd20cbe45345e82a
|
||||
Subproject commit dcbd09e736b516b359369f9d9fe5b0f5a6c2a928
|
@ -31,7 +31,10 @@ export class ExportCommand {
|
||||
const keyHash = await this.cryptoService.hashPassword(password, null);
|
||||
const storedKeyHash = await this.cryptoService.getKeyHash();
|
||||
if (storedKeyHash != null && keyHash != null && storedKeyHash === keyHash) {
|
||||
const format = cmd.format !== 'json' ? 'csv' : 'json';
|
||||
let format = cmd.format;
|
||||
if (format !== 'encrypted_json' && format !== 'json') {
|
||||
format = 'csv';
|
||||
}
|
||||
if (cmd.organizationid != null && !Utils.isGuid(cmd.organizationid)) {
|
||||
return Response.error('`' + cmd.organizationid + '` is not a GUID.');
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ export class ImportCommand {
|
||||
return Response.badRequest('`filepath` was not provided.');
|
||||
}
|
||||
|
||||
const importer = await this.importService.getImporter(format, false);
|
||||
const importer = await this.importService.getImporter(format, null);
|
||||
if (importer === null) {
|
||||
return Response.badRequest('Proper importer type required.');
|
||||
}
|
||||
|
@ -546,7 +546,7 @@ export class Program extends BaseProgram {
|
||||
.on('--help', () => {
|
||||
writeLn('\n Notes:');
|
||||
writeLn('');
|
||||
writeLn(' Valid formats are `csv` and `json`. Default format is `csv`.');
|
||||
writeLn(' Valid formats are `csv`, `json`, `encrypted_json`. Default format is `csv`.');
|
||||
writeLn('');
|
||||
writeLn(' If raw output is specified and no output filename or directory is given, the');
|
||||
writeLn(' result is written to stdout.');
|
||||
|
Loading…
Reference in New Issue
Block a user