Commit 496d420
authored
[ASM] Refactor hardcoded secret analyzer (#5883)
## Summary of changes
The Hardcoded analyzer has been refactored. These are the main changes:
- Replaced the manual sleep and polling mechanism with an asynchronous
delay using `Task.Delay`.
- Added `ConfigureAwait(false)` to avoid capturing the synchronization
context, which can prevent potential deadlocks and improve performance.
- Introduced a `CancellationTokenSource` for managing the lifecycle of
the polling operation.
- Removed the `_started` flag as the `CancellationToken` now controls
the start/stop logic.
- Ensured proper disposal of resources by calling
`_cancellationTokenSource.Cancel()` in the `Dispose` method.
## Reason for change
This change was requested.
## Implementation details
## Test coverage
## Other details
<!-- Fixes #{issue} -->
<!-- 1 parent 05db88a commit 496d420
File tree
1 file changed
+10
-17
lines changed- tracer/src/Datadog.Trace/Iast/Analyzers
1 file changed
+10
-17
lines changedLines changed: 10 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | | - | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
36 | | - | |
37 | | - | |
38 | | - | |
| 35 | + | |
| 36 | + | |
39 | 37 | | |
40 | 38 | | |
41 | | - | |
| 39 | + | |
42 | 40 | | |
43 | 41 | | |
44 | 42 | | |
45 | 43 | | |
46 | 44 | | |
47 | | - | |
| 45 | + | |
48 | 46 | | |
49 | 47 | | |
50 | 48 | | |
| |||
81 | 79 | | |
82 | 80 | | |
83 | 81 | | |
84 | | - | |
| 82 | + | |
85 | 83 | | |
86 | 84 | | |
87 | 85 | | |
| |||
94 | 92 | | |
95 | 93 | | |
96 | 94 | | |
97 | | - | |
| 95 | + | |
98 | 96 | | |
99 | 97 | | |
100 | | - | |
| 98 | + | |
101 | 99 | | |
102 | | - | |
103 | 100 | | |
104 | 101 | | |
105 | 102 | | |
| |||
215 | 212 | | |
216 | 213 | | |
217 | 214 | | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
| 215 | + | |
| 216 | + | |
224 | 217 | | |
225 | 218 | | |
226 | 219 | | |
| |||
0 commit comments