Skip to content

Commit 9a2e99b

Browse files
committed
Appease compiler to make SensitiveExposure pass
Will fix later
1 parent 1e83f5a commit 9a2e99b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

javascript/frameworks/cap/src/sensitive-exposure/SensitiveExposure.ql

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,25 @@ import advanced_security.javascript.frameworks.cap.CDS
1616
import advanced_security.javascript.frameworks.cap.CAPLogInjectionQuery
1717
import DataFlow::PathGraph
1818

19+
/**
20+
* An entity instance obtained by the entity's namespace,
21+
* via `cds.entities`
22+
* ```javascript
23+
* // Obtained through `cds.entities`
24+
* const { Service1 } = cds.entities("sample.application.namespace");
25+
* ```
26+
*/
27+
class EntityEntry extends DataFlow::CallNode {
28+
EntityEntry() { exists(CdsEntitiesCall c | c.getACall() = this) }
29+
30+
/**
31+
* Gets the namespace that this entity belongs to.
32+
*/
33+
string getNamespace() {
34+
result = this.getArgument(0).getALocalSource().asExpr().(StringLiteral).getValue()
35+
}
36+
}
37+
1938
SourceNode entityAccesses(TypeTracker t, string entityNamespace) {
2039
t.start() and
2140
exists(EntityEntry e | result = e and entityNamespace = e.getNamespace())

0 commit comments

Comments
 (0)