Skip to content

Commit 8658335

Browse files
committed
Apply review suggestions
1 parent bb48b72 commit 8658335

File tree

1 file changed

+26
-8
lines changed

1 file changed

+26
-8
lines changed

javascript/frameworks/cap/lib/advanced_security/javascript/frameworks/cap/RemoteFlowSources.qll

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import advanced_security.javascript.frameworks.cap.CDS
1111
* ```
1212
* All the parameters named `req` and `msg` are captured in the above example.
1313
*
14-
* REQUIRES that a `UserDefinedApplicationService` is explicitly defined
14+
* This REQUIRES that a `UserDefinedApplicationService` is explicitly defined.
1515
*/
1616
class HandlerParameter extends ParameterNode, RemoteFlowSource {
1717
Handler handler;
@@ -52,7 +52,8 @@ class HandlerParameter extends ParameterNode, RemoteFlowSource {
5252
* ```
5353
* parameters named `req` are captured in the above example.
5454
*
55-
* REQUIRES that a cds file has compiled AND that a service name is explicitly provided in the handler registration
55+
* This REQUIRES that a CDS file has successfully compiled
56+
* AND that a service name is explicitly provided in the handler registration.
5657
*/
5758
class ServiceinCDSHandlerParameterWithName extends ParameterNode, RemoteFlowSource {
5859
ServiceinCDSHandlerParameterWithName() {
@@ -73,13 +74,13 @@ class ServiceinCDSHandlerParameterWithName extends ParameterNode, RemoteFlowSour
7374
* A parameter of a handler registered for a service on an event. e.g.
7475
* ```javascript
7576
* cds.serve('./test-service').with((srv) => {
76-
* srv.before('READ', '*', (req) => req.reply([]))
77+
* srv.before('READ', '*', (req) => req.reply([]))
7778
* })
7879
* ```
7980
* The parameter named `req` is captured in the above example.
8081
*
81-
* DOES NOT REQUIRE that a `UserDefinedApplicationService` is explicitly defined
82-
* DOES NOT REQUIRE that the name is provided explicitly
82+
* This DOES NOT REQUIRE that a `UserDefinedApplicationService` is explicitly defined and
83+
* this also DOES NOT REQUIRE that the name is provided explicitly.
8384
*/
8485
class HandlerParameterImplicitService extends ParameterNode, RemoteFlowSource {
8586
Handler handler;
@@ -90,9 +91,26 @@ class HandlerParameterImplicitService extends ParameterNode, RemoteFlowSource {
9091
handler = handlerRegistration.getHandler() and
9192
this = handler.getParameter(0) and
9293
service.getAHandlerRegistration() = handlerRegistration and
93-
//this will otherwise duplicate on the case where we do actually know the
94-
//name from the cds file and it matches up
95-
//only relevant if you are using the specific type anyhow (as opposed to RemoteFlowSource)
94+
/*
95+
* this will otherwise duplicate on the case where we do actually know the
96+
* name from the cds file and it matches up
97+
* example:
98+
* ```
99+
* srv.before('READ', 'Service1', (req) => req.reply([]))
100+
* ```
101+
* where Service1 is also defined in:
102+
* Service1.cds
103+
* ```
104+
* {
105+
* "namespace": "sap.capire.test",
106+
* "definitions": {
107+
* "sap.capire.test.Test": {
108+
* "kind": "entity",
109+
* ...
110+
* ```
111+
* only relevant if you are using the specific type anyhow (as opposed to RemoteFlowSource)
112+
*/
113+
96114
not this instanceof ServiceinCDSHandlerParameterWithName
97115
)
98116
}

0 commit comments

Comments
 (0)