@@ -391,7 +391,7 @@ module LaunchDarkly
391
391
output = flush_and_get_events ( ep , sender )
392
392
expect ( output ) . to contain_exactly (
393
393
eq ( index_event ( default_config , context ) ) ,
394
- eq ( custom_event ( context , 'eventkey' , { thing : 'stuff' } , 1.5 ) )
394
+ eq ( custom_event ( default_config , context , 'eventkey' , { thing : 'stuff' } , 1.5 ) )
395
395
)
396
396
end
397
397
end
@@ -404,7 +404,7 @@ module LaunchDarkly
404
404
output = flush_and_get_events ( ep , sender )
405
405
expect ( output ) . to contain_exactly (
406
406
eq ( index_event ( config , context ) ) ,
407
- eq ( custom_event ( context , 'eventkey' , nil , nil ) )
407
+ eq ( custom_event ( config , context , 'eventkey' , nil , nil ) )
408
408
)
409
409
end
410
410
end
@@ -476,7 +476,7 @@ module LaunchDarkly
476
476
477
477
output = flush_and_get_events ( ep , sender )
478
478
expect ( output ) . to contain_exactly (
479
- eq ( migration_op_event ( flag , context , 0 , true , LaunchDarkly ::Migrations ::STAGE_OFF , reason , starting_timestamp +1 ) )
479
+ eq ( migration_op_event ( default_config , flag , context , 0 , true , LaunchDarkly ::Migrations ::STAGE_OFF , reason , starting_timestamp +1 ) )
480
480
)
481
481
end
482
482
end
@@ -786,6 +786,7 @@ def feature_event(config, flag, context, variation, value, timestamp = starting_
786
786
end
787
787
788
788
#
789
+ # @param config [Config]
789
790
# @param flag [LaunchDarkly::Impl::Models::FeatureFlag]
790
791
# @param context [LDContext]
791
792
# @param variation [Integer]
@@ -795,12 +796,15 @@ def feature_event(config, flag, context, variation, value, timestamp = starting_
795
796
# @param timestamp [Integer]
796
797
# @return [Hash]
797
798
#
798
- def migration_op_event ( flag , context , variation , value , default , reason , timestamp = starting_timestamp )
799
+ def migration_op_event ( config , flag , context , variation , value , default , reason , timestamp = starting_timestamp )
800
+ context_filter = Impl ::ContextFilter . new ( config . all_attributes_private , config . private_attributes )
801
+ redacted_context = context_filter . filter_redact_anonymous ( context )
802
+
799
803
out = {
800
804
kind : 'migration_op' ,
801
805
operation : 'read' ,
802
806
creationDate : timestamp ,
803
- contextKeys : context . keys ,
807
+ context : redacted_context ,
804
808
evaluation : {
805
809
default : default . to_s ,
806
810
key : flag . key ,
@@ -836,17 +840,21 @@ def debug_event(config, flag, context, variation, value, timestamp = starting_ti
836
840
end
837
841
838
842
#
843
+ # @param config [Config]
839
844
# @param context [LDContext]
840
845
# @param key [String]
841
846
# @param data [any]
842
847
# @param metric_value [any]
843
848
# @return [Hash]
844
849
#
845
- def custom_event ( context , key , data , metric_value )
850
+ def custom_event ( config , context , key , data , metric_value )
851
+ context_filter = Impl ::ContextFilter . new ( config . all_attributes_private , config . private_attributes )
852
+ redacted_context = context_filter . filter_redact_anonymous ( context )
853
+
846
854
out = {
847
855
kind : "custom" ,
848
856
creationDate : starting_timestamp ,
849
- contextKeys : context . keys ,
857
+ context : redacted_context ,
850
858
key : key ,
851
859
}
852
860
out [ :data ] = data unless data . nil?
0 commit comments