Administratively merging because @vltr and @ahopkins are the release managers, and @ahopkins is originator of the PR
* Add Python 3.10 testing (and support)
* fixed py310 tox environment for windows, quoted '3.10' in python-310 tests to avoid numeric compression
* updated tox.ini for py310
* quoted the rest of the bare 3.10 references in the workflows
* Issue with pytest requires version bump to 6.2.5 for python 3.10
Co-authored-by: Stephen Sadowski <stephen.sadowski@sjsadowski.com>
* Initial support for using multiple SSL certificates.
* Also list IP address subjectAltNames on log.
* Use Python 3.7+ way of specifying TLSv1.2 as the minimum version. Linter fixes.
* isort
* Cleanup, store server name for later use. Add RSA ciphers. Log rejected SNIs.
* Cleanup, linter.
* Alter the order of initial log messages and handling. In particular, enable debug mode early so that debug messages during init can be shown.
* Store server name (SNI) to conn_info.
* Update test with new error message.
* Refactor for readability.
* Cleanup
* Replace old expired test cert with new ones and a script for regenerating them as needed.
* Refactor TLS tests to a separate file.
* Add cryptography to dev deps for rebuilding TLS certs.
* Minor adjustment to messages.
* Tests added for new TLS code.
* Find the correct log row before testing for message. The order was different on CI.
* More log message order fixup. The tests do not account for the logo being printed first.
* Another attempt at log message indexing fixup.
* Major TLS refactoring.
CertSelector now allows dicts and SSLContext within its list.
Server names are stored even when no list is used.
SSLContext.sanic now contains a dict with any setting passed and information extracted from cert.
That information is available on request.conn_info.cert.
Type annotations added.
More tests incl. a handler for faking hostname in tests.
* Remove a problematic logger test that apparently was not adding any coverage or value to anything.
* Revert accidental commit of uvloop disable.
* Typing fixes / refactoring.
* Additional test for cert selection. Certs recreated without DNS:localhost on sanic.example cert.
* Add tests for single certificate path shorthand and SNI information.
* Move TLS dict processing to CertSimple, make the names field optional and use names from the cert if absent.
* Sanic CLI options --tls and --tls-strict-host to use the new features.
* SSL argument typing updated
* Use ValueError for internal message passing to avoid CertificateError's odd message formatting.
* Linter
* Test CLI TLS options.
* Maybe the right codeclimate option now...
* Improved TLS argument help, removed support for combining --cert/--key with --tls.
* Removed support for strict checking without any certs, black forced fscked up formatting.
* Update CLI tests for stricter TLS options.
Co-authored-by: L. Karkkainen <tronic@users.noreply.github.com>
Co-authored-by: Adam Hopkins <admhpkns@gmail.com>
* First attempt at new Websockets implementation based on websockets >= 9.0, with sans-i/o features. Requires more work.
* Update sanic/websocket.py
Co-authored-by: Adam Hopkins <adam@amhopkins.com>
* Update sanic/websocket.py
Co-authored-by: Adam Hopkins <adam@amhopkins.com>
* Update sanic/websocket.py
Co-authored-by: Adam Hopkins <adam@amhopkins.com>
* wip, update websockets code to new Sans/IO API
* Refactored new websockets impl into own modules
Incorporated other suggestions made by team
* Another round of work on the new websockets impl
* Added websocket_timeout support (matching previous/legacy support)
* Lots more comments
* Incorporated suggested changes from previous round of review
* Changed RuntimeError usage to ServerError
* Changed SanicException usage to ServerError
* Removed some redundant asserts
* Change remaining asserts to ServerErrors
* Fixed some timeout handling issues
* Fixed websocket.close() handling, and made it more robust
* Made auto_close task smarter and more error-resilient
* Made fail_connection routine smarter and more error-resilient
* Further new websockets impl fixes
* Update compatibility with Websockets v10
* Track server connection state in a more precise way
* Try to handle the shutdown process more gracefully
* Add a new end_connection() helper, to use as an alterative to close() or fail_connection()
* Kill the auto-close task and keepalive-timeout task when sanic is shutdown
* Deprecate WEBSOCKET_READ_LIMIT and WEBSOCKET_WRITE_LIMIT configs, they are not used in this implementation.
* Change a warning message to debug level
Remove default values for deprecated websocket parameters
* Fix flake8 errors
* Fix a couple of missed failing tests
* remove websocket bench from examples
* Integrate suggestions from code reviews
Use Optional[T] instead of union[T,None]
Fix mypy type logic errors
change "is not None" to truthy checks where appropriate
change "is None" to falsy checks were appropriate
Add more debug logging when debug mode is on
Change to using sanic.logger for debug logging rather than error_logger.
* Fix long line lengths of debug messages
Add some new debug messages when websocket IO is paused and unpaused for flow control
Fix websocket example to use app.static()
* remove unused import in websocket example app
* re-run isort after Flake8 fixes
Co-authored-by: Adam Hopkins <adam@amhopkins.com>
Co-authored-by: Adam Hopkins <admhpkns@gmail.com>
* Add some tests
* docstring
* Add accept matching
* Add some more tests on matching
* Add matching flags for wildcards
* Add mathing controls to accept
* Limit uvicorn 14 in testing
* Update some tests
* Resolve#2122 route decorator returning tuple
* Use rc sanic-routing version
* Update unit tests to <:str>
* Minimal working version with some signals implemented
* Add more http signals
* Update ASGI and change listeners to signals
* Allow for dynamic ODE signals
* Allow signals to be stacked
* Begin tests
* Prioritize match_info on keyword argument injection
* WIP on tests
* Compat with signals
* Work through some test coverage
* Passing tests
* Post linting
* Setup proper resets
* coverage reporting
* Fixes from vltr comments
* clear delayed tasks
* Fix bad test
* rm pycache
* Update sanic-routing to fix path issues plus lookahead / lookbehind support
* Update setup.py
Co-authored-by: Adam Hopkins <adam@amhopkins.com>
Co-authored-by: Adam Hopkins <admhpkns@gmail.com>
* Fix the handling of the end of a chunked request.
* Avoid hardcoding final chunk header size.
* Add some unit tests for pipeline body reading
* Decode bytes for json serialization
Co-authored-by: L. Kärkkäinen <tronic@users.noreply.github.com>
Co-authored-by: Adam Hopkins <adam@amhopkins.com>
* Remove duplicated dependencies
* Specify setuptools as the tool for generating distribution (PEP 517)
* Add `isort` to `dev_require`
* manage all dependencies in setup.py
* Execute `make pretty`
* Set usedevelop to true (revert previous change)
* fix-#1856: adjust websockets version to setup.py and make nightly (py39) tests pass
* fix-#1856: set min websockets version to 8.1
* fix-#1856: suppress timeout for CI to pass
* fix-#1856: timeout -> close_timeout due to deprecation warning
Co-authored-by: Adam Hopkins <admhpkns@gmail.com>
Co-authored-by: 7 <yunxu1992@gmail.com>
* Begin swap of requests-async for httpx
* Finalize httpx adoption and resolve tests
Resolve linting and formatting
* Remove documentation references to requests-async in favor of httpx
Bandit is a python package for staticly scanning code for security issues.
* Added to tox.ini
* Added to setup.py
* Added to .travis.yml
As part of CI/CD pipeline
Update all tests to be compatible with requests-async
Cleanup testing client changes with black and isort
Remove Python 3.5 and other meta doc cleanup
rename pyproject and fix pep517 error
Add black config to tox.ini
Cleanup tests and remove aiohttp
tox.ini change for easier development commands
Remove aiohttp from changelog and requirements
Cleanup imports and Makefile