@contract-case/case-connector
v0.30.0
Published
Connector to allow ContractCase to run as a server. Use only if you're creating a custom wrapper for a new language
Readme
Case-Connector
This is the server connector (formerly case-boundary) to allow ContractCase to be run as a server.
If you're wanting to learn about ContractCase, start here instead
Don't depend on this directly unless you are writing a custom wrapper for ContractCase.
This package exists to work around this JSii bug, by exposing the communication layer as a gRPC service.
Additionally, it exposes the boundary layer as @contract-case/case-connector for ESM imports, and @contract-case/case-connector/cjs for CJS imports.
For details of the protocol schema, see the case-connector-proto package.
Authentication
The connector binds to the loopback interface only, on a free port that it announces on stdout in the form:
[SERVER] Started on port: <PORT>To prevent other local processes from connecting to it, wrappers must
generate an unguessable random token and pass it to the connector process via
the CASE_CONNECTOR_TOKEN environment variable. The connector rejects (with
UNAUTHENTICATED) any call that doesn't present the same token in the
authorization metadata of the gRPC call.
If CASE_CONNECTOR_TOKEN is not set, the connector refuses to start. This
means the connector always requires a compatible wrapper (any wrapper released
after the token was introduced).
