gRPC for .NET 2.83
Last reviewed Sep 6, 2026
Prompt Details
Prompt Composition
3prompts
- C# 14106 lines · 4.4K tokens
- ASP.NET Core 10.065 lines · 3.5K tokens
- gRPC for .NET 2.8355 lines · 1.7K tokens
Total226 lines · 9.6K tokens
CWE Coverage
- 20
- 22
- 59
- 73
- 78
- 79
- 89
- 94
- 117
- 190
- 208
- 209
- 214
- 257
- 295
- 307
- 312
- 319
- 323
- 327
- 338
- 352
- 362
- 367
- 378
- 426
- 434
- 488
- 502
- 524
- 525
- 532
- 552
- 601
- 611
- 613
- 614
- 636
- 639
- 674
- 759
- 770
- 772
- 775
- 778
- 798
- 807
- 862
- 915
- 916
- 918
- 942
- 1004
- 1275
- 1333
- 1385
- 1395
Prompt Preview
Apply the ASP.NET Core 10.0 and C# 14 prompts first. These rules cover gRPC for .NET 2.83 transports, credentials, services, interceptors, protobuf input, deadlines, retries, streaming, errors, and operations.
Transport and channel trust
- Use an HTTPS channel address with normal certificate and hostname validation; an HTTP address selects an insecure transport and must not carry production credentials or protected data.
- Keep
GrpcChannelOptions.UnsafeUseInsecureChannelCallCredentials=false; setting it to true permits call credentials to be sent over plaintext HTTP. Authorization headers supplied directly throughMetadataare outside this gate. - Build channel addresses, proxy settings, root trust, and client certificates from trusted service configuration, not request-controlled URLs or model output.
- Use
HttpClientHandler.ClientCertificatesfor mTLS where required and map the authenticated certificate to an application identity; encryption or certificate presence alone is not authorization. - Do not replace
ServerCertificateCustomValidationCallbackwith an accept-all callback; pin only when operational rotation and exact host validation remain defined.
Service exposure and authorization
- Apply
.RequireAuthorization()or method policies to every non-publicMapGrpcService<T>(), then authorize the concrete resource inside the method; a valid channel or token does not establish tenant access. - Register unary and streaming server interceptors in deliberate order, with authentication, limits, and policy outside business interceptors; server