diff --git a/ql/test/experimental/CWE-1004/vendor/github.com/gin-gonic/gin/stub.go b/ql/test/experimental/CWE-1004/vendor/github.com/gin-gonic/gin/stub.go index eb68095e53e..e343d5f2aa0 100644 --- a/ql/test/experimental/CWE-1004/vendor/github.com/gin-gonic/gin/stub.go +++ b/ql/test/experimental/CWE-1004/vendor/github.com/gin-gonic/gin/stub.go @@ -2,36 +2,33 @@ // This is a simple stub for github.com/gin-gonic/gin, strictly for use in testing. // See the LICENSE file for information about the licensing of the original library. -// Source: github.com/gin-gonic/gin (exports: Context; functions: ) +// Source: github.com/gin-gonic/gin (exports: Context; functions: Default) // Package gin is a stub of github.com/gin-gonic/gin, generated by depstubber. package gin import ( bufio "bufio" + template "html/template" io "io" multipart "mime/multipart" net "net" http "net/http" - sync "sync" time "time" ) type Context struct { - Request *http.Request - Writer ResponseWriter - Params Params - KeysMutex *sync.RWMutex - Keys map[string]interface{} - Errors interface{} - Accepted []string + Request *http.Request + Writer ResponseWriter + Params Params + Keys map[string]interface{} + Errors interface{} + Accepted []string } func (_ *Context) Abort() {} -func (_ *Context) AbortWithError(_ int, _ interface { - Error() string -}) *Error { +func (_ *Context) AbortWithError(_ int, _ error) *Error { return nil } @@ -41,51 +38,35 @@ func (_ *Context) AbortWithStatusJSON(_ int, _ interface{}) {} func (_ *Context) AsciiJSON(_ int, _ interface{}) {} -func (_ *Context) Bind(_ interface{}) interface { - Error() string -} { +func (_ *Context) Bind(_ interface{}) error { return nil } -func (_ *Context) BindHeader(_ interface{}) interface { - Error() string -} { +func (_ *Context) BindHeader(_ interface{}) error { return nil } -func (_ *Context) BindJSON(_ interface{}) interface { - Error() string -} { +func (_ *Context) BindJSON(_ interface{}) error { return nil } -func (_ *Context) BindQuery(_ interface{}) interface { - Error() string -} { +func (_ *Context) BindQuery(_ interface{}) error { return nil } -func (_ *Context) BindUri(_ interface{}) interface { - Error() string -} { +func (_ *Context) BindUri(_ interface{}) error { return nil } -func (_ *Context) BindWith(_ interface{}, _ interface{}) interface { - Error() string -} { +func (_ *Context) BindWith(_ interface{}, _ interface{}) error { return nil } -func (_ *Context) BindXML(_ interface{}) interface { - Error() string -} { +func (_ *Context) BindXML(_ interface{}) error { return nil } -func (_ *Context) BindYAML(_ interface{}) interface { - Error() string -} { +func (_ *Context) BindYAML(_ interface{}) error { return nil } @@ -97,9 +78,7 @@ func (_ *Context) ContentType() string { return "" } -func (_ *Context) Cookie(_ string) (string, interface { - Error() string -}) { +func (_ *Context) Cookie(_ string) (string, error) { return "", nil } @@ -107,7 +86,7 @@ func (_ *Context) Copy() *Context { return nil } -func (_ *Context) Data(_ int, _ string, _ []uint8) {} +func (_ *Context) Data(_ int, _ string, _ []byte) {} func (_ *Context) DataFromReader(_ int, _ int64, _ string, _ io.Reader, _ map[string]string) {} @@ -127,15 +106,11 @@ func (_ *Context) Done() <-chan struct{} { return nil } -func (_ *Context) Err() interface { - Error() string -} { +func (_ *Context) Err() error { return nil } -func (_ *Context) Error(_ interface { - Error() string -}) *Error { +func (_ *Context) Error(_ error) *Error { return nil } @@ -145,9 +120,7 @@ func (_ *Context) FileAttachment(_ string, _ string) {} func (_ *Context) FileFromFS(_ string, _ http.FileSystem) {} -func (_ *Context) FormFile(_ string) (*multipart.FileHeader, interface { - Error() string -}) { +func (_ *Context) FormFile(_ string) (*multipart.FileHeader, error) { return nil, nil } @@ -207,9 +180,7 @@ func (_ *Context) GetQueryMap(_ string) (map[string]string, bool) { return nil, false } -func (_ *Context) GetRawData() ([]uint8, interface { - Error() string -}) { +func (_ *Context) GetRawData() ([]byte, error) { return nil, nil } @@ -237,6 +208,14 @@ func (_ *Context) GetTime(_ string) time.Time { return time.Time{} } +func (_ *Context) GetUint(_ string) uint { + return 0 +} + +func (_ *Context) GetUint64(_ string) uint64 { + return 0 +} + func (_ *Context) HTML(_ int, _ string, _ interface{}) {} func (_ *Context) Handler() HandlerFunc { @@ -267,15 +246,11 @@ func (_ *Context) JSON(_ int, _ interface{}) {} func (_ *Context) JSONP(_ int, _ interface{}) {} -func (_ *Context) MultipartForm() (*multipart.Form, interface { - Error() string -}) { +func (_ *Context) MultipartForm() (*multipart.Form, error) { return nil, nil } -func (_ *Context) MustBindWith(_ interface{}, _ interface{}) interface { - Error() string -} { +func (_ *Context) MustBindWith(_ interface{}, _ interface{}) error { return nil } @@ -325,13 +300,15 @@ func (_ *Context) QueryMap(_ string) map[string]string { func (_ *Context) Redirect(_ int, _ string) {} +func (_ *Context) RemoteIP() (net.IP, bool) { + return nil, false +} + func (_ *Context) Render(_ int, _ interface{}) {} func (_ *Context) SSEvent(_ string, _ interface{}) {} -func (_ *Context) SaveUploadedFile(_ *multipart.FileHeader, _ string) interface { - Error() string -} { +func (_ *Context) SaveUploadedFile(_ *multipart.FileHeader, _ string) error { return nil } @@ -345,57 +322,39 @@ func (_ *Context) SetCookie(_ string, _ string, _ int, _ string, _ string, _ boo func (_ *Context) SetSameSite(_ http.SameSite) {} -func (_ *Context) ShouldBind(_ interface{}) interface { - Error() string -} { +func (_ *Context) ShouldBind(_ interface{}) error { return nil } -func (_ *Context) ShouldBindBodyWith(_ interface{}, _ interface{}) interface { - Error() string -} { +func (_ *Context) ShouldBindBodyWith(_ interface{}, _ interface{}) error { return nil } -func (_ *Context) ShouldBindHeader(_ interface{}) interface { - Error() string -} { +func (_ *Context) ShouldBindHeader(_ interface{}) error { return nil } -func (_ *Context) ShouldBindJSON(_ interface{}) interface { - Error() string -} { +func (_ *Context) ShouldBindJSON(_ interface{}) error { return nil } -func (_ *Context) ShouldBindQuery(_ interface{}) interface { - Error() string -} { +func (_ *Context) ShouldBindQuery(_ interface{}) error { return nil } -func (_ *Context) ShouldBindUri(_ interface{}) interface { - Error() string -} { +func (_ *Context) ShouldBindUri(_ interface{}) error { return nil } -func (_ *Context) ShouldBindWith(_ interface{}, _ interface{}) interface { - Error() string -} { +func (_ *Context) ShouldBindWith(_ interface{}, _ interface{}) error { return nil } -func (_ *Context) ShouldBindXML(_ interface{}) interface { - Error() string -} { +func (_ *Context) ShouldBindXML(_ interface{}) error { return nil } -func (_ *Context) ShouldBindYAML(_ interface{}) interface { - Error() string -} { +func (_ *Context) ShouldBindYAML(_ interface{}) error { return nil } @@ -415,10 +374,137 @@ func (_ *Context) XML(_ int, _ interface{}) {} func (_ *Context) YAML(_ int, _ interface{}) {} +func Default() *Engine { + return nil +} + +type Engine struct { + RouterGroup RouterGroup + RedirectTrailingSlash bool + RedirectFixedPath bool + HandleMethodNotAllowed bool + ForwardedByClientIP bool + RemoteIPHeaders []string + TrustedProxies []string + AppEngine bool + UseRawPath bool + UnescapePathValues bool + MaxMultipartMemory int64 + RemoveExtraSlash bool + HTMLRender interface{} + FuncMap template.FuncMap +} + +func (_ *Engine) Any(_ string, _ ...HandlerFunc) IRoutes { + return nil +} + +func (_ *Engine) BasePath() string { + return "" +} + +func (_ *Engine) DELETE(_ string, _ ...HandlerFunc) IRoutes { + return nil +} + +func (_ *Engine) Delims(_ string, _ string) *Engine { + return nil +} + +func (_ *Engine) GET(_ string, _ ...HandlerFunc) IRoutes { + return nil +} + +func (_ *Engine) Group(_ string, _ ...HandlerFunc) *RouterGroup { + return nil +} + +func (_ *Engine) HEAD(_ string, _ ...HandlerFunc) IRoutes { + return nil +} + +func (_ *Engine) Handle(_ string, _ string, _ ...HandlerFunc) IRoutes { + return nil +} + +func (_ *Engine) HandleContext(_ *Context) {} + +func (_ *Engine) LoadHTMLFiles(_ ...string) {} + +func (_ *Engine) LoadHTMLGlob(_ string) {} + +func (_ *Engine) NoMethod(_ ...HandlerFunc) {} + +func (_ *Engine) NoRoute(_ ...HandlerFunc) {} + +func (_ *Engine) OPTIONS(_ string, _ ...HandlerFunc) IRoutes { + return nil +} + +func (_ *Engine) PATCH(_ string, _ ...HandlerFunc) IRoutes { + return nil +} + +func (_ *Engine) POST(_ string, _ ...HandlerFunc) IRoutes { + return nil +} + +func (_ *Engine) PUT(_ string, _ ...HandlerFunc) IRoutes { + return nil +} + +func (_ *Engine) Routes() RoutesInfo { + return nil +} + +func (_ *Engine) Run(_ ...string) error { + return nil +} + +func (_ *Engine) RunFd(_ int) error { + return nil +} + +func (_ *Engine) RunListener(_ net.Listener) error { + return nil +} + +func (_ *Engine) RunTLS(_ string, _ string, _ string) error { + return nil +} + +func (_ *Engine) RunUnix(_ string) error { + return nil +} + +func (_ *Engine) SecureJsonPrefix(_ string) *Engine { + return nil +} + +func (_ *Engine) ServeHTTP(_ http.ResponseWriter, _ *http.Request) {} + +func (_ *Engine) SetFuncMap(_ template.FuncMap) {} + +func (_ *Engine) SetHTMLTemplate(_ *template.Template) {} + +func (_ *Engine) Static(_ string, _ string) IRoutes { + return nil +} + +func (_ *Engine) StaticFS(_ string, _ http.FileSystem) IRoutes { + return nil +} + +func (_ *Engine) StaticFile(_ string, _ string) IRoutes { + return nil +} + +func (_ *Engine) Use(_ ...HandlerFunc) IRoutes { + return nil +} + type Error struct { - Err interface { - Error() string - } + Err error Type ErrorType Meta interface{} } @@ -435,9 +521,7 @@ func (_ *Error) JSON() interface{} { return nil } -func (_ *Error) MarshalJSON() ([]uint8, interface { - Error() string -}) { +func (_ *Error) MarshalJSON() ([]byte, error) { return nil, nil } @@ -449,10 +533,36 @@ func (_ *Error) SetType(_ ErrorType) *Error { return nil } +func (_ *Error) Unwrap() error { + return nil +} + type ErrorType uint64 type HandlerFunc func(*Context) +type HandlersChain []HandlerFunc + +func (_ HandlersChain) Last() HandlerFunc { + return nil +} + +type IRoutes interface { + Any(_ string, _ ...HandlerFunc) IRoutes + DELETE(_ string, _ ...HandlerFunc) IRoutes + GET(_ string, _ ...HandlerFunc) IRoutes + HEAD(_ string, _ ...HandlerFunc) IRoutes + Handle(_ string, _ string, _ ...HandlerFunc) IRoutes + OPTIONS(_ string, _ ...HandlerFunc) IRoutes + PATCH(_ string, _ ...HandlerFunc) IRoutes + POST(_ string, _ ...HandlerFunc) IRoutes + PUT(_ string, _ ...HandlerFunc) IRoutes + Static(_ string, _ string) IRoutes + StaticFS(_ string, _ http.FileSystem) IRoutes + StaticFile(_ string, _ string) IRoutes + Use(_ ...HandlerFunc) IRoutes +} + type Negotiate struct { Offered []string HTMLName string @@ -482,19 +592,86 @@ type ResponseWriter interface { CloseNotify() <-chan bool Flush() Header() http.Header - Hijack() (net.Conn, *bufio.ReadWriter, interface { - Error() string - }) + Hijack() (net.Conn, *bufio.ReadWriter, error) Pusher() http.Pusher Size() int Status() int - Write(_ []uint8) (int, interface { - Error() string - }) + Write(_ []byte) (int, error) WriteHeader(_ int) WriteHeaderNow() - WriteString(_ string) (int, interface { - Error() string - }) + WriteString(_ string) (int, error) Written() bool } + +type RouteInfo struct { + Method string + Path string + Handler string + HandlerFunc HandlerFunc +} + +type RouterGroup struct { + Handlers HandlersChain +} + +func (_ *RouterGroup) Any(_ string, _ ...HandlerFunc) IRoutes { + return nil +} + +func (_ *RouterGroup) BasePath() string { + return "" +} + +func (_ *RouterGroup) DELETE(_ string, _ ...HandlerFunc) IRoutes { + return nil +} + +func (_ *RouterGroup) GET(_ string, _ ...HandlerFunc) IRoutes { + return nil +} + +func (_ *RouterGroup) Group(_ string, _ ...HandlerFunc) *RouterGroup { + return nil +} + +func (_ *RouterGroup) HEAD(_ string, _ ...HandlerFunc) IRoutes { + return nil +} + +func (_ *RouterGroup) Handle(_ string, _ string, _ ...HandlerFunc) IRoutes { + return nil +} + +func (_ *RouterGroup) OPTIONS(_ string, _ ...HandlerFunc) IRoutes { + return nil +} + +func (_ *RouterGroup) PATCH(_ string, _ ...HandlerFunc) IRoutes { + return nil +} + +func (_ *RouterGroup) POST(_ string, _ ...HandlerFunc) IRoutes { + return nil +} + +func (_ *RouterGroup) PUT(_ string, _ ...HandlerFunc) IRoutes { + return nil +} + +func (_ *RouterGroup) Static(_ string, _ string) IRoutes { + return nil +} + +func (_ *RouterGroup) StaticFS(_ string, _ http.FileSystem) IRoutes { + return nil +} + +func (_ *RouterGroup) StaticFile(_ string, _ string) IRoutes { + return nil +} + +func (_ *RouterGroup) Use(_ ...HandlerFunc) IRoutes { + return nil +} + +type RoutesInfo []RouteInfo diff --git a/ql/test/experimental/CWE-1004/vendor/modules.txt b/ql/test/experimental/CWE-1004/vendor/modules.txt index 659b82c1e3d..f38695b1ffc 100644 --- a/ql/test/experimental/CWE-1004/vendor/modules.txt +++ b/ql/test/experimental/CWE-1004/vendor/modules.txt @@ -1,4 +1,4 @@ -# github.com/gin-gonic/gin v1.6.2 +# github.com/gin-gonic/gin v1.7.1 ## explicit github.com/gin-gonic/gin # github.com/gorilla/sessions v1.2.1