Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Conversation

@max-schaefer
Copy link
Contributor

Mostly related to the WebSocket model introduced in #107 and refined in #109.

Renaming the QLL file from Websocket.qll to WebSocket.qll is technically a breaking change, but we only just introduced it, so I think it's fine. (And also one wouldn't normally import that module directly anyway.)

@max-schaefer max-schaefer requested a review from a team May 22, 2020 09:46
Copy link
Contributor

@sauyon sauyon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments and a question.

ql/src/go.qll Outdated
import semmle.go.frameworks.NoSQL
import semmle.go.frameworks.SystemCommandExecutors
import semmle.go.frameworks.SQL
import semmle.go.frameworks.XPath
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we realphabetize this in this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good plan.

}

func (_ *Context) IsWebsocket() bool {
func (_ *Context) IsWebSocket() bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
func (_ *Context) IsWebSocket() bool {
func (_ *Context) IsWebsocket() bool {

I assume this change was unintended?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, yes; let me revert those changes.

type Socket struct {
Conn interface{}
WebsocketDialer interface{}
WebSocketDialer interface{}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
WebSocketDialer interface{}
WebsocketDialer interface{}

ditto

type Socket struct {
Conn interface{}
WebsocketDialer interface{}
WebSocketDialer interface{}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
WebSocketDialer interface{}
WebsocketDialer interface{}

* refer to `"github.com/go-pg/pg/types"`, but also to `"github.com/go-pg/pg/v10/types"`.
*/
bindingset[result, mod, path]
string package(string mod, string path) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A thought for the future: should we add a version parameter to match the version as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could do, in the future.

Max Schaefer added 5 commits May 22, 2020 11:11
The predicate now works with an empty package path.

The way this is implemented is perhaps slightly non-obvious: the `($|/)\\Q" + path + "\\E"` part of the regular expression either matches the end of the string (and `path` must then be empty), or a slash followed by `path` (which may or may not be empty).

We do allow non-canonical import paths ending in `/`, which the compiler rejects. We could disallow that by putting a `(?!$)` assertion after the `/`, but that seems overkill.
@max-schaefer
Copy link
Contributor Author

Thanks, @sauyon, comments addressed.

@max-schaefer
Copy link
Contributor Author

Added one more (unrelated) fix.

@max-schaefer max-schaefer merged commit 4206408 into github:master May 22, 2020
@max-schaefer max-schaefer deleted the cleanup-107 branch August 28, 2020 06:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants