Skip to content

Commit 03d63de

Browse files
Address reviews - rename and update doc comments
1 parent 1bd5005 commit 03d63de

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

go/ql/lib/semmle/go/concepts/HTTP.qll

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ module Http {
381381
predicate guardedBy(DataFlow::Node check) { super.guardedBy(check) }
382382
}
383383

384-
/** Provides a class for modeling HTTP response cookie writes. */
384+
/** Provides a class for modeling new HTTP response cookie write APIs. */
385385
module CookieWrite {
386386
/**
387387
* A write of an HTTP Cookie to an HTTP response.
@@ -424,10 +424,10 @@ module Http {
424424
DataFlow::Node getHttpOnly() { result = super.getHttpOnly() }
425425
}
426426

427-
/** Provides a class for modeling the options of an HTTP cookie. */
428-
module CookieOptions {
427+
/** Provides a class for modeling the new APIs for writes to options of an HTTP cookie. */
428+
module CookieOptionWrite {
429429
/**
430-
* An HTTP Cookie object.
430+
* A write to an HTTP cookie object.
431431
*
432432
* Extend this class to model new APIs. If you want to refine existing API models,
433433
* extend `HTTP::CookieOptions` instead.
@@ -436,40 +436,40 @@ module Http {
436436
/** Gets the node representing the cookie object for the options being set. */
437437
abstract DataFlow::Node getCookieOutput();
438438

439-
/** Gets the name of the cookie represented. */
439+
/** Gets the name of the cookie represented, if any. */
440440
abstract DataFlow::Node getName();
441441

442-
/** Gets the value of the cookie represented. */
442+
/** Gets the value of the cookie represented, if any. */
443443
abstract DataFlow::Node getValue();
444444

445-
/** Gets the `Secure` attribute of the cookie represented. */
445+
/** Gets the `Secure` attribute of the cookie represented, if any. */
446446
abstract DataFlow::Node getSecure();
447447

448-
/** Gets the `HttpOnly` attribute of the cookie represented. */
448+
/** Gets the `HttpOnly` attribute of the cookie represented, if any. */
449449
abstract DataFlow::Node getHttpOnly();
450450
}
451451
}
452452

453453
/**
454-
* An HTTP Cookie.
454+
* A write to an HTTP cookie object.
455455
*
456456
* Extend this class to refine existing API models. If you want to model new APIs,
457457
* extend `HTTP::CookieOptions::Range` instead.
458458
*/
459-
class CookieOptions extends DataFlow::Node instanceof CookieOptions::Range {
459+
class CookieOptionWrite extends DataFlow::Node instanceof CookieOptionWrite::Range {
460460
/** Gets the node representing the cookie object for the options being set. */
461461
DataFlow::Node getCookieOutput() { result = super.getCookieOutput() }
462462

463-
/** Gets the name of the cookie represented. */
463+
/** Gets the name of the cookie represented, if any. */
464464
DataFlow::Node getName() { result = super.getName() }
465465

466-
/** Gets the value of the cookie represented. */
466+
/** Gets the value of the cookie represented, if any. */
467467
DataFlow::Node getValue() { result = super.getValue() }
468468

469-
/** Gets the `Secure` attribute of the cookie represented. */
469+
/** Gets the `Secure` attribute of the cookie represented, if any. */
470470
DataFlow::Node getSecure() { result = super.getSecure() }
471471

472-
/** Gets the `HttpOnly` attribute of the cookie represented. */
472+
/** Gets the `HttpOnly` attribute of the cookie represented, if any. */
473473
DataFlow::Node getHttpOnly() { result = super.getHttpOnly() }
474474
}
475475
}

go/ql/lib/semmle/go/frameworks/stdlib/NetHttp.qll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -306,15 +306,15 @@ module NetHttp {
306306
override DataFlow::Node getHttpOnly() { result = this.getArgument(1) }
307307
}
308308

309-
private class CookieFieldWrite extends Http::CookieOptions::Range {
310-
Write w;
311-
Field f;
309+
private class CookieFieldWrite extends Http::CookieOptionWrite::Range {
312310
DataFlow::Node written;
313311
string fieldName;
314312

315313
CookieFieldWrite() {
316-
f.hasQualifiedName(package("net/http", ""), "Cookie", fieldName) and
317-
w.writesField(this, f, written)
314+
exists(Write w, Field f |
315+
f.hasQualifiedName(package("net/http", ""), "Cookie", fieldName) and
316+
w.writesField(this, f, written)
317+
)
318318
}
319319

320320
override DataFlow::Node getCookieOutput() { result = this }

go/ql/lib/semmle/go/security/SecureCookies.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ private module SensitiveCookieNameConfig implements DataFlow::ConfigSig {
2222
predicate isSink(DataFlow::Node sink) { exists(Http::CookieWrite cw | sink = cw.getName()) }
2323

2424
predicate isAdditionalFlowStep(DataFlow::Node pred, DataFlow::Node succ) {
25-
exists(Http::CookieOptions co | co.getName() = pred and co.getCookieOutput() = succ)
25+
exists(Http::CookieOptionWrite co | co.getName() = pred and co.getCookieOutput() = succ)
2626
}
2727
}
2828

@@ -37,7 +37,7 @@ private module BooleanCookieSecureConfig implements DataFlow::ConfigSig {
3737
predicate isSink(DataFlow::Node sink) { exists(Http::CookieWrite cw | sink = cw.getSecure()) }
3838

3939
predicate isAdditionalFlowStep(DataFlow::Node pred, DataFlow::Node succ) {
40-
exists(Http::CookieOptions co | co.getSecure() = pred and co.getCookieOutput() = succ)
40+
exists(Http::CookieOptionWrite co | co.getSecure() = pred and co.getCookieOutput() = succ)
4141
}
4242
}
4343

@@ -52,7 +52,7 @@ private module BooleanCookieHttpOnlyConfig implements DataFlow::ConfigSig {
5252
predicate isSink(DataFlow::Node sink) { exists(Http::CookieWrite cw | sink = cw.getHttpOnly()) }
5353

5454
predicate isAdditionalFlowStep(DataFlow::Node pred, DataFlow::Node succ) {
55-
exists(Http::CookieOptions co | co.getHttpOnly() = pred and co.getCookieOutput() = succ)
55+
exists(Http::CookieOptionWrite co | co.getHttpOnly() = pred and co.getCookieOutput() = succ)
5656
}
5757
}
5858

0 commit comments

Comments
 (0)