Skip to content

v0.3.12#85

Merged
jotuel merged 9 commits intomainfrom
v0.3.12
Feb 22, 2026
Merged

v0.3.12#85
jotuel merged 9 commits intomainfrom
v0.3.12

Conversation

@jotuel
Copy link
Member

@jotuel jotuel commented Feb 22, 2026

Slight performance increase from not copying but using reference. Increase test coverage. Username is validated and config loaded asynchronously.

google-labs-jules bot and others added 9 commits February 21, 2026 18:14
Introduced `validate_username` helper function in `src/app/fprint.rs` to enforce strict validation (alphanumeric, -, _, ., max 255 chars) on usernames before passing them to privileged `fprintd` D-Bus methods. This mitigates potential injection risks or malformed data issues.

Applied validation to:
- `list_enrolled_fingers_dbus`
- `delete_fingerprint_dbus`
- `delete_fingers`
- `clear_all_fingers_dbus`
- `enroll_fingerprint_process`

Added unit tests to verify validation logic.
This commit introduces a new `tests` module in `src/app/error.rs` to verify the `From<zbus::Error>` implementation for `AppError`.

It includes:
- A helper function `create_method_error` to construct `zbus::Error::MethodError` with a dummy D-Bus message.
- Test cases for all mapped `net.reactivated.Fprint.Error.*` strings.
- Test cases for unknown errors and non-MethodError variants to ensure correct fallback to `AppError::Unknown`.

This improves test coverage for critical error handling logic.
test: verify zbus::Error to AppError conversion
… cloning

Refactor `enroll_fingerprint_process` to accept references (`&zbus::zvariant::OwnedObjectPath`, `&str`) instead of owned types for `path`, `finger_name`, and `username`. This eliminates the need to clone `String` and `OwnedObjectPath` data on every iteration of the enrollment subscription loop in `AppModel`.

*   Modified `src/app/fprint.rs`: Updated `enroll_fingerprint_process` signature.
*   Modified `src/app/mod.rs`: Updated subscription logic to pass references.
…529251015568

⚡ Async Config Loading Optimization
…333057639684485

⚡ Optimize enrollment subscription by avoiding unnecessary string cloning
…4448153143460

🔒 Security Fix: Validate username in D-Bus calls
@jotuel jotuel merged commit 959bfe6 into main Feb 22, 2026
1 check passed
@jotuel jotuel deleted the v0.3.12 branch February 22, 2026 18:57
jotuel added a commit that referenced this pull request Feb 25, 2026
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.

1 participant