Commit Graph
45 Commits
Author SHA1 Message Date
Matt HauffandGitHub 40db4635a8 [LABS-245] Enable PEP604 Ruff rules (#20269)
* Enable PEP604 Ruff rules

* Fix harcoded signature in test

* Hack CLVMStreamable test with note to fast follow
2025-11-18 12:34:00 -08:00
Matt HauffandGitHub fcdb8e4925 Manual fixes for upcoming Ruff pyupgrade push (#20213)
* Manual fixes

* Revert back to variable in type expression

* Fix streamable to handle UnionType
2025-11-03 09:16:42 -07:00
Kyle AltendorfandGitHub f054d339a1 unignore some ruff s rules (#19703) 2025-06-12 11:12:54 -07:00
6050235bdb [CHIA-3043] Add (hopefully) non-controversial ruff rules (#19684)
* Add (hopefully) non-controversial ruff rules

* mypy-exclusions.txt

* PIE

* Fix pre-commit?

* PYI

* RSE

* S + ignores

* Whitespace fix

* Re-add build-init-files.py

* Add comment about security ignores

* Update mypy-exclusions.txt

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* Fix the executable status of build-init-files.py

* Set executable bit for tools/run_block.py and readd shebang

* Fix new errors

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2025-06-11 08:36:08 -07:00
Matt HauffandGitHub 604fc1feb0 [CHIA-1732] Add Ruff specific linting rules (#18845)
* Add Ruff specific linting rules

* Further tighten ignore list

* Address comments by @altendky

* One more comment @altendky
2024-11-14 15:58:12 -07:00
6c90a76b56 Tighten up ruff ignore list (#18837)
* Tighten up ruff ignore list

* Okay that fix was indeed unsafe

* enable type-name-incorrect-variance

* enable literal-membership

* enable non-augmented-assignment

* enable useless-return

* enable global-variable-not-assigned

* -

* fixup

* Clean up roff.toml from annotations

* use ignore instead of explicit re-export

* use more descriptive names

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2024-11-12 12:19:31 -07:00
Amine KhaldiandGitHub 0d8920a942 CHIA-1684 Move obtain_current_passphrase next to KeyringWrapper (#18787)
Move obtain_current_passphrase next to KeyringWrapper.
2024-11-05 08:41:11 -07:00
Amine KhaldiandGitHub 6c2c13a2d0 CHIA-1626 Move some modules to the utils virtual project (#18692)
Move some modules to the utils virtual project.
2024-10-18 10:40:49 -07:00
Kyle AltendorfandGitHub 9c8557a1f8 Remove Python 3.8 support and update source to 3.9 standards (#18687)
* manual python 3.8 removals

* poetry

* pyupgrade

* black

* isort

* manually tidy imports

* work around shadowed type

* catch up build network protocol files for pyupgrade changes

* placate pylint

* re-enable 20.04

* placate flake8
2024-10-16 14:21:15 -07:00
Matt HauffandGitHub ebf747b3ae [CHIA-839] Refactor KeywringWrapper/FileKeyring for better ergonomics (#18275)
* `.get_passphrase` -> `.keyring.get_key()`

* `.set_password` -> `.keyring.set_key`

* `.delete_passphrase` -> `.keyring.delete_key`

* `.*_label` -> `.keyring.*_label`

* Introduce DecryptedKeyringData

* Fix bad assumption

* Fix tests

* Pre-commit

* Pivot key storage to external metadata for forwards compatibility

* typo & passphrase -> key
2024-07-09 12:17:11 -07:00
Earle LoweandGitHub 48e4039e58 Update black to 24.1.1 and update source as needed (#17499)
* Update source to black 24 spec

* update black to 24.1.1

* update pylint to ignore multiple-statements

* update test file

* black updates

* format updates

* Update test_network_protocol_files.py

* Update test_network_protocol_files.py
2024-03-13 11:08:19 -07:00
3e6e08732f Add a few missing type annotations (#17043)
* Add a few missing type annotations

* Update chia/util/struct_stream.py

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* Update chia/util/keyring_wrapper.py

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* add `ClassVar` import

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2024-01-08 08:36:13 -06:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Kyle Altendorf
d4234d804f build(deps): bump keyring from 23.13.1 to 24.3.0 (#16885)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kyle Altendorf <sda@fstab.net>
2023-11-21 17:29:29 -06:00
Kyle AltendorfandGitHub d82876d47d hint chia.util and remove from exclusions (#16521) 2023-10-10 13:45:20 -05:00
Kyle Altendorf 3efadeb738 hint chia.cmds.passphrase, passphrase_funcs 2023-03-03 19:28:48 -05:00
dustinfaceandGitHub 2e2c297a80 util: Remove legacy keyring support (#13398) 2022-11-18 10:33:18 -06:00
dustinfaceandGitHub d9c97e15e4 isort: Remove all chia.util exceptions and sort the related files (#13939) 2022-11-17 15:32:18 -06:00
Almog De PazandGitHub ac2203eda8 Refactor test utils for import availability outside of repo (#13880)
* refactor for import availability outside of repo

* refactor for import availability outside of repo

* small revert

* newline

* fix imports

* fix pre-commit issues

* types issort, adapt mypy ignore

* redundant imports

* move files from util to simulator

* run pre_commit

* remove setup_nodes/keyring from isort.cfg

* fix asyncio import
2022-11-15 18:51:05 -06:00
SeanandGitHub a0e70ca73b Freebsd improvements when checking for legacy key (#13666)
Issue: #13282 Optional[Credential] = keyring.get_credential(keychain_service, current_user) -> AttributeError: 'NoneType' object has no attribute 'get_credential'

Freebsd platform fails to migrate in previous releases or in 1.5.1+ versions it fails to start farmer because there is a NoneType object from keyring.get_credential. This just checks for that when trying to set the legacy_keyring.
2022-10-25 16:46:15 -05:00
dustinfaceandGitHub fed2ba630e util: Implement key label support for FileKeyring and KeyringWrapper (#12843)
* util: Implement key label support for `FileKeyring` and `KeyringWrapper`

* Restrict trailing/leading whitespaces in the label

* Bump `MAX_LABEL_LENGTH` to 65

* Additional label tests

* Drop duplicated `KeychainFingerprintNotFound` definition
2022-08-25 19:12:47 -05:00
William AllenandGitHub 1368b483ca Merge pull request #13092 from Chia-Network/checkpoint/main_from_release_1.5.1_e3d7122d80f1df147213d8536ba96c72e7bb0bfd
checkpoint: into main from release/1.5.1  @ e3d7122d80
2022-08-22 12:55:17 -05:00
dustinfaceandGitHub 9b71c857b4 util: Fix force_legacy in KeyringWrapper.__init__ (#13054) 2022-08-22 11:24:20 -05:00
Amine Khaldi e6375b3514 Merge commit 'e3d7122d80f1df147213d8536ba96c72e7bb0bfd' into checkpoint/main_from_release_1.5.1_e3d7122d80f1df147213d8536ba96c72e7bb0bfd 2022-08-22 15:46:19 +01:00
dustinfaceandGitHub 97a5921ede util: Some cleanups in file_keyring.py (#12669)
* Move `CHECKBYTES_VALUE` related stuff into encryption/decription

* Simplify `FileKeyring._inner_set_password`

* Simplify `FileKeyring._inner_delete_password`

* Drop some redundant assignments

* Simplify `FileKeyring.check_if_keyring_file_modified`

Just try since it anyway fails if the file doesn't exist.

* Drop incorrect comment, it writes the cached payload to disk

* Rename `payload_cache` -> `cached_data_dict` and some related variables

* Ensure the `keys` dict exists by default

* Convert the passphrase from the legacy keyring if it is `bytes` type

* Merge `loads_keyring` into `FileKeyring.lockfile`

And rename it into `FileKeyring.lock_and_reload_if_required`
2022-08-20 13:41:42 -05:00
dustinfaceandGitHub e3d7122d80 cmds: Don't exit in migrate_legacy_keyring_interactive (#13037)
Exiting leads to the actual start command not running after the mirgation was done successfully. Also we have a daemon connection open here if we trigger the migration via `chia start` commands and exiting in there leaves the connection opened which leads to exception traceback outputs.
2022-08-18 14:55:49 -05:00
Amine Khaldi be10b2e1e2 Merge commit 'c1a9d6c031c206cb5b9792a30fd737f0327560dd' into checkpoint/main_from_release_1.5.1_c1a9d6c031c206cb5b9792a30fd737f0327560dd 2022-08-14 13:31:53 +01:00
dustinfaceandGitHub c1a9d6c031 cmds|daemon: Improve legacy keyring migration enforcement (#12911)
* Use the daemon for partial migration checks if its running

* Make `migrate_legacy_keyring_interactive` async and drop redundant calls

So that we can await it since 

```
asyncio.run(async_update_daemon_migration_completed_if_running())
```

fails because we now here already have an event loop running.

* Drop redundant `unlocks_keyring` decoration

* Update some comments

* Move the `asyncio` import to make LGTM happy
2022-08-11 15:40:46 -05:00
Amine Khaldi 032264c294 Merge commit '922523694a30fc6e39fd686ee820d0ea96f55272' into checkpoint/main_from_release_1.5.1_922523694a30fc6e39fd686ee820d0ea96f55272 2022-08-11 19:55:33 +01:00
Kyle AltendorfandGitHub bd5a7e4163 just raise, not raise e when reraising (#12825) 2022-08-10 15:39:51 -05:00
922523694a util: Force keyring migration / Deprecate legacy keyring support (#12801)
* util: Force keyring migration / Deprecate legacy keyring support

* Update chia/cmds/keys_funcs.py

Co-authored-by: Jeff <paninaro@gmail.com>

* Update chia/cmds/keys_funcs.py

Co-authored-by: Jeff <paninaro@gmail.com>

Co-authored-by: Jeff <paninaro@gmail.com>
2022-08-08 18:22:27 -05:00
dustinfaceandGitHub 4611d0aa43 util: Move all keychain related errors into chia.util.error (#12756)
Also derive them from `KeychainException` and name them consistently.
2022-08-05 02:05:58 -05:00
dustinfaceandGitHub edd60a1054 keychain: Drop supports_keyring_passphrase (#12479)
* keychain: Drop `supports_keyring_passphrase`

* Drop `PASSPHRASE_CLI_OPTION_NAMES`
2022-07-22 11:15:00 -05:00
dustinfaceandGitHub 13558fdb75 util: Make FileKeyring a dataclass (#12515) 2022-07-21 14:03:29 -05:00
dustinfaceandGitHub a801260a5e util: Improve prompt_yes_no (#12366)
Move the `(y/n)` addition into the function and drop it as default parameter.
2022-07-15 03:15:26 -05:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Earle LoweEarle Lowe
e57025a83e Bump keyring from 23.0.1 to 23.6.0 (#11829)
* Bump keyring from 23.0.1 to 23.6.0

Bumps [keyring](https://github.com/jaraco/keyring) from 23.0.1 to 23.6.0.
- [Release notes](https://github.com/jaraco/keyring/releases)
- [Changelog](https://github.com/jaraco/keyring/blob/main/CHANGES.rst)
- [Commits](https://github.com/jaraco/keyring/compare/v23.0.1...v23.6.0)

---
updated-dependencies:
- dependency-name: keyring
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Small type change for new keyring version

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Earle Lowe <e.lowe@chia.net>
Co-authored-by: Earle Lowe <30607889+emlowe@users.noreply.github.com>
2022-07-02 01:10:04 -05:00
Kyle AltendorfandGitHub a691d3c4b2 asyncio.get_event_loop() is deprecated in 3.10, stop using it (mostly) (#10418)
* asyncio.get_event_loop() is deprecated in 3.10, stop using it

https://docs.python.org/3.10/library/asyncio-eventloop.html#asyncio.get_event_loop
> Deprecated since version 3.10: Deprecation warning is emitted if there is no running event loop. In future Python releases, this function will be an alias of get_running_loop().

* black
2022-03-28 13:20:50 -07:00
JeffandGitHub 75ed1307e5 Fix exception when chia keys migrate is run without needing migration (#10655)
* Fix exception when `chia keys migrate` is run without needing migration

* Linter fixes
2022-03-11 16:23:24 -08:00
JeffandGitHub f2fe1dca62 Support for performing incremental legacy key migration. (#10085)
* CLI support for performing an incremental keyring migration. This handles the case where new keys were created by an older client or the light wallet, and those keys then need to be moved to keyring.yaml.

* Opportunistically perform a silent incremental keyring migration when the GUI unlocks the keyring.

Track when keyring migration occurs so that we don't needlessly attempt on each GUI launch. ~/.chia_keys/.last_legacy_migration will contain the app version that last attempted migration.

* Formatting & linter fixes

* Tests for `chia keys migrate`. Missing a test for incremental migration.

* Additional keyring migration tests

* Formatting updates from black in files unrelated to this branch.

* Revert "Formatting updates from black in files unrelated to this branch."

This reverts commit a85030e8e0ea7406683efd8ae41e224c861e08ff.

* Exit loop if remaining_keys <= 0

* Linter fix? Manually making this change as black doesn't identify any issues locally.

* Linter fix again...
2022-02-04 16:43:51 -08:00
1073f9d5dd mypy: warn_unused_ignores = true (and remove some) (#9085)
* mypy: warn_unused_ignores = true (and remove some)

* catch up

* type checking tweaks

* precommit uses mypy --no-warn-unused-ignores

* revert a bit

* precommit explanatory comment

* Update .pre-commit-config.yaml

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
2021-11-23 12:44:53 -08:00
Jeff CruikshankandGitHub 3864f750b4 Backend changes to support passphrase hints and additional GUI passphrase support (#8779)
* Expose GUI option to save passphrase (where available)
Prevent GUI from showing the option to remove migrated keys

* Backend support for getting/setting the passphrase hint. The hint data is stored in keyring.yaml in the clear.

* CLI support for showing/setting/removing the passphrase hint

* Tests for setting/retrieving passphrase hints

* Squelch LGTM false positive

* Fixed issue when running without passphrase support enabled

* CLI updates based on feedback

* Initialize passphrase_hint earlier.

* Minor restructuring to address linter complaint.
2021-10-13 10:36:10 -07:00
Jeff CruikshankandGitHub 26d23b9279 Keyring windows (#8465)
* Fix to allow migration of keys on macOS

* Fixed file_keyring synchronization test failures on macOS.
Fixed sporadic test failures on macOS when fsevents are delivered for the keyring after deletion.
TempKeyring-based tests now patch supports_os_passphrase_storage() to return False.

* Fixed LGTM issues

* Re-added the cleaning up temp keychain statement. This is being removed in a separate PR.

* Windows keyring passphrase support

* Test tweaks for Windows (mostly to support my slow VM)

* Linter fixes

* Restored prompt_for_passphrase() function which was accidentally removed during a rebase.

* Added CHIA_PASSPHRASE_SUPPORT env variable to allow more testing
2021-10-05 09:59:53 -07:00
a70082f29a macOS keyring.yaml support (#8292)
* Added 'service' as a Keychain ctor param. Removed 'testing'

* Detect existing keys in the Mac Keychain

* Fix to allow migration of keys on macOS

* Added dump_keyring.py tool to show decrypted contents of keyring.yaml

* Prompt to save passphrase to macOS keychain

* Master passphrase retrieval/removal from the macOS Keychain.
Fixed typos.

* Warn if errSecInteractionNotAllowed is detected when accessing the macOS Keychain

* Fixed file_keyring synchronization test failures on macOS.
Fixed sporadic test failures on macOS when fsevents are delivered for the keyring after deletion.
TempKeyring-based tests now patch supports_os_passphrase_storage() to return False.

* TempKeyring mocks-out legacy_keyring setup to allow tests to succeed on macOS (which could find existing keys in the Keychain)

* Fixed pylint error

* Use with_name instead of with_stem (which is new to Python 3.9)

* Fixed keychain tests that started prompting for the keyring passphrase.

* Fixed LGTM issues

* Re-added the cleaning up temp keychain statement. This is being removed in a separate PR.

* Linter fixes

* Fixed keyring assignment on macOS when passphrase support is disabled.

* Include 'can_save_passphrase' flag in keyring_status response

* More linter fixes

* Fixed determination of the user_passphrase_is_set flag. This was returning true for a newly created keyring without any keys (or passphrase set)

* Removed the tidy_passphrase function per feedback

* Added some comments based on feedback

* Update chia/cmds/passphrase_funcs.py

Co-authored-by: Adam Kelly <338792+aqk@users.noreply.github.com>

Co-authored-by: Adam Kelly <338792+aqk@users.noreply.github.com>
2021-09-24 10:32:57 -07:00
dustinfaceandGitHub 4f98891877 typo: passphase -> passphrase, Passphase -> Passphrase (#8473) 2021-09-17 10:52:50 -07:00
Jeff CruikshankandGitHub 5587375c03 RPC updates to support keyring migration and passphrase requirements (#8059)
* Added migrate_keyring daemon RPC support.
Passphrase requirements (min length, empty allowed) are now communicated to callers of the keyring_status RPC.
Refactored the keyring migration code to support interactive and non-interactive modes.

* Minor fixes for error handling during migration

* Cleaned up checking passphrase requirements

* Added a comment explaining why a failure is returned early in migrate_keyring if the keyring is already migrated

* Support for notifying the GUI and daemon when keyring status changes occur, including migration
2021-08-31 10:24:45 -07:00
325d7f8245 Keyring passphrase protection (#7249)
* Moved keyring handling into a KeyringWrapper class

* Update click to 8.0.x for prompt_required support

* Renamed KeyringWrapper to _KeyringWrapper

* Expose password management options on Linux

* CLI support for setting/removing a password

* Global option for specifying the master password

* Cache the password instead of setting on the context

* Password bootstrapping during chia init

* Tidying up _KeyringWraper's interface

* Initial pass migrating the legacy keyring contents

* Encryption/decryption of keyring.yaml contents

* FileKeyring backend encrypts with ChaCha20Poly1305

* Tightened up keyring migration and initialization

* Fixed issues identified by linters

* Remove root_path from Keychain

* Prevent double-migration if setting master passwd

* KeyringWrapper tests are mostly complete

* FileKeyring will now honor the service param

* Tests for get/set/delete password

* Formatting/commenting updates

* Writer lock support with tests - WIP

* keyring.yaml is now watched for modifications

* Reader/Writer lock for get/delete password

* Fixed linter issues

* Reader lock tests

* Formatting update

* Hook up CHIA_ROOT support for KeychainWrapper

* Quick fix to address test failures

* Fixed failures when existing legacy keyring exists

* Fixed test failures caused by reusing the same temp dir

* keyring.yaml now lives in ~/.chia_keys by default. Can be overridden with CHIA_KEYS_ROOT or --keys-root-path

* Fixed migration failure when setting a password (not using the default)

* KeyringWrapper now uses supports_keyring_password to determine if a FileKeyring should be used. Patched tests to work regardless of whether supports_keyring_password return False

* The daemon now takes a --have-gui option that will prevent calling check_keys() during startup. If the keyring is locked, we want the GUI to prompt for the password.

* Added is_keyring_locked RPC call

* Added 'unlock_keyring' RPC command

* Added KeychainProxy and KeychainServer to handle RPC messages related to keyring operations. WalletNode no longer directly accesses the Keychain class.

* Turn on macOS support for testing keyring passwords

* Fixed get_key_for_fingerprint to use the ocal keychain if the platform doesn't need to remotely access the daemon's keychain.

Fixed key reconstruction when sent over RPC.

* Farmer now accesses the keychain over RPC

* Fixes for linter issues and some restructuring to support tests that use setup_nodes.py

* Couple of fixes to unblock the GUI from launching when a keyring password is set

* Added a keychain RPC call for add_private_key()

* Added remaining keychain proxy RPC calls for delete_key_by_fingerprint and delete_all_keys

* Check for None when inspecting request arguments

* Run check_keys after unlocking the keyring when the daemon is launched via GUI

* Added check_keys RPC method.
Fixed deserialization of key entropy in get_all_private_keys. This was preventing the GUI from being able to show key details.

* Added get_first_private_key to keychain_server/proxy.
create_plots now uses the keychain proxy when launched from the daemon.

* Added a comment about KeychainProxy in chia plots check

* Workaround import conflict  when importing from 'tests.*' due to fasteners name conflict

* Simulator now uses KeychainProxy if launched by the daemon.
KeychainServer/Proxy now takes keychain user/testing params for testing scenarios.

* Added "set_keyring_passphrase" RPC message

* Reworking KeychainProxy usage to handle local keychain tests and RPC keychain tests.

* Replace my prior usage of asyncio.run() with asyncio.get_event_loop().run_until_complete()

* Silencing file_keyring logging for the moment.

* Updated tests to use test keychains and appropriate BlockTools construction

BlockTools should now be created with create_block_tools(_async) to handle async scenarios.

Updated block_tools to be async compatible

Updated fasteners to fix installation of top-level 'tests' in site-packages

* Added 'remove_keyring_passphrase' RPC message to the daemon

Minor tweak to TempKeyring to default to some test params

* Fixed linter issues

* Remove flake8 ignore statement now that the fasteners module has been updated

* Some initial renaming changes: password -> passphrase

* Fixed wallet RPC issue where get_key_for_fingerprint wasn't awaited-upon.

Fixed legacy keyring initialization (for migration scenarios)

* Fixed improperly merged file

* Fixed linter issues.
More renaming.

* Updated spots that were still using an incorrect keychain call

* Renamed use_password_cache, obtain_current_password

* Renamed supports_keyring_password

* Renamed has_master_password

* Renamed has_cached_password, get_cached_master_password

* Linter fixes

* Renamed master_password_is_valid

* Renamed set_cached_master_password

* Renamed set_master_password

* Renamed remove_master_password

* Renamed has_cached_master_password

* Renaming in file_keyring and keyring_wrapper

Updated default keyring payload used for tests

* Renamed get_password
Other renaming updates

* Renamed set_password
Other renaming updates

* Renamed remaining password occurrences (where appropriate)

* password -> passphrase

* Added tests for setting an emoji and Japanese master passphrase

* Attempt to notify the daemon when a keyring passphrase is set/updated/removed

* Missed one password -> passphrase replacement.

* Fixed some file synchronization issues found when running tests on macOS

* Adjusted timeout values for test_writer_lock_reacquisition_failure for macOS.

* Removed logging statements previously added for debugging

* Prompt for keyring passphrase up-front when launching a service.

Changed --have-gui flag to --wait-for-unlock

* Updated set_keyring_passphrase RPC message to fix optional current_passphrase param when the keyring is using the default passphrase.

* Minor test cleanup to deduplicate some code.

* Fixed regression when setting a new master passphrase

* Minor refactoring and docs/commenting updates

* Renaming password -> passphrase went too far. Keyring backends use password terminology for compatibility with third party backends.

* Disabling macOS support (previously added for testing only)

* Disabling passphrase support in preparation for sending out the PR

* Fixed improper merge (vscode didn't save changes during rebase)

* Update chia/cmds/init_funcs.py

Co-authored-by: Adam Kelly <338792+aqk@users.noreply.github.com>

* skip_check_keys -> should_check_keys

* Shuffling some imports around to break cycles reported by LGTM

* Handle unlocking the daemon if it's already launched and waiting for unlock.

* Replaced uses_keychain_proxy decorator in farmer.py. Fixed async usage of get_reward_targets.

Linter/reformatting fixes

* Replaced uses_keychain_proxy decorator with a clearer method.

* Cleanup the temp keyring dir using shutil.rmtree()

* Restored self._root_path (had been changed to self.root_path)

* Minor cleanup

* ensure_keychain_proxy() now throws if connect_to_keychain_and_validate() fails

* Plot key resolution now yields a PlotKeys object which can be passed into create_plots.

De-indented test_invalid_icc_sub_slot_vdf to keep git blame tidy.

* Added 'keyring_status' daemon RPC message to support the GUI

* Minor changes relating to PR feedback

* Addressed more PR feedback (mostly type annotations)

* Commented-out macOS file keyring usage. This can be re-enabled for testing purposes.

* Addressed test failures that require multiple keyrings in the same process. Each TempKeyring will now set a custom KeyringWrapper instance.

* Fixed logic for communicating user_passphrase_is_set in the keyring_status RPC response.

* Updated type annotations and method signature for set_passphrase to expect a string instead of bytes.

* Fixed Wallet RPC tests

* Fixed full_node_store tests. BlockTools should be created using the create_block_tools(_async) function(s)

* Fixed test failures in test_pool_rpc

* Fixed test_daemon. After BlockTools.setup_plots is run, the config file needs to be re-read to refresh stale plot_directories.

* Suppressing LGTM false positives regarding passphrase leakage in CLI error output. Seems that LGTM sees MIN_PASSPHRASE_LEN as sensitive data.

* Second attempt at suppressing LGTM false positives

* Third attempt at addressing LGTM false positives

* Removed test_keyring_wrapper param from Keychain ctor. Test setup now sets the keyring_wrapper property directly.

* Reformatting

* More targeted update of the test config to refresh just the "plot_directories" value

* More LGTM suppressions

Co-authored-by: Adam Kelly <338792+aqk@users.noreply.github.com>
Co-authored-by: wjblanke <wjb98672@gmail.com>
2021-08-04 12:46:55 -07:00