gRPC for Dart 5.1
Last reviewed Sep 19, 2026
Prompt Details
Prompt Composition
2prompts
- Dart 3.13109 lines · 2.9K tokens
- gRPC for Dart 5.160 lines · 2.7K tokens
Total169 lines · 5.6K tokens
CWE Coverage
- 20
- 22
- 59
- 78
- 79
- 209
- 287
- 288
- 295
- 297
- 319
- 323
- 338
- 352
- 362
- 367
- 377
- 426
- 436
- 532
- 598
- 602
- 613
- 636
- 639
- 674
- 704
- 770
- 772
- 798
- 807
- 862
- 863
- 915
- 918
- 922
- 940
- 942
- 1333
- 1395
Prompt Preview
Apply the Dart 3.13 prompt first. These rules cover the grpc 5.1 release line: native clients and servers and browser gRPC-Web clients. They were checked against the published 5.1.0 package. That package requires Dart >=3.8.0 <4.0.0, protobuf: ^6.0.0, and http2: ^2.3.1; use generated code compatible with the selected protobuf runtime.
Transport and listener boundaries
- Retain the native
ChannelOptionsdefault ofChannelCredentials.secure(). Supply private roots throughcertificateswhen needed; leaveonBadCertificateunset and never useallowBadCertificatesin production. Limit insecure channels to isolated tests or explicitly protected local hops. - Fix channel destinations,
ChannelCredentials.authority, andProxysettings in trusted configuration. The authority override affects TLS identity and credential audiences. Protect any hop carryingProxy.usernameandProxy.password: CONNECT proxy authentication occurs before backend TLS. - Set
Server.serve(address: ..., security: ...)explicitly. Without TLS credentials the server is plaintext, and an omitted address binds all IPv4 interfaces. UseServerTlsCredentialsor a trusted TLS terminator with a backend that clients cannot reach directly. - Bind local-only servers to an explicit loopback address or protected Unix socket. Do not rely on
ServerLocalCredentialsor avalidateClientoverride as the network access-control boundary in 5.1.0. - For mutual TLS, configure a
ServerCredentials.securityContexttrusting the intended client CAs and set bothrequestClientCertificate: trueand