Skip to content

Commit

Permalink
fix possibel leaky spesc for appsec enabled value
Browse files Browse the repository at this point in the history
  • Loading branch information
GustavoCaso committed Jun 16, 2023
1 parent 7e5e727 commit 0594c9b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 8 additions & 1 deletion spec/datadog/kit/identity_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,15 @@
Datadog::AppSec::Scope.new(trace, span, processor)
end

it 'instruments the user information to appsec' do
before do
Datadog.configuration.appsec.enabled = true
end

after do
Datadog.configuration.appsec.send(:reset!)
end

it 'instruments the user information to appsec' do
expect_any_instance_of(Datadog::AppSec::Instrumentation::Gateway).to receive(:push).with(
'identity.set_user',
instance_of(Datadog::AppSec::Instrumentation::Gateway::User)
Expand Down
5 changes: 5 additions & 0 deletions spec/datadog/tracing/integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,11 @@ def sample!(trace)
end
end

after do
Datadog.configuration.reset!
Datadog.configuration.appsec.send(:reset!)
end

context 'is provided' do
let(:on_build) do
double('on_build').tap do |double|
Expand Down

0 comments on commit 0594c9b

Please sign in to comment.