Skip to content

Commit

Permalink
fix names
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasShabi committed Dec 24, 2024
1 parent 3cc25af commit 0a9cc8d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions packages/dd-trace/src/appsec/iast/iast-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ function getIastContext (store, topContext) {
function getIastStackTraceId (iastContext) {
if (!iastContext) return 0

if (!iastContext.iastStackTraceId) {
iastContext.iastStackTraceId = 0
if (!iastContext.stackTraceId) {
iastContext.stackTraceId = 0
}

iastContext.iastStackTraceId += 1
return iastContext.iastStackTraceId
iastContext.stackTraceId += 1
return iastContext.stackTraceId
}

/* TODO Fix storage problem when the close event is called without
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function stopClearCacheTimer () {
}

function isDuplicatedVulnerability (vulnerability) {
return VULNERABILITY_HASHES.has(`${vulnerability.type}${vulnerability.hash}`)
return VULNERABILITY_HASHES.get(`${vulnerability.type}${vulnerability.hash}`)
}

function getVulnerabilityCallSiteList () {
Expand Down
4 changes: 2 additions & 2 deletions packages/dd-trace/src/appsec/rasp/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ function handleResult (actions, req, res, abortController, config) {

const { enabled, maxDepth, maxStackTraces } = config.appsec.stackTrace

const callSiteList = getCallSiteList(maxDepth)

if (generateStackTraceAction && enabled) {
const callSiteList = getCallSiteList(maxDepth)

const rootSpan = web.root(req)
reportStackTrace(
rootSpan,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ describe('vulnerability-analyzer', () => {
}
}
vulnerabilityAnalyzer._report(VULNERABLE_VALUE, context)
expect(vulnerabilityReporter.addVulnerability).to.have.been.calledOnceWith(
expect(vulnerabilityReporter.addVulnerability).to.have.been.calledOnceWithExactly(
context,
{
type: 'TEST_ANALYZER',
Expand Down
4 changes: 2 additions & 2 deletions packages/dd-trace/test/appsec/rasp/utils.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('RASP - utils.js', () => {

stackTrace = {
reportStackTrace: sinon.stub(),
getCallSiteList: sinon.stub().returns({})
getCallSiteList: sinon.stub().returns([])
}

utils = proxyquire('../../../src/appsec/rasp/utils', {
Expand Down Expand Up @@ -45,7 +45,7 @@ describe('RASP - utils.js', () => {
web.root.returns(rootSpan)

utils.handleResult(result, req, undefined, undefined, config)
sinon.assert.calledOnceWithExactly(stackTrace.reportStackTrace, rootSpan, stackId, 42, 2, {})
sinon.assert.calledOnceWithExactly(stackTrace.reportStackTrace, rootSpan, stackId, 42, 2, [])
})

it('should not report stack trace when no action is present in waf result', () => {
Expand Down

0 comments on commit 0a9cc8d

Please sign in to comment.