Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite uses of IPA types to new syntax #17980

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions python/ql/lib/semmle/python/Concepts.qll
Original file line number Diff line number Diff line change
Expand Up @@ -1419,29 +1419,24 @@ module Http {
}
}

private newtype TSameSiteValue =
TSameSiteStrict() or
TSameSiteLax() or
TSameSiteNone()

/** A possible value for the SameSite attribute of a cookie. */
class SameSiteValue extends TSameSiteValue {
abstract new class SameSiteValue {
/** Gets a string representation of this value. */
string toString() { none() }
abstract string toString();
}

/** A `Strict` value of the `SameSite` attribute. */
class SameSiteStrict extends SameSiteValue, TSameSiteStrict {
final new class SameSiteStrict extends SameSiteValue {
override string toString() { result = "Strict" }
}

/** A `Lax` value of the `SameSite` attribute. */
class SameSiteLax extends SameSiteValue, TSameSiteLax {
final new class SameSiteLax extends SameSiteValue {
override string toString() { result = "Lax" }
}

/** A `None` value of the `SameSite` attribute. */
class SameSiteNone extends SameSiteValue, TSameSiteNone {
final new class SameSiteNone extends SameSiteValue {
override string toString() { result = "None" }
}
}
Expand Down
Loading
Loading