1
- /**
2
- * Provides classes for modeling the `github.com/rs/cors` package.
3
- */
1
+ /** Provides classes for modeling the `github.com/rs/cors` package. */
4
2
5
3
import go
6
4
7
- /**
8
- * An abstract class for modeling the Go CORS handler model origin write.
9
- */
5
+ /** An abstract class for modeling the Go CORS handler model origin write. */
10
6
abstract class UniversalOriginWrite extends DataFlow:: ExprNode {
11
- /**
12
- * Get config variable holding header values
13
- */
7
+ /** Gets the config variable holding header values. */
14
8
abstract DataFlow:: Node getBase ( ) ;
15
9
16
- /**
17
- * Get config variable holding header values
18
- */
10
+ /** Gets the config variable holding header values. */
19
11
abstract Variable getConfig ( ) ;
20
12
}
21
13
22
14
/**
23
- * An abstract class for modeling the Go CORS handler model allow all origins write.
15
+ * An abstract class for modeling the Go CORS handler model allow all origins
16
+ * write.
24
17
*/
25
18
abstract class UniversalAllowAllOriginsWrite extends DataFlow:: ExprNode {
26
- /**
27
- * Get config variable holding header values
28
- */
19
+ /** Gets the config variable holding header values. */
29
20
abstract DataFlow:: Node getBase ( ) ;
30
21
31
- /**
32
- * Get config variable holding header values
33
- */
22
+ /** Gets the config variable holding header values. */
34
23
abstract Variable getConfig ( ) ;
35
24
}
36
25
37
26
/**
38
- * An abstract class for modeling the Go CORS handler model allow credentials write.
27
+ * An abstract class for modeling the Go CORS handler model allow credentials
28
+ * write.
39
29
*/
40
30
abstract class UniversalAllowCredentialsWrite extends DataFlow:: ExprNode {
41
- /**
42
- * Get config struct holding header values
43
- */
31
+ /** Gets the config struct holding header values. */
44
32
abstract DataFlow:: Node getBase ( ) ;
45
33
46
- /**
47
- * Get config variable holding header values
48
- */
34
+ /** Gets the config variable holding header values. */
49
35
abstract Variable getConfig ( ) ;
50
36
}
51
37
52
- /**
53
- * Provides classes for modeling the `github.com/rs/cors` package.
54
- */
38
+ /** Provides classes for modeling the `github.com/rs/cors` package. */
55
39
module RsCors {
56
40
/** Gets the package name `github.com/gin-gonic/gin`. */
57
41
string packagePath ( ) { result = package ( "github.com/rs/cors" , "" ) }
58
42
59
- /**
60
- * A new function create a new rs Handler
61
- */
43
+ /** The `New` function that creates a new rs Handler. */
62
44
class New extends Function {
63
45
New ( ) { exists ( Function f | f .hasQualifiedName ( packagePath ( ) , "New" ) | this = f ) }
64
46
}
65
47
66
48
/**
67
- * A write to the value of Access-Control-Allow-Credentials header
49
+ * A write to the value of Access-Control-Allow-Credentials header.
68
50
*/
69
51
class AllowCredentialsWrite extends UniversalAllowCredentialsWrite {
70
52
DataFlow:: Node base ;
@@ -77,14 +59,10 @@ module RsCors {
77
59
)
78
60
}
79
61
80
- /**
81
- * Get options struct holding header values
82
- */
62
+ /** Gets the options struct holding header values. */
83
63
override DataFlow:: Node getBase ( ) { result = base }
84
64
85
- /**
86
- * Get options variable holding header values
87
- */
65
+ /** Gets the options variable holding header values. */
88
66
override RsOptions getConfig ( ) {
89
67
exists ( RsOptions gc |
90
68
(
@@ -97,9 +75,7 @@ module RsCors {
97
75
}
98
76
}
99
77
100
- /**
101
- * A write to the value of Access-Control-Allow-Origins header
102
- */
78
+ /** A write to the value of Access-Control-Allow-Origins header. */
103
79
class AllowOriginsWrite extends UniversalOriginWrite {
104
80
DataFlow:: Node base ;
105
81
@@ -111,14 +87,10 @@ module RsCors {
111
87
)
112
88
}
113
89
114
- /**
115
- * Get options struct holding header values
116
- */
90
+ /** Gets the options struct holding header values. */
117
91
override DataFlow:: Node getBase ( ) { result = base }
118
92
119
- /**
120
- * Get options variable holding header values
121
- */
93
+ /** Gets the options variable holding header values. */
122
94
override RsOptions getConfig ( ) {
123
95
exists ( RsOptions gc |
124
96
(
@@ -132,7 +104,8 @@ module RsCors {
132
104
}
133
105
134
106
/**
135
- * A write to the value of Access-Control-Allow-Origins of value "*", overriding AllowOrigins
107
+ * A write to the value of Access-Control-Allow-Origins of value "*",
108
+ * overriding `AllowOrigins`.
136
109
*/
137
110
class AllowAllOriginsWrite extends UniversalAllowAllOriginsWrite {
138
111
DataFlow:: Node base ;
@@ -145,14 +118,10 @@ module RsCors {
145
118
)
146
119
}
147
120
148
- /**
149
- * Get options struct holding header values
150
- */
121
+ /** Gets the options struct holding header values. */
151
122
override DataFlow:: Node getBase ( ) { result = base }
152
123
153
- /**
154
- * Get options variable holding header values
155
- */
124
+ /** Gets options variable holding header values. */
156
125
override RsOptions getConfig ( ) {
157
126
exists ( RsOptions gc |
158
127
(
@@ -165,9 +134,7 @@ module RsCors {
165
134
}
166
135
}
167
136
168
- /**
169
- * A variable of type Options that holds the headers to be set.
170
- */
137
+ /** A variable of type Options that holds the headers to be set. */
171
138
class RsOptions extends Variable {
172
139
SsaWithFields v ;
173
140
@@ -176,9 +143,7 @@ module RsCors {
176
143
v .getType ( ) .hasQualifiedName ( packagePath ( ) , "Options" )
177
144
}
178
145
179
- /**
180
- * Get variable declaration of Options
181
- */
146
+ /** Gets the SSA variable declaration of Options. */
182
147
SsaWithFields getV ( ) { result = v }
183
148
}
184
149
}
0 commit comments