(
req interface{},
ss grpc.ServerStream,
info *grpc.StreamServerInfo,
handler grpc.StreamHandler)
| 348 | } |
| 349 | |
| 350 | func serverInterceptor( |
| 351 | req interface{}, |
| 352 | ss grpc.ServerStream, |
| 353 | info *grpc.StreamServerInfo, |
| 354 | handler grpc.StreamHandler) (err error) { |
| 355 | // skip the authCallbacks wrapping/authentication for scatter gather calls, |
| 356 | // as the user is already authenticated at the original node. |
| 357 | if _, err = extractMetaHeader(ss.Context(), rpcClusterActionKey); err == nil { |
| 358 | w := wrapServerStream(ss) |
| 359 | w.wrappedContext = ss.Context() |
| 360 | return handler(req, w) |
| 361 | } |
| 362 | |
| 363 | nctx, err := wrapAuthCallbacks(req, ss.Context(), info.FullMethod) |
| 364 | if err != nil { |
| 365 | log.Errorf("grpc_server: authenticate err: %+v", err) |
| 366 | return err |
| 367 | } |
| 368 | |
| 369 | w := wrapServerStream(ss) |
| 370 | w.wrappedContext = nctx |
| 371 | |
| 372 | return handler(req, w) |
| 373 | } |
nothing calls this directly
no test coverage detected