pyvider
2025-02-02
Major client rewrite introducing the new `Certificate` API from the crypto
53 files · 2,788+ · 2,183-
Client Certificate API Migration
18 files changed
gource.confAdded gource.conf (+13 lines)loc-counter.shAdded loc-counter.sh (+3 lines)client.pyUpdated client.py (+177/-183 lines)__init__.pyAdded __init__.py (+40 lines)certificate.pyAdded certificate.py (+668 lines)constants.pyAdded constants.py (+18 lines)generators.pyAdded generators.py (+72 lines)types.pyAdded types.py (+9 lines)README.mdAdded README.md (+2 lines)env.shUpdated env.sh (+1/-1 lines)kv-data-statusAdded kv-data-status (+1 lines)py-kv-server.pyUpdated py-kv-server.py (+119/-62 lines)exception.pyUpdated exception.py (+1/-1 lines)handshake.pyUpdated handshake.py (+5/-2 lines)security.pyUpdated security.py (+47/-149 lines)certificate.pyRemoved certificate.py (-217 lines)server.pyUpdated server.py (+158/-112 lines)test_server.pyUpdated test_server.py (+0/-0 lines)
- Replaced direct
cryptography.hazmat.primitives.serializationandx509imports withpyvider.rpcplugin.crypto.certificate.Certificateandpyvider.rpcplugin.crypto.generators.generate_keypairharden internal3 files
cryptography.hazmat.primitives.serializationpyvider.rpcplugin.crypto.certificate.Certificatepyvider.rpcplugin.crypto.generators.generate_keypair
- Removed imports for
raw_base64_to_pem_cert,create_self_signed_x509_certificate,create_ssl_client_credentials,log_certificate_detailsfrom old security module harden internal51 files
broke-server.pyclient.py__init__.pycertificate.pyconstants.pygenerators.pytypes.pyREADME.mdenv.shkv-data-statuspy-kv-server.pyexception.pyhandshake.pyexample.protoexample_pb2.pyexample_pb2_grpc.pyexample_server.pymock_message.protomock_message_pb2.pymock_message_pb2_grpc.pymock_server.pysecurity.pycertificate.pyserver.pytest_server.py__init__.pyconftest.pytest_certificate_chains.pytest_certificate_create.pytest_certificate_credentials.pytest_certificate_lifecycle.pytest_certificate_loading.pytest_certificate_mtls.pytest_certificate_properties.pytest_certificate_verify.pytest_crypto.pytest_crypto_generators.pycrypto.pytest_handshake_magic_cookie.pytest_handshake_negotiation.pytest_handshake_responses.pytest_certificate_validation.pytest_client_grpc.pytest_security.pyx_test_transport_tcp.pyx_test_transport_unix.pyx_test_cert.pyx_test_cert2.pyx_test_cert3.pyx_test_client.pytls-check.py
- Client now uses the new
Certificateabstraction for all cert operations harden internal4 files
test_certificate_validation.pyx_test_cert.pyx_test_cert2.pyx_test_cert3.py
Client Code Quality
2 files changed
asyncio.CancelledErrorUpdated asyncio.CancelledErrorattrs.fieldUpdated attrs.field
- Added
from __future__ import annotationsback to client specify internal1 file
client.py
- Added
contextlibimport for suppressingasyncio.CancelledErrorduring task cleanup deprecate errata1 file
asyncio.CancelledError
- Improved docstrings throughout:
_relay_stderr,_perform_handshake, handshake parsing wrapped in try/except streamline internal1 file
client.py
- Changed
attrs.fielddefaults to explicitattrs.field(init=False, default=None)forstderr_taskandstdout_taskinstantiate architectural1 file
attrs.field
Broken Test Organization
34 files changed
broke-server.pyUpdated broke-server.py (+0/-0 lines)example.protoUpdated example.proto (+0/-0 lines)example_pb2.pyUpdated example_pb2.py (+0/-0 lines)example_pb2_grpc.pyUpdated example_pb2_grpc.py (+0/-0 lines)example_server.pyUpdated example_server.py (+0/-0 lines)mock_message.protoUpdated mock_message.proto (+0/-0 lines)mock_message_pb2.pyUpdated mock_message_pb2.py (+0/-0 lines)mock_message_pb2_grpc.pyUpdated mock_message_pb2_grpc.py (+0/-0 lines)mock_server.pyUpdated mock_server.py (+0/-0 lines)__init__.pyUpdated __init__.py (+0/-0 lines)conftest.pyUpdated conftest.py (+7/-43 lines)test_certificate_chains.pyAdded test_certificate_chains.py (+142 lines)test_certificate_create.pyAdded test_certificate_create.py (+86 lines)test_certificate_credentials.pyAdded test_certificate_credentials.py (+129 lines)test_certificate_lifecycle.pyAdded test_certificate_lifecycle.py (+85 lines)test_certificate_loading.pyAdded test_certificate_loading.py (+133 lines)test_certificate_mtls.pyUpdated test_certificate_mtls.py (+2/-2 lines)test_certificate_properties.pyAdded test_certificate_properties.py (+147 lines)test_certificate_verify.pyAdded test_certificate_verify.py (+248 lines)test_crypto.pyAdded test_crypto.py (+32 lines)test_crypto_generators.pyAdded test_crypto_generators.py (+88 lines)crypto.pyAdded crypto.py (+79 lines)test_handshake_magic_cookie.pyUpdated test_handshake_magic_cookie.py (+0/-0 lines)test_handshake_negotiation.pyUpdated test_handshake_negotiation.py (+0/-0 lines)test_handshake_responses.pyUpdated test_handshake_responses.py (+0/-0 lines)test_certificate.pyRemoved test_certificate.py (-170 lines)test_certificate_basic.pyRemoved test_certificate_basic.py (-131 lines)test_certificate_loading.pyRemoved test_certificate_loading.py (-76 lines)test_certificate_old.pyRemoved test_certificate_old.py (-239 lines)test_client_grpc.pyUpdated test_client_grpc.py (+13/-5 lines)test_security.pyRemoved test_security.py (-337 lines)x_test_transport_tcp.pyUpdated x_test_transport_tcp.py (+0/-0 lines)x_test_transport_unix.pyUpdated x_test_transport_unix.py (+0/-0 lines)x_test_client.pyRemoved x_test_client.py (-249 lines)
- Moved
broke-server.pytobroken/broke-server.pyremediate internal1 file
broke-server.py
- Moved
test_client_grpc.pyandtest_minimal_server_client.pyfromtests/tobroken/qualify internal33 files
example.protoexample_pb2.pyexample_pb2_grpc.pyexample_server.pymock_message.protomock_message_pb2.pymock_message_pb2_grpc.pymock_server.py__init__.pyconftest.pytest_certificate_chains.pytest_certificate_create.pytest_certificate_credentials.pytest_certificate_lifecycle.pytest_certificate_loading.pytest_certificate_mtls.pytest_certificate_properties.pytest_certificate_verify.pytest_crypto.pytest_crypto_generators.pycrypto.pytest_handshake_magic_cookie.pytest_handshake_negotiation.pytest_handshake_responses.pytest_certificate.pytest_certificate_basic.pytest_certificate_loading.pytest_certificate_old.pytest_client_grpc.pytest_security.pyx_test_transport_tcp.pyx_test_transport_unix.pyx_test_client.py
- Removed
x_test_client.py(249 lines) decouple internal1 file
x_test_client.py
TLS Check Tool
1 file changed
tls-check.pyUpdated tls-check.py (+263/-204 lines)