mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-13 12:35:05 +00:00
feat(service): add wait_for_approval and return the cache for a login with no prompt
A pair code shown in a log line never answers a prompt, so the server read that login as anonymous and kept the session cache.
This commit is contained in:
@@ -96,19 +96,6 @@ def test_status_setter() -> None:
|
||||
assert bridge.status is AuthStatus.AUTHENTICATED
|
||||
|
||||
|
||||
def test_answered_only_after_an_accepted_response() -> None:
|
||||
bridge = InputBridge()
|
||||
assert bridge.submit_response("early") is False
|
||||
assert bridge.answered is False
|
||||
worker = threading.Thread(target=bridge.request_input, args=("code?",))
|
||||
worker.start()
|
||||
while bridge.status != AuthStatus.PENDING_INPUT:
|
||||
time.sleep(0.01)
|
||||
assert bridge.submit_response("CODE") is True
|
||||
worker.join(timeout=2)
|
||||
assert bridge.answered is True
|
||||
|
||||
|
||||
def test_request_input_after_authentication_fails_fast() -> None:
|
||||
"""The client stops polling for prompts once authenticated, so a later prompt must not wait for an answer."""
|
||||
bridge = InputBridge()
|
||||
|
||||
Reference in New Issue
Block a user