pyvider
2025-02-14
Rewrote `ClientConnection` to support dependency injection for I/O functions
56 files · 2,205+ · 1,942-
ClientConnection Dependency Injection
48 files changed
__init__.pyUpdated __init__.py (+0/-0 lines)interceptor.pyUpdated interceptor.py (+0/-0 lines)reflection.pyUpdated reflection.py (+0/-0 lines)__main__.pyUpdated __main__.py (+5/-15 lines)base.pyUpdated base.py (+14/-8 lines)provider.pyUpdated provider.py (+2/-7 lines)__init__.pyUpdated __init__.py (+1/-2 lines)broke-server.pyRemoved broke-server.py (-149 lines)test_client_grpc.pyRemoved test_client_grpc.py (-151 lines)test_server_two.pyRemoved test_server_two.py (-239 lines)base.pyRemoved base.py (-4 lines)connection.pyUpdated connection.py (+72/-46 lines)certificate.pyUpdated certificate.py (+3/-2 lines)2025-02-15-0954-invalid-cookie-hard-crash.mdAdded 2025-02-15-0954-invalid-cookie-hard-crash.md (+100 lines)kv_protocol.pyUpdated kv_protocol.py (+8/-11 lines)handshake.pyUpdated handshake.py (+190/-175 lines)example.protoRemoved example.proto (-36 lines)example_pb2.pyRemoved example_pb2.py (-44 lines)example_pb2_grpc.pyRemoved example_pb2_grpc.py (-188 lines)example_server.pyRemoved example_server.py (-31 lines)mock_message.protoRemoved mock_message.proto (-6 lines)mock_message_pb2.pyRemoved mock_message_pb2.py (-36 lines)mock_message_pb2_grpc.pyRemoved mock_message_pb2_grpc.py (-23 lines)mock_server.pyRemoved mock_server.py (-63 lines)protocol.pyUpdated protocol.py (+9/-9 lines)server.pyUpdated server.py (+125/-166 lines)test_connection.pyUpdated test_connection.py (+3/-1 lines)conftest.pyUpdated conftest.py (+15/-61 lines)test_certificate_chains.pyUpdated test_certificate_chains.py (+33/-18 lines)test_certificate_credentials.pyUpdated test_certificate_credentials.py (+9/-5 lines)test_certificate_lifecycle.pyUpdated test_certificate_lifecycle.py (+9/-7 lines)test_certificate_loading.pyUpdated test_certificate_loading.py (+50/-27 lines)test_certificate_mtls.pyUpdated test_certificate_mtls.py (+9/-4 lines)test_certificate_properties.pyUpdated test_certificate_properties.py (+43/-22 lines)test_certificate_verify.pyAdded test_certificate_verify.py (+2 lines)test_crypto.pyUpdated test_crypto.py (+7/-2 lines)__init__.pyAdded __init__.py (+6 lines)crypto.pyUpdated crypto.py (+72/-8 lines)handshake.pyAdded handshake.py (+33 lines)test_handshake_magic_cookie.pyUpdated test_handshake_magic_cookie.py (+9/-18 lines)test_handshake_negotiation.pyUpdated test_handshake_negotiation.py (+6/-22 lines)test_handshake_responses.pyUpdated test_handshake_responses.py (+18/-40 lines)test_server.pyUpdated test_server.py (+12/-9 lines)test_server_coverage.pyUpdated test_server_coverage.py (+15/-10 lines)test_server_coverage_extra.pyUpdated test_server_coverage_extra.py (+18/-12 lines)test_server_destructor_cleanup.pyUpdated test_server_destructor_cleanup.py (+17/-11 lines)types.pyUpdated types.py (+1/-3 lines)bfiles-20250215-003223.txtAdded bfiles-20250215-003223.txt (+1142 lines)
- Added
SendFuncTypeandReceiveFuncTypetype aliases forCallable[[bytes], Awaitable[None]]andCallable[[int], Awaitable[bytes]]instantiate internal27 files
__init__.pyinterceptor.pyreflection.pygo-cty-funcs.txtgo-cty-tests.txtgo-framework-dirs.md__main__.pybase.pyprovider.pyconnection.py2025-02-15-0954-invalid-cookie-hard-crash.mdkv_protocol.pyhandshake.pyserver.pyconftest.pytransport.pytest_handshake_magic_cookie.pytest_handshake_negotiation.pytest_handshake_responses.pytest_server.pytest_server_coverage.pytest_server_coverage_extra.pytest_server_destructor_cleanup.pytest_transport_tcp.pytest_transport_unix_3.pytcp.pyunix.py
- Added
send_funcandreceive_funcoptional fields toClientConnectionwith defaults set in__attrs_post_init__instantiate internal27 files
__init__.pyinterceptor.pyreflection.pygo-cty-funcs.txtgo-cty-tests.txtgo-framework-dirs.md__main__.pybase.pyprovider.pyconnection.py2025-02-15-0954-invalid-cookie-hard-crash.mdkv_protocol.pyhandshake.pyserver.pyconftest.pytransport.pytest_handshake_magic_cookie.pytest_handshake_negotiation.pytest_handshake_responses.pytest_server.pytest_server_coverage.pytest_server_coverage_extra.pytest_server_destructor_cleanup.pytest_transport_tcp.pytest_transport_unix_3.pytcp.pyunix.py
- Renamed
send_datato_default_sendas the default implementation decouple behavioral27 files
__init__.pyinterceptor.pyreflection.pygo-cty-funcs.txtgo-cty-tests.txtgo-framework-dirs.md__main__.pybase.pyprovider.pyconnection.py2025-02-15-0954-invalid-cookie-hard-crash.mdkv_protocol.pyhandshake.pyserver.pyconftest.pytransport.pytest_handshake_magic_cookie.pytest_handshake_negotiation.pytest_handshake_responses.pytest_server.pytest_server_coverage.pytest_server_coverage_extra.pytest_server_destructor_cleanup.pytest_transport_tcp.pytest_transport_unix_3.pytcp.pyunix.py
- Removed internal
_bufferfield fromClientConnectiondecouple internal27 files
__init__.pyinterceptor.pyreflection.pygo-cty-funcs.txtgo-cty-tests.txtgo-framework-dirs.md__main__.pybase.pyprovider.pyconnection.py2025-02-15-0954-invalid-cookie-hard-crash.mdkv_protocol.pyhandshake.pyserver.pyconftest.pytransport.pytest_handshake_magic_cookie.pytest_handshake_negotiation.pytest_handshake_responses.pytest_server.pytest_server_coverage.pytest_server_coverage_extra.pytest_server_destructor_cleanup.pytest_transport_tcp.pytest_transport_unix_3.pytcp.pyunix.py
- Updated docstrings to describe the DI pattern for testing and alternative implementations
qualify
internal
3 files
go-cty-funcs.txtgo-cty-tests.txtgo-framework-dirs.md
Unix Transport
8 files changed
test_transport_unix_minimal.pyRemoved test_transport_unix_minimal.py (-149 lines)transport.pyUpdated transport.py (+50/-3 lines)test_transport_tcp.pyUpdated test_transport_tcp.py (+27/-16 lines)test_transport_unix_2.pyAdded test_transport_unix_2.py (+2 lines)test_transport_unix_3.pyUpdated test_transport_unix_3.py (+1/-1 lines)tcp.pyAdded tcp.py (+1 lines)types.pyUpdated types.py (+2/-1 lines)unix.pyUpdated unix.py (+64/-81 lines)
Transport Tests
1 file changed
test_transport_unix_3.pyUpdated test_transport_unix_3.py