-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
FDO Secrets GUI separation #8591
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
base: develop
Are you sure you want to change the base?
FDO Secrets GUI separation #8591
Conversation
Codecov ReportBase: 64.44% // Head: 64.34% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## develop #8591 +/- ##
===========================================
- Coverage 64.44% 64.34% -0.11%
===========================================
Files 340 345 +5
Lines 44142 44053 -89
===========================================
- Hits 28446 28342 -104
- Misses 15696 15711 +15
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
|
This is great! I've been wanting to separate the logic from GUI ever since I first touched the codebase, but it was not possible as FdoSecrets needs an object representing the database consistently whether it's locked or not. And @Neverous I just look at your description and not the code yet, so the following might not be applicable. I'm just dumping what I have in mind originally, in case it's helpful: I think I already tried to separate bits related to GUI fairly well, some notable points
Regarding tests, unit tests should cover all the things I care about. The tests are implemented in a way that also covers the D-Bus code path (It will actually go through all the D-Bus message mangle/demangle). For extra certainty, you could try running tests from external projects, like python-secretstorage, against KPXC. |
|
I would assume running fdosecrets on cli means running the program as a service, in which case there's no TTY. It can also call another binary to display the dialog and get responses, like |
Usually true. There's no guarantee of a desktop environment, either. If there isn't a desktop, there's at least the currently active CLI session's TTY. But then again, I don't know a lot of CLI programs that would need Secret Service. Mostly python scripts.
For simple text prompts like the master password, there's the whole Then there's the possibility of key files and YubiKeys, or multiple databases, so a simple text prompt may not be enough. So really, if OP wants to run this headless, there should be some automated way to select the DB and provide credentials, then treat all other prompts as disabled after that. Maybe providing credentials only at startup is enough. This can be configurable, since even among those who may not want to run the main GUI, not everyone would be running this headless and without a desktop. But probably start with the simpler option first. |
Almost, there was also for example As for After moving the GUI stuff all into one place, the "user actions" that are possible from the FdoSecrets integration seems to be:
And for anyone curious my current setup for CLI (not very beautiful but will probably push PR of it in the future, if only for reference, but probably after this is cleaned up 😛 ), kind of as michaelk83 predicted above, is pretty basic: as I am connecting to the remote instance I run CLI ( |
|
Hi @Neverous, any updates on this? I plan to work on some new features that will touch both the UI and the logic part. Since this PR changes the code structure significantly, I want to check if I should base my work on this branch to avoid merge conflicts if this PR is more or less in a ready state. Otherwise, I'll still need to base on the latest develop branch, and there will be more conflicts. |
|
Well I'm waiting for a review 🤔? |
6e69916 to
e155cc4
Compare
|
Yes we will have to merge the cleanup first before this one. Your code changes are fine we will get to this in due time ;-) |
|
Hmm, what would happen if you ran the secret service in the CLI and then started the GUI? Do you plan on making them compatible in a "daemon/client" sort of way, or would they just conflict? |
|
Bump on the big PRs, now that 2.7.11 has landed, @droidmonkey : (Please try to prioritize the big stuff over feature creeping smaller fixes. Else you'll never get to 2.8.0...) |
|
Probably qt6 second but yes that is what I am tracking. |
I'm trying to run KeePassXC headless with CLI mode.
But I also like to keep using Freedesktop.org Secret Service integration as my keyring provider for various other applications on the remote to access secrets I keep in the database.
Unfortunately current fdosecrets implementation is heavily dependent on GUI and is not supported in CLI mode.
This PR is a first part of trying to make fdosecrets work with CLI. It only focuses on separating fdosecrets internals from GUI, which I think is worth even of itself?
To that end I moved all the methods that directly depended on GUI to the top-level
FdoSecretsPluginGUIimplementation using virtual methods (allowing to later makeFdoSecretsPluginCLIthat will replace those methods with CLI supporting versions).Since the plugin relied heavily on GUI objects (
DatabaseWidgetandDatabaseTabWidget) it turned into quite a big refactoring while trying to move them out 😰, we'll see how it goes.Other notable things:
loop.exec()in random places just to fetch the actually needed values out of UI responses (essentially movedloop.exec()s into them wherever necessary), this also simplified D-Bus Prompts making them all synchronous as well.src/Gui/group/GroupModel.cppI had to add the links to the group model object inQObject::connectas otherwise the signals links could outlive the objects and throw errors (caught randomly during testing). And similar in some otherQObject::connects.Screenshots
N/A
Testing strategy
Type of change