Skip to main content

Module mock

Module mock 

Source
Expand description

Mock plugins for tests.

The mocks accept every peer and simulate a handshake in exactly two steps. Never for production — they provide no real crypto.

Purpose:

  1. Validate the SPI interface against an actually working flow (signature checks, handshake state machine).
  2. From v1.4 on the DCPS layer can sub-test against the mock before the production plugin is finished.

zerodds-lint: allow no_dyn_in_safe (tests instantiate Box<dyn AuthenticationPlugin>.)

Structs§

MockAccessControlPlugin
Mock access control: allows everything. Tests only.
MockAuthenticationPlugin
Mock implementation — accepts everything, handshake step count hard-coded.
MockDataTaggingPlugin
Mock DataTagging plugin: stores tag lists per endpoint GUID in an in-memory map. Returns an empty Vec for an unknown GUID (spec-compliant default).
MockLogEntry
A log entry — collected for test assertions.
MockLoggingPlugin
Mock logger: collects all events in a MockLogSink so tests can inspect the events afterwards.

Type Aliases§

MockLogSink
Shared sink type — Arc<Mutex<Vec<MockLogEntry>>>.