Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1ed42d51d1 | |||
| a05c2030e8 | |||
| 22f725e4ac | |||
| b8e060b850 |
+2
-1
@@ -4,7 +4,7 @@
|
||||
# Maintainer: Dominik Kressler
|
||||
|
||||
pkgname=moonlock-git
|
||||
pkgver=0.0.0.r9.b365572
|
||||
pkgver=0.1.1.r0.g22f725e
|
||||
pkgrel=1
|
||||
pkgdesc="A secure Wayland lockscreen with GTK4, PAM and fingerprint support"
|
||||
arch=('any')
|
||||
@@ -38,6 +38,7 @@ pkgver() {
|
||||
|
||||
build() {
|
||||
cd "$srcdir/moonlock"
|
||||
rm -rf dist/
|
||||
python -m build --wheel --no-isolation
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "moonlock"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
description = "A secure Wayland lockscreen with GTK4, PAM and fingerprint support"
|
||||
requires-python = ">=3.11"
|
||||
license = "MIT"
|
||||
|
||||
@@ -143,7 +143,8 @@ class FingerprintListener:
|
||||
return
|
||||
|
||||
if status in _RETRY_STATUSES:
|
||||
# Retry silently — finger wasn't read properly
|
||||
# Retry — finger wasn't read properly
|
||||
if done:
|
||||
self._device_proxy.VerifyStart("(s)", "any")
|
||||
return
|
||||
|
||||
@@ -151,5 +152,6 @@ class FingerprintListener:
|
||||
if self._on_failure:
|
||||
self._on_failure()
|
||||
# Restart verification for another attempt
|
||||
if done:
|
||||
self._device_proxy.VerifyStart("(s)", "any")
|
||||
return
|
||||
|
||||
@@ -12,7 +12,7 @@ window.lockscreen {
|
||||
.login-box {
|
||||
padding: 40px;
|
||||
border-radius: 12px;
|
||||
background-color: alpha(@theme_bg_color, 0.7);
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
/* Round avatar image */
|
||||
|
||||
@@ -90,7 +90,22 @@ class TestFingerprintSignalHandling:
|
||||
|
||||
on_success.assert_called_once()
|
||||
|
||||
def test_verify_no_match_calls_on_failure_and_retries(self):
|
||||
def test_verify_no_match_calls_on_failure_and_retries_when_done(self):
|
||||
listener = FingerprintListener.__new__(FingerprintListener)
|
||||
listener._device_proxy = MagicMock()
|
||||
listener._running = True
|
||||
on_success = MagicMock()
|
||||
on_failure = MagicMock()
|
||||
listener._on_success = on_success
|
||||
listener._on_failure = on_failure
|
||||
|
||||
listener._on_verify_status("verify-no-match", True)
|
||||
|
||||
on_failure.assert_called_once()
|
||||
# Should restart verification when done=True
|
||||
listener._device_proxy.VerifyStart.assert_called_once_with("(s)", "any")
|
||||
|
||||
def test_verify_no_match_calls_on_failure_without_restart_when_not_done(self):
|
||||
listener = FingerprintListener.__new__(FingerprintListener)
|
||||
listener._device_proxy = MagicMock()
|
||||
listener._running = True
|
||||
@@ -102,10 +117,10 @@ class TestFingerprintSignalHandling:
|
||||
listener._on_verify_status("verify-no-match", False)
|
||||
|
||||
on_failure.assert_called_once()
|
||||
# Should restart verification for retry
|
||||
listener._device_proxy.VerifyStart.assert_called_once_with("(s)", "any")
|
||||
# Should NOT restart verification when done=False (still in progress)
|
||||
listener._device_proxy.VerifyStart.assert_not_called()
|
||||
|
||||
def test_verify_swipe_too_short_retries_without_failure(self):
|
||||
def test_verify_swipe_too_short_retries_when_done(self):
|
||||
listener = FingerprintListener.__new__(FingerprintListener)
|
||||
listener._device_proxy = MagicMock()
|
||||
listener._running = True
|
||||
@@ -119,3 +134,19 @@ class TestFingerprintSignalHandling:
|
||||
on_success.assert_not_called()
|
||||
on_failure.assert_not_called()
|
||||
listener._device_proxy.VerifyStart.assert_called_once_with("(s)", "any")
|
||||
|
||||
def test_retry_status_does_not_restart_when_not_done(self):
|
||||
listener = FingerprintListener.__new__(FingerprintListener)
|
||||
listener._device_proxy = MagicMock()
|
||||
listener._running = True
|
||||
on_success = MagicMock()
|
||||
on_failure = MagicMock()
|
||||
listener._on_success = on_success
|
||||
listener._on_failure = on_failure
|
||||
|
||||
listener._on_verify_status("verify-swipe-too-short", False)
|
||||
|
||||
on_success.assert_not_called()
|
||||
on_failure.assert_not_called()
|
||||
# Should NOT restart — verification still in progress
|
||||
listener._device_proxy.VerifyStart.assert_not_called()
|
||||
|
||||
@@ -74,8 +74,23 @@ class TestFingerprintAuthFlow:
|
||||
listener._on_verify_status("verify-match", False)
|
||||
assert len(unlock_called) == 1
|
||||
|
||||
def test_fingerprint_no_match_retries(self):
|
||||
"""verify-no-match should retry verification."""
|
||||
def test_fingerprint_no_match_retries_when_done(self):
|
||||
"""verify-no-match with done=True should call on_failure and restart verification."""
|
||||
from moonlock.fingerprint import FingerprintListener
|
||||
|
||||
listener = FingerprintListener.__new__(FingerprintListener)
|
||||
listener._device_proxy = MagicMock()
|
||||
listener._running = True
|
||||
listener._on_success = MagicMock()
|
||||
listener._on_failure = MagicMock()
|
||||
|
||||
listener._on_verify_status("verify-no-match", True)
|
||||
|
||||
listener._on_failure.assert_called_once()
|
||||
listener._device_proxy.VerifyStart.assert_called_once()
|
||||
|
||||
def test_fingerprint_no_match_no_restart_when_not_done(self):
|
||||
"""verify-no-match with done=False should call on_failure but not restart."""
|
||||
from moonlock.fingerprint import FingerprintListener
|
||||
|
||||
listener = FingerprintListener.__new__(FingerprintListener)
|
||||
@@ -87,7 +102,7 @@ class TestFingerprintAuthFlow:
|
||||
listener._on_verify_status("verify-no-match", False)
|
||||
|
||||
listener._on_failure.assert_called_once()
|
||||
listener._device_proxy.VerifyStart.assert_called_once()
|
||||
listener._device_proxy.VerifyStart.assert_not_called()
|
||||
|
||||
def test_fingerprint_and_password_independent(self):
|
||||
"""Both auth methods should work independently."""
|
||||
|
||||
Reference in New Issue
Block a user