Skip to content

server: kde plasma prompter support#371

Merged
bilelmoussaoui merged 1 commit into
linux-credentials:mainfrom
hsitter:work/sitter/plasmav2api
Jan 12, 2026
Merged

server: kde plasma prompter support#371
bilelmoussaoui merged 1 commit into
linux-credentials:mainfrom
hsitter:work/sitter/plasmav2api

Conversation

@hsitter
Copy link
Copy Markdown
Contributor

@hsitter hsitter commented Dec 17, 2025

the prompter UI currently lives at
https://invent.kde.org/mart/ksecretprompter and hopefully will make its way into plasma 6.6 (scheduled for february 2026)

Copy link
Copy Markdown
Collaborator

@bilelmoussaoui bilelmoussaoui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what are chances of mocking the plasma prompter like we have for gnome at https://github.com/bilelmoussaoui/oo7/blob/main/server/src/tests.rs#L210-L432? and we could potentially run the tests using first gnome prompter then the plasma one

Comment thread server/src/plasma/prompter.rs
Comment thread server/src/plasma/prompter.rs Outdated
Comment thread server/src/plasma/prompter.rs Outdated
Comment thread server/src/plasma/prompter.rs Outdated
@bilelmoussaoui
Copy link
Copy Markdown
Collaborator

Let me know if you need help pushing this forward, as i will be doing a new release the upcoming week or so :)

@hsitter
Copy link
Copy Markdown
Contributor Author

hsitter commented Jan 7, 2026

Sorry, vacation got in the way ⛷️ 😄

@hsitter hsitter force-pushed the work/sitter/plasmav2api branch from de1c190 to 19fe595 Compare January 7, 2026 14:56
Comment thread server/src/plasma/prompter.rs Outdated
@hsitter hsitter force-pushed the work/sitter/plasmav2api branch 3 times, most recently from e8d5078 to 77c15f1 Compare January 8, 2026 11:00
Comment thread server/src/plasma/prompter.rs Outdated
Comment thread server/src/plasma/prompter.rs Outdated
Comment thread server/src/prompt/mod.rs Outdated
Comment thread server/src/main.rs
@hsitter hsitter force-pushed the work/sitter/plasmav2api branch from 77c15f1 to 6feabe1 Compare January 8, 2026 12:31
@hsitter
Copy link
Copy Markdown
Contributor Author

hsitter commented Jan 8, 2026

Alrighty. New revision:

  • server now has four new features plasma, gnome_native_crypto, gnome_openssl_crypto, and gnome.
  • plasma and gnome_native_crypto are enabled by default. plasma has runtime detection and may fall through to gnome (i.e. things remain working on older plasma versions too)
  • disabling all "backends" will result in compilation errors
  • a lot of the plasma init code has moved from the prompt module to the plasma module. into a new start function
  • in_plasma_environment now uses oncelock with lazy init instead of oncecell. lazycell didn't compile here because it can't be shared between threads

one big open topic is testing still

@hsitter hsitter force-pushed the work/sitter/plasmav2api branch from 6feabe1 to 59a90ac Compare January 9, 2026 05:24
@hsitter
Copy link
Copy Markdown
Contributor Author

hsitter commented Jan 9, 2026

Now also includes a mock prompter for testing. I am not a 100% happy with how the diff looks right now, certainly is very noisy, but I guess it's a start.

There now is a prompters() function for tests that returns a vector of "Activators". The activators encapsulate what is necessary to activate a given prompter. e.g. force plasma detection on or off as necessary. The relevant tests now for-loop over those activators to run the same test for both prompters.

I've somewhat clumsily forked a MockPrompterServicePlasma from the gnome variant. We might want to refactor this a bit so we don't have to call the setters on both mocks. On the other hand there are only a handful of those calls anyway.

e.g.

https://github.com/bilelmoussaoui/oo7/blob/59a90ac4e7061f9804ad6d60ecb5eac9d24fbda3/server/src/collection/tests.rs#L693-L708

The static IS_PLASMA was reshuffled again and is now a thread local mutable so we can toggle plasma-behavior at runtime in tests. Looks a bit awkward.

@hsitter hsitter force-pushed the work/sitter/plasmav2api branch from 59a90ac to 1249854 Compare January 9, 2026 05:52
Comment thread server/src/tests.rs Outdated
Comment thread server/src/tests.rs Outdated
Comment thread server/src/tests.rs Outdated
Comment thread server/src/tests.rs Outdated
@hsitter hsitter force-pushed the work/sitter/plasmav2api branch 3 times, most recently from 311bc3c to 4418918 Compare January 12, 2026 07:43
@hsitter
Copy link
Copy Markdown
Contributor Author

hsitter commented Jan 12, 2026

I've added some fmt fixes. Also I've renamed the features so we don't break backwards compatibility (and hopefully the CI actions pass :D): native_crypto and openssl_crypto now imply gnome

@bilelmoussaoui
Copy link
Copy Markdown
Collaborator

The CI is failing because of an update of zbus, please run cargo update and push that in a separate commit, it should unbreak the build at least.

Copy link
Copy Markdown
Collaborator

@bilelmoussaoui bilelmoussaoui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

almost there.

Comment thread server/src/collection/tests.rs Outdated
Comment thread server/src/plasma/prompter.rs Outdated
Comment thread server/src/plasma/prompter.rs Outdated
Comment thread server/src/plasma/prompter.rs Outdated
Comment thread server/src/service/tests.rs Outdated
Comment thread server/src/tests.rs Outdated
Comment thread server/src/plasma/prompter.rs Outdated
@bilelmoussaoui
Copy link
Copy Markdown
Collaborator

The CI is failing because of an update of zbus, please run cargo update and push that in a separate commit, it should unbreak the build at least.

Took care of that along with adding a gnome feature that disables everything gnome related

@hsitter hsitter force-pushed the work/sitter/plasmav2api branch from 4418918 to 903185b Compare January 12, 2026 12:02
@hsitter
Copy link
Copy Markdown
Contributor Author

hsitter commented Jan 12, 2026

All comments should be addressed.

Seems the gnome conditionals broke for the tests. I've fixed it in my commit for now.

Copy link
Copy Markdown
Collaborator

@bilelmoussaoui bilelmoussaoui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise lgtm

Comment thread server/src/plasma/prompter.rs
Comment thread server/src/tests.rs
going to be part of the upcoming Plasma 6.6 release
@hsitter hsitter force-pushed the work/sitter/plasmav2api branch from 903185b to c08d063 Compare January 12, 2026 12:19
Copy link
Copy Markdown
Collaborator

@bilelmoussaoui bilelmoussaoui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will merge once the CI passes

@bilelmoussaoui bilelmoussaoui merged commit 5f73e80 into linux-credentials:main Jan 12, 2026
7 of 9 checks passed
@bilelmoussaoui
Copy link
Copy Markdown
Collaborator

Thanks a lot!

@hsitter
Copy link
Copy Markdown
Contributor Author

hsitter commented Jan 12, 2026

Yay! Thank you for the reviews and patience 😃

@bilelmoussaoui
Copy link
Copy Markdown
Collaborator

@hsitter Hey there, it seems like the current tests never hit the "dismissed" code path, could you please add a test case / extend current one, to cover that? There is also a new PromptRole::ChangePassword but it is only used by some backward compatibility gnome-keyring specific interface for now, we might support that in the future as part of the secret service specification but that would need a lot more than just a test case. If you can cover that as part of the test already, that would be great as well.

https://linux-credentials.github.io/oo7/coverage/server/src/plasma/index.html might be useful.

@hsitter
Copy link
Copy Markdown
Contributor Author

hsitter commented Apr 2, 2026

👍 It may take me a couple weeks to get to it though.

@bilelmoussaoui
Copy link
Copy Markdown
Collaborator

No worries at all, thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants