-
Notifications
You must be signed in to change notification settings - Fork 660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Settings handlers #2352
Settings handlers #2352
Conversation
Start moving and adapting tests for functionality that was previously in the Settings class and is now located in the PersistentSettingsHandler.
Add a test to confirm the PersistentSettingsHandler returns the default value for a setting by default.
Fork an UnrecognizedSettingException from InvalidSettingsException.
Make it singular: InvalidSettingException.
Register a `PersistentSettingsHandler` to deal with client settings, in both the CLI and the GUI clients.
Register a temporary PersistentSettingsHandler for daemon settings in the client, in order to keep feature parity until we introduce routing handlers.
Temporarily derive path for daemon settings in client, to keep feature parity until we introduce routing handlers.
Transfer comment from old to new filename deriving functions, to preserve the info therein.
To allow mocking.
To be coherent with client side.
Generalize test file to test both client- and daemon-registered settings handlers.
Fixes constant getting garbage when compiled with MSVC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kinda fun that git decided mock_settings.cpp
is now basic_settings_spec.cpp
🤷.
First pass through roughly a half of this :)
OK, finally circling back to this :)
I know! I was also surprised, but I guess the difference between them was smaller than a threshold. I bet there's a way to tell git otherwise... |
It is not a default at all. Addresses review request.
Declare compilation units for the tests executable in alphabetical order. The order was already questionable in places, but got worse with new test files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, just going through the tests now but wanted to register what I have. Tiny bits.
And kudos on this, it's a big one!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last thing is, this needs a rebase / merge :)
Other than that - works well, too :)
Applies review suggestions. Co-authored-by: Michał Sawicz <michal.sawicz@canonical.com>
As per review request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup. Will review the other side and merge first thing tomorrow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found a problem with the passphrase handling. When you multipass set local.passphrase=""
, we need the stored passphrase to actually be blank:
# current
$ multipass version
multipass 1.10.0-dev.591.ci2957+g446817e7.mac
multipassd 1.10.0-dev.591.ci2957+g446817e7.mac
$ sudo multipass set local.passphrase=""
$ sudo multipass get local.passphrase
false
$ sudo cat /var/root/Library/Preferences/multipassd/multipassd.conf
[General]
local.passphrase=
# update
$ sudo installer -target / -dumplog -verbose -pkg multipass-1.10.0-dev.886.pr2352+g17e3ebc8.mac-Darwin.pkg
$ sudo multipass get local.passphrase
false
# but then
$ multipass set local.passphrase=""
$ multipass get local.passphrase
true
$ sudo cat /var/root/Library/Preferences/multipassd/multipassd.conf
[General]
local.passphrase=d72c87d0f077c7766f2985dfab30e8955c373a13a1e93d315203939f542ff86e73ee37c31f4c4b571f4719fa8e3589f12db8dcb57ea9f56764bb7d58f64cf705
Hmm good catch. Will dig. |
Check that the input password is hashed and reset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup!
All good now :)
bors merge
(I know you won't :P)
Build failed:
|
This PR implements settings handlers.