func VerifySource(ctx context.Context, validKeys [][]byte) context.Context {
	err := verifySource(ctx, validKeys)
	return NewContext(ctx, err)
}
VerifySource inspects whether the context contains one of the passed cluster keys,
and returns a context containing the result.
package cluster
import (
	"context"
	"crypto/subtle"
	"encoding/hex"
	"go.thethings.network/lorawan-stack/v3/pkg/errors"
	"go.thethings.network/lorawan-stack/v3/pkg/rpcmetadata"
)
type (
	clusterAuthKeyType        struct{}
	clusterAuthKeyFailureType struct{}
)
var (
	AuthType = "ClusterKey"
	clusterAuthKey        = clusterAuthKeyType{}
	clusterAuthFailureKey = clusterAuthKeyFailureType{}
	errNoClusterKey        = errors.DefineUnauthenticated("no_cluster_key", "no cluster key auth specified")
	errUnsupportedAuthType = errors.DefineInvalidArgument("auth_type", "cluster auth type `{auth_type}` is not supported")
	errInvalidClusterKey   = errors.DefinePermissionDenied("cluster_key", "invalid cluster key")
)
func NewContext(ctx context.Context, err error) context.Context {
	ctx = context.WithValue(ctx, clusterAuthKey, err == nil)
	ctx = context.WithValue(ctx, clusterAuthFailureKey, err)
	return ctx
}