gRPC-Go 1.83
Last reviewed Sep 6, 2026
Prompt Details
Prompt Composition
2prompts
- Go 1.27130 lines · 5.5K tokens
- gRPC-Go 1.8358 lines · 1.9K tokens
Total188 lines · 7.4K tokens
CWE Coverage
- 15
- 20
- 22
- 59
- 78
- 79
- 89
- 94
- 117
- 190
- 208
- 209
- 250
- 252
- 257
- 287
- 295
- 307
- 319
- 323
- 327
- 338
- 347
- 352
- 362
- 367
- 378
- 409
- 426
- 444
- 488
- 494
- 532
- 732
- 759
- 770
- 772
- 807
- 862
- 863
- 915
- 916
- 918
- 942
- 1004
- 1275
- 1395
Prompt Preview
Apply the Go 1.27 baseline first. These rules cover gRPC-Go 1.83 transports, credentials, services, interceptors, protobuf input, deadlines, retries, streaming, errors, and operations.
Transport and client construction
- Construct
grpc.NewClienttargets and resolvers from trusted configuration and supplycredentials.NewTLSwith normal hostname validation; reserveinsecure.NewCredentials()for isolated plaintext channels that carry no protected data. - Configure server TLS with
grpc.Creds(credentials.NewTLS(...)); when client certificates authenticate callers, settls.Config.ClientAuthtotls.RequireAndVerifyClientCertand provide trustedClientCAs. - Implement
credentials.PerRPCCredentials.RequireTransportSecurity()as true for credentials, and never send bearer tokens through an implementation that permits an insecure transport. - Do not use
tls.Config{InsecureSkipVerify:true}; if custom verification is required, verify the DNS name and chain inVerifyConnectionand maintain a trusted root set. - Treat resolver addresses and service-config updates as control-plane input; use approved resolvers and
grpc.WithDisableServiceConfig()when remote retry or load-balancing policy must not override local configuration. - Separate
ClientConninstances and credential objects across tenant or privilege boundaries when metadata, connection state, or resolver policy could otherwise be shared.
Service and interceptor boundaries
- Chain unary and stream interceptors so authentication, resource limits, and authorization wrap logging and business handlers;