rpc_dart_grpc_reflection 0.2.3
rpc_dart_grpc_reflection: ^0.2.3 copied to clipboard
gRPC Server Reflection (v1 + v1alpha) for rpc_dart. Allows grpcurl, Postman, and other gRPC tools to discover services registered on any rpc_dart endpoint.
0.2.3 #
Fixes (protobuf-wire G/E):
RpcFieldTypenow covers the fullFieldDescriptorProto.Typeset. Added the missing values:typeEnum(14) — previously absent, so enum-typed fields could not be described — plustypeGroup(10),typeFixed64(6),typeFixed32(7),typeSfixed32(15),typeSfixed64(16),typeSint32(17),typeSint64(18).- Documented
ProtoWriteras the canonical proto-wire encoder.rpc_dart_generatorcarries a byte-identical private copy (it cannot depend on thispublish_to: nonepackage). A newproto_writer_parity_test.dartpins the canonical golden bytes; the generator's parity test asserts the same goldens.
0.2.2 #
Fixes (backlog #7 — partial-deps were dropped silently):
RpcReflectionRegistrynow emits a WARNING naming every declared dependency file that is referenced but not registered, instead of silently truncating the reflection response. The partial descriptor set is still returned (non-breaking); a reflection client now has a clear signal when its descriptor set is incomplete.- The warning is routed through an injectable
LogScope(new optionalRpcReflectionRegistry({LogScope? logger})constructor) so it flows through the application'sLogController; when no logger is injected it falls back to a console-backed default. - Added
RpcReflectionRegistry.missingDependencies()— reports the set of unregistered declared dependencies across the registry, for use as a startup completeness assertion.
Cross-platform:
- Verified web (dart2js) clean: full test suite passes under
dart test -p node. Reflection'sasync*/await forhandler is purely reactive (one response per request, no independent producer), so the long-lived bidi cancel-deadlock pattern does not apply. Varint decode/encode confirmed JS-safe (hi/lo 32-bit recombination retained).
0.2.1 #
Fixes (audit):
readLenDelimitednow validateslength >= 0 && pos + length <= bytes.lengthbefore slicing -- a truncated descriptor throws a typedFormatExceptioninstead of a rawRangeError.- Varint decoding is now JS-safe for full 64-bit values (hi/lo 32-bit recombination) instead of an overflowing native
<< shifton dart2js. ServerReflectionRequestparsing now returns a malformed-request error response on an unknown wire type (e.g. groups) instead of silently dispatching a partial parse as a valid lookup.
0.2.0 #
- Full proto support: nested message types, nested enums, cross-file dependencies.
- Added
RpcEnumDescriptorandRpcEnumValueDescriptorfor registering enum schemas inRpcFileDescriptorBuilder. RpcFileDescriptorBuilder.addDependency(protoFilename)— declare proto import dependencies for correct cross-file symbol resolution.RpcReflectionRegistry:fileByFilenameandfileContainingSymbolnow transitively resolve and include all dependencies in the response.ServerReflectionContract.both()— convenience factory returning both v1 and v1alpha contracts.- Updated to
rpc_dart: ^3.1.0.
0.1.0 #
- Initial release: gRPC Server Reflection v1 and v1alpha for rpc_dart.
RpcReflectionRegistry— service descriptor registry with two registration tiers:- Tier 1 (protobuf):
addFromPbjson()using bytes from generated.pbjson.dart - Tier 2 (codegen):
addFileDescriptor(MyServiceNames.grpcDescriptor)
- Tier 1 (protobuf):
RpcReflectionRegistry.attachTo(endpoint)— registers v1 + v1alpha reflection contracts in one call.ServerReflectionContract— bidi-streaming contract implementing the reflection protocol via hand-written protobuf binary encoder/parser (nopackage:protobufdependency).RpcFileDescriptorBuilder— buildsFileDescriptorProtofromRpcMessageDescriptor/RpcServiceDescriptoror raw bytes.