package authz import ( "context" "errors" auth "github.com/envoyproxy/go-control-plane/envoy/service/auth/v3" "github.com/xlgmokha/x/pkg/x" ) type RemoteCheckService struct { client auth.AuthorizationClient auth.UnimplementedAuthorizationServer } func NewRemoteCheckService(client auth.AuthorizationClient) auth.AuthorizationServer { return &RemoteCheckService{ client: client, } } func (svc *RemoteCheckService) Check(ctx context.Context, request *auth.CheckRequest) (*auth.CheckResponse, error) { if x.IsZero(svc.client) { return nil, errors.New("RPC client is not configured") } return svc.client.Check(ctx, request) }