- Deleted test_auth.py (auth no longer exists) - Rewrote TestOrderDelayRoute -> TestRootRedirectWithOrderDelay using query params - Updated TestHashPageWithRefresh to use ?order=...&delay=... URLs - Added play button query param assertion in TestHashPage - Removed password=None from test_navigation.py seeded_indexers fixture - Formatted with black, all 59 tests passing
2.5 KiB
2.5 KiB
TODO
Goal
Remove all authentication from the server and convert order/delay from path parameters to query parameters.
Tasks
1. Remove authentication from main.py
- Remove
HTTPBasic,HTTPBasicCredentials,Dependsimports (where used for auth) - Remove
security,expected_password,get_current_username, andset_auth_passwordcode - Remove
--passwordCLI argument - Remove
set_auth_password(args.password)call from__main__ - Remove
username: str = Depends(get_current_username)from all route handlers
2. Convert order/delay to query parameters in main.py
- Merge
hash_pageandhash_page_with_refreshinto a single/{file_hash}endpoint that accepts optional query paramsorder(str, default None) anddelay(int, default None) - Remove the
/{order}/{delay}redirect route - Remove the
/{order}/{delay}/{file_hash}route - Update
rootendpoint to accept optionalorder/delayquery params and pass them through in the redirect URL - Update
_render_pageto generate URLs with query params (/{hash}?order=next&delay=5) instead of path segments - Update the play/pause button URLs to use query param format
3. Update conftest.py
- Remove
_dummy_auth_headerfunction andAuthorizationheader fromclient_dir/client_zipfixtures - Remove
set_auth_password(None)calls frominitialized_dir/initialized_zipfixtures - Remove
passwordfield fromargs_directory/args_zipfixtures (or keep as None if still in argparse)
4. Update test_auth.py
- Delete the entire
test_auth.pyfile (all auth tests are no longer relevant)
5. Update test_endpoints.py
- Update
TestOrderDelayRoutetests — remove or rewrite for query param routes - Update
TestHashPageWithRefreshtests to use query param URLs (/{hash}?order=next&delay=5) - Update
TestHashPagetests if needed (play button URLs changed)
6. Update test_navigation.py
- Remove
password=Nonefromseeded_indexersfixture args (if--passwordarg is removed)
7. Format and verify
- Run
uv run black .to format all code - Run
uv run pytestto verify all tests pass
Notes
- After removing auth, the
--passwordCLI arg is gone entirely - Query param format:
/{file_hash}?order=next&delay=5 - The
orderquery param accepts"next"or"random"(validated same as before) - When
order/delayare absent, behavior is identical to current browse mode