gRPC for Dart 5.1

Last reviewed Sep 19, 2026

Export as PDF

Prompt Details

Prompt Composition

2prompts
  1. Dart 3.13109 lines · 2.9K tokens
  2. 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 ChannelOptions default of ChannelCredentials.secure(). Supply private roots through certificates when needed; leave onBadCertificate unset and never use allowBadCertificates in production. Limit insecure channels to isolated tests or explicitly protected local hops.
  • Fix channel destinations, ChannelCredentials.authority, and Proxy settings in trusted configuration. The authority override affects TLS identity and credential audiences. Protect any hop carrying Proxy.username and Proxy.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. Use ServerTlsCredentials or 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 ServerLocalCredentials or a validateClient override as the network access-control boundary in 5.1.0.
  • For mutual TLS, configure a ServerCredentials.securityContext trusting the intended client CAs and set both requestClientCertificate: true and