@@ -7,6 +7,7 @@ import semmle.go.security.RequestForgery
7
7
module Twirp {
8
8
/**
9
9
* A *.pb.go file generated by Twirp.
10
+ *
10
11
* This file contains all the types representing protobuf messages and should have a companion *.twirp.go file.
11
12
*/
12
13
class ProtobufGeneratedFile extends File {
@@ -38,7 +39,7 @@ module Twirp {
38
39
/**
39
40
* A type representing a protobuf message.
40
41
*/
41
- class ProtobufMessage extends Type {
42
+ class ProtobufMessageType extends Type {
42
43
ProtobufMessage ( ) {
43
44
exists ( TypeEntity te |
44
45
te .getType ( ) = this and
@@ -51,7 +52,7 @@ module Twirp {
51
52
* An interface type representing a Twirp service.
52
53
*/
53
54
class ServiceInterface extends InterfaceType {
54
- NamedType serviceInterface ;
55
+ NamedType namedType ;
55
56
56
57
ServiceInterface ( ) {
57
58
exists ( TypeEntity te |
@@ -62,7 +63,7 @@ module Twirp {
62
63
}
63
64
64
65
/**
65
- * Returns the name of the interface
66
+ * Gets the name of the interface.
66
67
*/
67
68
override string getName ( ) { result = serviceInterface .getName ( ) }
68
69
@@ -73,7 +74,7 @@ module Twirp {
73
74
}
74
75
75
76
/**
76
- * A Twirp client
77
+ * A Twirp client.
77
78
*/
78
79
class ServiceClient extends NamedType {
79
80
ServiceClient ( ) {
@@ -104,8 +105,8 @@ module Twirp {
104
105
ClientConstructor ( ) {
105
106
exists ( ServiceClient c |
106
107
this .getName ( ) .toLowerCase ( ) = "new" + c .getName ( ) .toLowerCase ( ) and
107
- this .getParameter ( 0 ) .getType ( ) . getName ( ) = "string" and
108
- this .getParameter ( 1 ) . getType ( ) .getName ( ) = "HTTPClient"
108
+ this .getParameter ( 0 ) .getType ( ) instanceof StringType and
109
+ this .getParameterType ( 1 ) .getName ( ) = "HTTPClient"
109
110
)
110
111
}
111
112
}
0 commit comments