@@ -7,6 +7,7 @@ import semmle.go.security.RequestForgery
77module Twirp {
88 /**
99 * A *.pb.go file generated by Twirp.
10+ *
1011 * This file contains all the types representing protobuf messages and should have a companion *.twirp.go file.
1112 */
1213 class ProtobufGeneratedFile extends File {
@@ -38,7 +39,7 @@ module Twirp {
3839 /**
3940 * A type representing a protobuf message.
4041 */
41- class ProtobufMessage extends Type {
42+ class ProtobufMessageType extends Type {
4243 ProtobufMessage ( ) {
4344 exists ( TypeEntity te |
4445 te .getType ( ) = this and
@@ -51,7 +52,7 @@ module Twirp {
5152 * An interface type representing a Twirp service.
5253 */
5354 class ServiceInterface extends InterfaceType {
54- NamedType serviceInterface ;
55+ NamedType namedType ;
5556
5657 ServiceInterface ( ) {
5758 exists ( TypeEntity te |
@@ -62,7 +63,7 @@ module Twirp {
6263 }
6364
6465 /**
65- * Returns the name of the interface
66+ * Gets the name of the interface.
6667 */
6768 override string getName ( ) { result = serviceInterface .getName ( ) }
6869
@@ -73,7 +74,7 @@ module Twirp {
7374 }
7475
7576 /**
76- * A Twirp client
77+ * A Twirp client.
7778 */
7879 class ServiceClient extends NamedType {
7980 ServiceClient ( ) {
@@ -104,8 +105,8 @@ module Twirp {
104105 ClientConstructor ( ) {
105106 exists ( ServiceClient c |
106107 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"
109110 )
110111 }
111112 }
0 commit comments