ClusterAuthUnaryHook ensuring the caller of an RPC is part of the cluster. If a call can't be identified as coming from the cluster, it will be discarded.
()
| 106 | // ClusterAuthUnaryHook ensuring the caller of an RPC is part of the cluster. |
| 107 | // If a call can't be identified as coming from the cluster, it will be discarded. |
| 108 | func (c *Component) ClusterAuthUnaryHook() hooks.UnaryHandlerMiddleware { |
| 109 | return func(next grpc.UnaryHandler) grpc.UnaryHandler { |
| 110 | return func(ctx context.Context, req any) (any, error) { |
| 111 | ctx = c.cluster.WithVerifiedSource(ctx) |
| 112 | return next(ctx, req) |
| 113 | } |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | // ClusterAuthStreamHook ensuring the caller of an RPC is part of the cluster. |
| 118 | // If a call can't be identified as coming from the cluster, it will be discarded. |