1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-10-30 08:10:34 +01:00
bitwarden-browser/apps/cli/src/commands
Andrew Jorgensen d77f77cea9
[PM-1803] Fail on unsupported export format (#5197)
* Fail on unsupported export format

Issue #5194: https://github.com/bitwarden/clients/issues/5194

The cli previously would take any value for the export format and
default to unencrypted json if it wasn't a supported format. This
behavior is a little dangerous because if for instance typed
"json_encrypted" instead of "encrypted_json" and naively saved the file
you might be surprised to learn the payload was not actually encrypted
even though the command completed successfully.

This change adds a guard clause when converting the string value passed
in via `--format` into the type `ExportFormat` to ensure that the format
provided is one of the supported types.

* Move isSupportedExportFormat to private method
2023-04-17 21:54:03 +02:00
..
completion.command.ts [PM-1512] Upgrade prettier (#5028) 2023-03-21 11:28:15 +01:00
config.command.ts [PS-1884] [TDL-189] [TDL-203] Move libs/node files to CLI and rename per ADR12 (#4069) 2022-11-18 13:20:19 +01:00
convert-to-key-connector.command.ts [AC-1011] Admin Console / Billing code ownership (#4973) 2023-03-22 10:03:50 -05:00
download.command.ts [PS-1884] [TDL-189] [TDL-203] Move libs/node files to CLI and rename per ADR12 (#4069) 2022-11-18 13:20:19 +01:00
edit.command.ts [AC-1011] Admin Console / Billing code ownership (#4973) 2023-03-22 10:03:50 -05:00
encode.command.ts [PS-1884] [TDL-189] [TDL-203] Move libs/node files to CLI and rename per ADR12 (#4069) 2022-11-18 13:20:19 +01:00
export.command.ts [PM-1803] Fail on unsupported export format (#5197) 2023-04-17 21:54:03 +02:00
get.command.ts [PM-328] Move Send to Tools (#5104) 2023-03-29 16:23:37 +02:00
list.command.ts refactor: move organization service and organization-user response to admin-console, refs AC-1202 (#5055) 2023-03-27 14:38:57 -05:00
restore.command.ts [SG-998] and [SG-999] Vault and Autofill team refactor (#4542) 2023-01-31 16:08:37 -05:00
serve.command.ts [AC-1266] Enums filename conventions (#5140) 2023-04-04 22:42:21 -05:00
status.command.ts Auth/ps 2298 reorg auth (#4564) 2023-02-06 15:53:37 -06:00
update.command.ts Ps 1061 cli update command returns wrong version (#4071) 2022-11-30 15:47:19 -07:00