diff --git a/python/CHANGELOG.md b/python/CHANGELOG.md index b4be33d9aa..e309ce05f2 100644 --- a/python/CHANGELOG.md +++ b/python/CHANGELOG.md @@ -11,7 +11,7 @@ _At the moment, the project does **not** adhere to [Semantic Versioning](https:/ ### Added -- `trezorctl set unsafe-prompts` controls the new "unsafe prompts" feature. [#1126] +- `trezorctl set safety-checks` controls the new "safety checks" feature. [#1126] - `trezorctl btc get-address` can create multisig addresses. - the following commands are now equivalent in trezorctl: `firmware-update`, `firmware-upgrade`, `update-firmware`, `upgrade-firmware` diff --git a/python/docs/OPTIONS.rst b/python/docs/OPTIONS.rst index fb38a16860..83de6c6c87 100644 --- a/python/docs/OPTIONS.rst +++ b/python/docs/OPTIONS.rst @@ -383,7 +383,7 @@ Device settings. label Set new device label. passphrase Enable, disable or configure passphrase protection. pin Set, change or remove PIN. - unsafe-prompts Allow or disallow unsafe prompts. + safety-checks Set safety check level. wipe-code Set or remove the wipe code. Stellar commands. diff --git a/python/src/trezorlib/cli/settings.py b/python/src/trezorlib/cli/settings.py index 9c3670dc42..60a5077214 100644 --- a/python/src/trezorlib/cli/settings.py +++ b/python/src/trezorlib/cli/settings.py @@ -20,6 +20,10 @@ from .. import device, messages from . import ChoiceType, with_client ROTATION = {"north": 0, "east": 90, "south": 180, "west": 270} +SAFETY_LEVELS = { + "strict": messages.SafetyCheckLevel.Strict, + "prompt": messages.SafetyCheckLevel.Prompt, +} @click.group(name="set") @@ -136,21 +140,18 @@ def homescreen(client, filename): @cli.command() -@click.argument("allow", type=click.Choice(("on", "off"))) +@click.argument("level", type=ChoiceType(SAFETY_LEVELS)) @with_client -def unsafe_prompts(client, allow): - """Allow or disallow unsafe prompts. +def safety_checks(client, level): + """Set safety check level. - This is a power-user feature. With unsafe prompts enabled, Trezor will ask the user - to confirm possibly dangerous actions instead of rejecting them outright. - Use with caution. + Set to "strict" to get the full Trezor security. + + Set to "prompt" if you want to be able to allow potentially unsafe actions, such as + mismatching coin keys or extreme fees. + + This is a power-user feature. Use with caution. """ - # TODO change this to ChoiceType - if allow == "on": - level = messages.SafetyCheckLevel.Prompt - else: - level = messages.SafetyCheckLevel.Strict - return device.apply_settings(client, safety_checks=level)