MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / ClusterAuthUnaryHook

Method ClusterAuthUnaryHook

pkg/component/grpc.go:108–115  ·  view source on GitHub ↗

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.

()

Source from the content-addressed store, hash-verified

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.
108func (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.

Callers 9

NewFunction · 0.80
TestHooksFunction · 0.80
NewFunction · 0.80
NewFunction · 0.80
NewFunction · 0.80
NewFunction · 0.80
NewFunction · 0.80
NewFunction · 0.80
NewFunction · 0.80

Implementers 1

Componentpkg/component/component.go

Calls 1

WithVerifiedSourceMethod · 0.65

Tested by 1

TestHooksFunction · 0.64