33import go
44
55/**
6- * A data-flow node that establishes a new WebSocket connection.
6+ * A function call that establishes a new WebSocket connection.
77 *
88 * Extend this class to refine existing API models. If you want to model new APIs,
99 * extend `WebSocketRequestCall::Range` instead.
@@ -20,7 +20,7 @@ class WebSocketRequestCall extends DataFlow::CallNode {
2020/** Provides classes for working with WebSocket request functions. */
2121module WebSocketRequestCall {
2222 /**
23- * A data-flow node that establishes a new WebSocket connection.
23+ * A function call that establishes a new WebSocket connection.
2424 *
2525 * Extend this class to model new APIs. If you want to refine existing
2626 * API models, extend `WebSocketRequestCall` instead.
@@ -31,8 +31,7 @@ module WebSocketRequestCall {
3131 }
3232
3333 /**
34- * A WebSocket request expression string used in an API function of the
35- * `golang.org/x/net/websocket` package.
34+ * A call to the `Dial` function of the `golang.org/x/net/websocket` package.
3635 */
3736 private class GolangXNetDialFunc extends Range {
3837 GolangXNetDialFunc ( ) {
@@ -44,8 +43,7 @@ module WebSocketRequestCall {
4443 }
4544
4645 /**
47- * A WebSocket DialConfig expression string used in an API function
48- * of the `golang.org/x/net/websocket` package.
46+ * A call to the `DialConfig` function of the `golang.org/x/net/websocket` package.
4947 */
5048 private class GolangXNetDialConfigFunc extends Range {
5149 GolangXNetDialConfigFunc ( ) {
@@ -64,13 +62,12 @@ module WebSocketRequestCall {
6462 }
6563
6664 /**
67- * A WebSocket request expression string used in an API function
68- * of the `github.com/gorilla/websocket` package.
65+ * A call to the `Dialer` or `DialContext` function of the `github.com/gorilla/websocket` package.
6966 */
70- private class GorillaWebsocketDialFunc extends Range {
67+ private class GorillaWebSocketDialFunc extends Range {
7168 DataFlow:: Node url ;
7269
73- GorillaWebsocketDialFunc ( ) {
70+ GorillaWebSocketDialFunc ( ) {
7471 // func (d *Dialer) Dial(urlStr string, requestHeader http.Header) (*Conn, *http.Response, error)
7572 // func (d *Dialer) DialContext(ctx context.Context, urlStr string, requestHeader http.Header) (*Conn, *http.Response, error)
7673 exists ( string name , Method f |
@@ -87,8 +84,7 @@ module WebSocketRequestCall {
8784 }
8885
8986 /**
90- * A WebSocket request expression string used in an API function
91- * of the `github.com/gobwas/ws` package.
87+ * A call to the `Dialer.Dial` method of the `github.com/gobwas/ws` package.
9288 */
9389 private class GobwasWsDialFunc extends Range {
9490 GobwasWsDialFunc ( ) {
@@ -106,11 +102,10 @@ module WebSocketRequestCall {
106102 }
107103
108104 /**
109- * A WebSocket request expression string used in an API function
110- * of the `nhooyr.io/websocket` package.
105+ * A call to the `Dial` function of the `nhooyr.io/websocket` package.
111106 */
112- private class NhooyrWebsocketDialFunc extends Range {
113- NhooyrWebsocketDialFunc ( ) {
107+ private class NhooyrWebSocketDialFunc extends Range {
108+ NhooyrWebSocketDialFunc ( ) {
114109 // func Dial(ctx context.Context, u string, opts *DialOptions) (*Conn, *http.Response, error)
115110 this .getTarget ( ) .hasQualifiedName ( package ( "nhooyr.io" , "websocket" ) , "Dial" )
116111 }
@@ -119,26 +114,24 @@ module WebSocketRequestCall {
119114 }
120115
121116 /**
122- * A WebSocket request expression string used in an API function
123- * of the `github.com/sacOO7/gowebsocket` package.
117+ * A call to the `BuildProxy` or `New` function of the `github.com/sacOO7/gowebsocket` package.
124118 */
125119 private class SacOO7DialFunc extends Range {
126120 SacOO7DialFunc ( ) {
127121 // func BuildProxy(Url string) func(*http.Request) (*url.URL, error)
128122 // func New(url string) Socket
129- this .getTarget ( ) .hasQualifiedName ( "github.com/sacOO7/gowebsocket" , [ "New " , "BuildProxy " ] )
123+ this .getTarget ( ) .hasQualifiedName ( "github.com/sacOO7/gowebsocket" , [ "BuildProxy " , "New " ] )
130124 }
131125
132126 override DataFlow:: Node getRequestUrl ( ) { result = this .getArgument ( 0 ) }
133127 }
134128}
135129
136- /*
130+ /**
137131 * A message written to a WebSocket, considered as a flow sink for reflected XSS.
138132 */
139-
140- class WebsocketReaderAsSource extends UntrustedFlowSource:: Range {
141- WebsocketReaderAsSource ( ) {
133+ class WebSocketReaderAsSource extends UntrustedFlowSource:: Range {
134+ WebSocketReaderAsSource ( ) {
142135 exists ( WebSocketReader r | this = r .getAnOutput ( ) .getNode ( r .getACall ( ) ) )
143136 }
144137}
@@ -154,7 +147,7 @@ class WebSocketReader extends Function {
154147
155148 WebSocketReader ( ) { this = self }
156149
157- /** Gets an output of this function that is read from a WebSocket connection. */
150+ /** Gets an output of this function containing data that is read from a WebSocket connection. */
158151 FunctionOutput getAnOutput ( ) { result = self .getAnOutput ( ) }
159152}
160153
@@ -167,12 +160,12 @@ module WebSocketReader {
167160 * extend `WebSocketReader` instead.
168161 */
169162 abstract class Range extends Function {
170- /**Returns the parameter in which the function stores the message read. */
163+ /** Gets an output of this function containing data that is read from a WebSocket connection . */
171164 abstract FunctionOutput getAnOutput ( ) ;
172165 }
173166
174167 /**
175- * Models the ` Receive` method of the `golang.org/x/net/websocket` package.
168+ * The `Codec. Receive` method of the `golang.org/x/net/websocket` package.
176169 */
177170 private class GolangXNetCodecRecv extends Range , Method {
178171 GolangXNetCodecRecv ( ) {
@@ -184,7 +177,7 @@ module WebSocketReader {
184177 }
185178
186179 /**
187- * Models the ` Read` method of the `golang.org/x/net/websocket` package.
180+ * The `Conn. Read` method of the `golang.org/x/net/websocket` package.
188181 */
189182 private class GolangXNetConnRead extends Range , Method {
190183 GolangXNetConnRead ( ) {
@@ -196,10 +189,10 @@ module WebSocketReader {
196189 }
197190
198191 /**
199- * Models the ` Read` method of the `nhooyr.io/websocket` package.
192+ * The `Conn. Read` method of the `nhooyr.io/websocket` package.
200193 */
201- private class NhooyrWebsocketRead extends Range , Method {
202- NhooyrWebsocketRead ( ) {
194+ private class NhooyrWebSocketRead extends Range , Method {
195+ NhooyrWebSocketRead ( ) {
203196 // func (c *Conn) Read(ctx context.Context) (MessageType, []byte, error)
204197 this .hasQualifiedName ( "nhooyr.io/websocket" , "Conn" , "Read" )
205198 }
@@ -208,10 +201,10 @@ module WebSocketReader {
208201 }
209202
210203 /**
211- * Models the ` Reader` method of the `nhooyr.io/websocket` package.
204+ * The `Conn. Reader` method of the `nhooyr.io/websocket` package.
212205 */
213- private class NhooyrWebsocketReader extends Range , Method {
214- NhooyrWebsocketReader ( ) {
206+ private class NhooyrWebSocketReader extends Range , Method {
207+ NhooyrWebSocketReader ( ) {
215208 // func (c *Conn) Reader(ctx context.Context) (MessageType, io.Reader, error)
216209 this .hasQualifiedName ( "nhooyr.io/websocket" , "Conn" , "Reader" )
217210 }
@@ -220,7 +213,7 @@ module WebSocketReader {
220213 }
221214
222215 /**
223- * Models the `ReadFrame`function of the `github.com/gobwas/ws` package.
216+ * The `ReadFrame` function of the `github.com/gobwas/ws` package.
224217 */
225218 private class GobwasWsReadFrame extends Range {
226219 GobwasWsReadFrame ( ) {
@@ -232,7 +225,7 @@ module WebSocketReader {
232225 }
233226
234227 /**
235- * Models the `ReadHeader`function of the `github.com/gobwas/ws` package.
228+ * The `ReadHeader` function of the `github.com/gobwas/ws` package.
236229 */
237230 private class GobwasWsReadHeader extends Range {
238231 GobwasWsReadHeader ( ) {
@@ -244,10 +237,10 @@ module WebSocketReader {
244237 }
245238
246239 /**
247- * Models the `ReadJson` function of the `github.com/gorilla/websocket` package.
240+ * The `ReadJson` function of the `github.com/gorilla/websocket` package.
248241 */
249- private class GorillaWebsocketReadJson extends Range {
250- GorillaWebsocketReadJson ( ) {
242+ private class GorillaWebSocketReadJson extends Range {
243+ GorillaWebSocketReadJson ( ) {
251244 // func ReadJSON(c *Conn, v interface{}) error
252245 this .hasQualifiedName ( "github.com/gorilla/websocket" , "ReadJSON" )
253246 }
@@ -256,10 +249,10 @@ module WebSocketReader {
256249 }
257250
258251 /**
259- * Models the ` ReadJson` method of the `github.com/gorilla/websocket` package.
252+ * The `Conn. ReadJson` method of the `github.com/gorilla/websocket` package.
260253 */
261- private class GorillaWebsocketConnReadJson extends Range , Method {
262- GorillaWebsocketConnReadJson ( ) {
254+ private class GorillaWebSocketConnReadJson extends Range , Method {
255+ GorillaWebSocketConnReadJson ( ) {
263256 // func (c *Conn) ReadJSON(v interface{}) error
264257 this .hasQualifiedName ( "github.com/gorilla/websocket" , "Conn" , "ReadJSON" )
265258 }
@@ -268,10 +261,10 @@ module WebSocketReader {
268261 }
269262
270263 /**
271- * Models the ` ReadMessage` method of the `github.com/gorilla/websocket` package.
264+ * The `Conn. ReadMessage` method of the `github.com/gorilla/websocket` package.
272265 */
273- private class GorillaWebsocketReadMessage extends Range , Method {
274- GorillaWebsocketReadMessage ( ) {
266+ private class GorillaWebSocketReadMessage extends Range , Method {
267+ GorillaWebSocketReadMessage ( ) {
275268 // func (c *Conn) ReadMessage() (messageType int, p []byte, err error)
276269 this .hasQualifiedName ( "github.com/gorilla/websocket" , "Conn" , "ReadMessage" )
277270 }
0 commit comments