Skip to content

Commit dcc1de4

Browse files
authored
Merge pull request #500 from owen-mc/add-missing-qldoc
Add missing QLDoc for public declarations
2 parents 530b791 + 5b09d35 commit dcc1de4

13 files changed

Lines changed: 94 additions & 5 deletions

.github/workflows/docs-review.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# When a PR is labelled with 'ready-for-docs-review',
2+
# this workflow comments on the PR to notify the GitHub CodeQL docs team.
3+
name: Request docs review
4+
on:
5+
# Runs in the context of the base repo.
6+
# This gives the workflow write access to comment on PRs.
7+
# The workflow should not check out or build the given ref,
8+
# or use untrusted data from the event payload in a command line.
9+
pull_request_target:
10+
types: [labeled]
11+
12+
jobs:
13+
request-docs-review:
14+
name: Request docs review
15+
# Run only on labelled PRs to the main repository.
16+
# Do not run on PRs to forks.
17+
if:
18+
github.event.label.name == 'ready-for-docs-review'
19+
&& github.event.pull_request.draft == false
20+
&& github.event.pull_request.base.repo.full_name == 'github/codeql-go'
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Comment to request docs review
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
PR_NUMBER: ${{ github.event.pull_request.number }}
27+
run: |
28+
gh pr comment "$PR_NUMBER" --repo "github/codeql-go" \
29+
--body "Hello @github/docs-content-codeql - this PR is ready for docs review."

ql/src/experimental/CWE-327/WeakCryptoAlgorithmCustomizations.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ import go
88
private import semmle.go.security.SensitiveActions
99
private import CryptoLibraries
1010

11+
/**
12+
* Provides default sources, sinks and sanitizers for reasoning about
13+
* sensitive information in weak cryptographic algorithms,
14+
* as well as extension points for adding your own.
15+
*/
1116
module WeakCryptoAlgorithm {
1217
/**
1318
* A data flow source for sensitive information in weak cryptographic algorithms.

ql/src/semmle/go/Expr.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ class RuneLit = CharLit;
344344
class StringLit extends @stringlit, BasicLit {
345345
override string getAPrimaryQlClass() { result = "StringLit" }
346346

347+
/** Holds if this string literal is a raw string literal. */
347348
predicate isRaw() { this.getText().matches("`%`") }
348349
}
349350

ql/src/semmle/go/frameworks/Beego.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ import go
77
import semmle.go.security.Xss
88
private import semmle.go.security.SafeUrlFlowCustomizations
99

10+
/**
11+
* Provides classes for working with untrusted flow sources, sinks and taint propagators
12+
* from the [Beego](`github.com/beego/beego`) package.
13+
*/
1014
module Beego {
1115
/** Gets the module path `github.com/astaxie/beego` or `github.com/beego/beego`. */
1216
bindingset[result]

ql/src/semmle/go/frameworks/BeegoOrm.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
import go
77
private import semmle.go.security.StoredXssCustomizations
88

9+
/**
10+
* Provides classes for working with untrusted flow sources, sinks and taint propagators
11+
* from the [Beego ORM](`github.com/astaxie/beego/orm`) subpackage.
12+
*/
913
module BeegoOrm {
1014
/** Gets the package name `github.com/astaxie/beego/orm`. */
1115
bindingset[result]

ql/src/semmle/go/frameworks/EvanphxJsonPatch.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ private module EvanphxJsonPatch {
4545
}
4646
}
4747

48-
private class Apply extends TaintTracking::FunctionModel {
48+
private class Apply extends TaintTracking::FunctionModel, Method {
4949
Apply() {
5050
exists(string fn |
5151
fn in ["Apply", "ApplyWithOptions", "ApplyIndent", "ApplyIndentWithOptions"]
5252
|
53-
this.hasQualifiedName(packagePath(), fn)
53+
this.hasQualifiedName(packagePath(), "Patch", fn)
5454
)
5555
}
5656

ql/src/semmle/go/frameworks/GoRestfulHttp.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/**
2+
* Provides models of the [go-restful library](https://github.com/emicklei/go-restful).
3+
*/
4+
15
import go
26

37
/**

ql/src/semmle/go/frameworks/SQL.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ module SQL {
217217
}
218218
}
219219

220+
/**
221+
* Provides classes for working with the [GORM](https://gorm.io/) package.
222+
*/
220223
module Gorm {
221224
/** Gets the package name for Gorm. */
222225
bindingset[result]

ql/src/semmle/go/frameworks/SystemCommandExecutors.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ private class GoShCommandExecution extends SystemCommandExecution::Range, DataFl
7777
override DataFlow::Node getCommandName() { result = this.getArgument(0) }
7878
}
7979

80+
/**
81+
* Provides classes for working with the
82+
* [golang.org/x/crypto/ssh](https://pkg.go.dev/golang.org/x/crypto/ssh) package.
83+
*/
8084
module CryptoSsh {
8185
/** Gets the package path `golang.org/x/crypto/ssh`. */
8286
bindingset[result]

ql/src/semmle/go/frameworks/WebSocket.qll

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,24 +298,39 @@ module WebSocketReader {
298298
}
299299
}
300300

301+
/**
302+
* Provides classes for working with the [Gorilla WebSocket](https://github.com/gorilla/websocket)
303+
* package.
304+
*/
301305
module GorillaWebsocket {
302306
/** Gets the package name `github.com/gorilla/websocket`. */
303307
bindingset[result]
304308
string packagePath() { result = package("github.com/gorilla", "websocket") }
305309
}
306310

311+
/**
312+
* Provides classes for working with the
313+
* [golang.org/x/net/websocket](https://pkg.go.dev/golang.org/x/net/websocket) package.
314+
*/
307315
module GolangOrgXNetWebsocket {
308316
/** Gets the package name `golang.org/x/net/websocket`. */
309317
bindingset[result]
310318
string packagePath() { result = package("golang.org/x/net", "websocket") }
311319
}
312320

321+
/**
322+
* Provides classes for working with the [nhooyr.io/websocket](http://nhooyr.io/websocket)
323+
* package.
324+
*/
313325
module NhooyrWebSocket {
314326
/** Gets the package name `nhooyr.io/websocket/`. */
315327
bindingset[result]
316328
string packagePath() { result = package("nhooyr.io/websocket", "") }
317329
}
318330

331+
/**
332+
* Provides classes for working with the [ws](https://github.com/gobwas/ws) package.
333+
*/
319334
module GobwasWs {
320335
/** Gets the package name `github.com/gobwas/ws`. */
321336
bindingset[result]

0 commit comments

Comments
 (0)