From d55f51d603cc6922c396026094b8da33556b885b Mon Sep 17 00:00:00 2001 From: Eleftheria Stein-Kousathana Date: Thu, 7 Mar 2024 17:12:49 +0100 Subject: [PATCH] Remove token from builtin rules --- internal/engine/ingester/builtin/builtin.go | 7 ++----- pkg/rule_methods/rule_methods.go | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/internal/engine/ingester/builtin/builtin.go b/internal/engine/ingester/builtin/builtin.go index 3a7c546732..373b41e26f 100644 --- a/internal/engine/ingester/builtin/builtin.go +++ b/internal/engine/ingester/builtin/builtin.go @@ -45,17 +45,15 @@ type BuiltinRuleDataIngest struct { builtinCfg *pb.BuiltinType ruleMethods rule_methods.Methods method string - accessToken string } // NewBuiltinRuleDataIngest creates a new builtin rule data ingest engine func NewBuiltinRuleDataIngest( builtinCfg *pb.BuiltinType, - pbuild *providers.ProviderBuilder, + _ *providers.ProviderBuilder, ) (*BuiltinRuleDataIngest, error) { return &BuiltinRuleDataIngest{ builtinCfg: builtinCfg, - accessToken: pbuild.GetToken(), method: builtinCfg.GetMethod(), ruleMethods: &rule_methods.RuleMethods{}, }, nil @@ -98,8 +96,7 @@ func (idi *BuiltinRuleDataIngest) Ingest(ctx context.Context, ent protoreflect.P // call method // Call the method (empty parameter list) - result := method.Call([]reflect.Value{reflect.ValueOf(ctx), - reflect.ValueOf(idi.accessToken), reflect.ValueOf(ent)}) + result := method.Call([]reflect.Value{reflect.ValueOf(ctx), reflect.ValueOf(ent)}) if len(result) != 2 { return nil, fmt.Errorf("rule method should return 3 values") } diff --git a/pkg/rule_methods/rule_methods.go b/pkg/rule_methods/rule_methods.go index e98d24c0bd..404a53a956 100644 --- a/pkg/rule_methods/rule_methods.go +++ b/pkg/rule_methods/rule_methods.go @@ -47,6 +47,6 @@ func (r *RuleMethods) GetMethod(mName string) (reflect.Value, error) { } // Passthrough is a method that passes the entity through, just marshalling it -func (_ *RuleMethods) Passthrough(_ context.Context, _ string, ent protoreflect.ProtoMessage) (json.RawMessage, error) { +func (_ *RuleMethods) Passthrough(_ context.Context, ent protoreflect.ProtoMessage) (json.RawMessage, error) { return protojson.Marshal(ent) }