Handshake
pyvider.rpcplugin.client.handshake
¶
Client handshake functionality for RPC plugin connections.
This module contains handshake-related methods including retry logic, certificate setup, handshake parsing, and X.509 certificate processing.
Classes¶
ClientHandshakeMixin
¶
Mixin providing handshake functionality for RPCPluginClient.
This mixin implements the client side of the Terraform-compatible plugin handshake protocol. It handles: - Handshake retry logic with exponential backoff - Certificate setup for mTLS connections - Transport negotiation (Unix socket vs TCP) - Protocol version negotiation - X.509 certificate parsing and validation
The handshake protocol ensures secure plugin communication by: 1. Validating magic cookies for authentication 2. Negotiating compatible protocol versions 3. Establishing transport preferences 4. Exchanging TLS certificates when security is enabled
Note
This is a mixin class and should not be instantiated directly. It's designed to be mixed into RPCPluginClient.
HandshakeData
¶
Bases: NamedTuple
Essential data parsed from the plugin's handshake response.
This tuple contains the core information needed to establish a connection with the plugin server after the handshake protocol completes.
Attributes:
| Name | Type | Description |
|---|---|---|
endpoint |
str
|
The network address where the plugin is listening. For TCP: "host:port" (e.g., "127.0.0.1:8080") For Unix: socket path (e.g., "/tmp/plugin.sock") |
transport_type |
str
|
The transport protocol negotiated during handshake. Common values: "tcp", "unix" |