-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable auth test in test_base_scraper.py #597
Conversation
- Adds a custom auth handler and register a route - Overrides the `decode_basic` method of request.Authentication - uses the right base64 decode function and fixes the bytes/str error - enables the auth tests
@kaushiksk thank you for the fix! There were test failures on MacOS for the Python3 job, but I just fixed those. I will have a look at the PR in a moment. |
@jgraham, could you please release a new version of wptserve on PyPI, so that we could depend on the fixed code? Thanks. |
The new version of wptserve will be released via web-platform-tests/wpt#22412. |
@kaushiksk the wptserve 3.0 package has been released to PyPI: Would you mind updating your PR? Thanks! |
@whimboo I'll update my PR with the changes! |
- Use request.Authentication since now wptserve==3.0 - Hardcode username and password - Rename `http_auth_handler` to `basic_auth_handler` - Rename `test_url` to `basic_auth_url`
Thanks a lot for this addition. It's great to finally have authentication tests working again! If you are eager to pick-up some more issues I'm happy to assist in whatever you need. |
Fixes #492
decode_basic
method of request.AuthenticationThe
decode_basic
call inrequest.Authentication
would fail in py3 as it usesbase64.decodestring
which expects a byte-like array. Hence overrode this to usebase64.b64decode
NOTE:
wptserve==2.0 from PyPI has this issue. wptserve has since been moved to https://github.com/web-platform-tests/wpt where this has been fixed.