Skip to content

Commit 038bc83

Browse files
committed
Go/Java/C#: Rename to ActiveThreatModelSource
As part of adding support for threat-models to Python/JS (see github#17203), we ran into some trouble with name clashes. Naming in existing languages supporting threat-models: - `SourceNode` (for QL only modeling) - `ThreatModelFlowSource` (for active sources from QL or data-extensions) However, since we use `LocalSourceNode` in Python, and `SourceNode` in JS (for local source nodes), it seems a bit confusing to follow the same naming convention as other languages, and we had to come up with new names. Initially I used `ThreatModelSource` for the "QL only modeling", but that meant that we needed a new name to represent the active sources coming from either QL or data-extensions... for this I came up with `ActiveThreatModelSource`, and I really liked it. To me, it's much clearer that this class only contains the currently active threat model sources. So to align languages, I got approval from @michaelnebel to rename the existing classes.
1 parent 90f7b30 commit 038bc83

File tree

3 files changed

+27
-6
lines changed

3 files changed

+27
-6
lines changed

csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsources/FlowSources.qll

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,18 @@ abstract class SourceNode extends DataFlow::Node {
2020
}
2121

2222
/**
23+
* DEPRECATED: Use `ActiveThreatModelSource` instead.
24+
*
2325
* A class of data flow sources that respects the
2426
* current threat model configuration.
2527
*/
26-
class ThreatModelFlowSource extends DataFlow::Node {
27-
ThreatModelFlowSource() {
28+
deprecated class ThreatModelFlowSource = ActiveThreatModelSource;
29+
30+
/**
31+
* A data flow source that is enabled in the current threat model configuration.
32+
*/
33+
class ActiveThreatModelSource extends DataFlow::Node {
34+
ActiveThreatModelSource() {
2835
exists(string kind |
2936
// Specific threat model.
3037
currentThreatModel(kind) and

go/ql/lib/semmle/go/security/FlowSources.qll

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,18 @@ abstract class SourceNode extends DataFlow::Node {
5555
}
5656

5757
/**
58+
* DEPRECATED: Use `ActiveThreatModelSource` instead.
59+
*
5860
* A class of data flow sources that respects the
5961
* current threat model configuration.
6062
*/
61-
class ThreatModelFlowSource extends DataFlow::Node {
62-
ThreatModelFlowSource() {
63+
deprecated class ThreatModelFlowSource = ActiveThreatModelSource;
64+
65+
/**
66+
* A data flow source that is enabled in the current threat model configuration.
67+
*/
68+
class ActiveThreatModelSource extends DataFlow::Node {
69+
ActiveThreatModelSource() {
6370
exists(string kind |
6471
// Specific threat model.
6572
currentThreatModel(kind) and

java/ql/lib/semmle/code/java/dataflow/FlowSources.qll

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,18 @@ abstract class SourceNode extends DataFlow::Node {
4242
}
4343

4444
/**
45+
* DEPRECATED: Use `ActiveThreatModelSource` instead.
46+
*
4547
* A class of data flow sources that respects the
4648
* current threat model configuration.
4749
*/
48-
class ThreatModelFlowSource extends DataFlow::Node {
49-
ThreatModelFlowSource() {
50+
deprecated class ThreatModelFlowSource = ActiveThreatModelSource;
51+
52+
/**
53+
* A data flow source that is enabled in the current threat model configuration.
54+
*/
55+
class ActiveThreatModelSource extends DataFlow::Node {
56+
ActiveThreatModelSource() {
5057
exists(string kind |
5158
// Specific threat model.
5259
currentThreatModel(kind) and

0 commit comments

Comments
 (0)