mirror of
https://github.com/github/codeql.git
synced 2025-12-22 19:56:32 +01:00
Make EmailSender an extendable API
This commit is contained in:
@@ -297,10 +297,15 @@ class HeaderDeclaration extends DataFlow::Node {
|
|||||||
DataFlow::Node getValueArg() { result = range.getValueArg() }
|
DataFlow::Node getValueArg() { result = range.getValueArg() }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** Provides classes for modeling Email APIs. */
|
||||||
* An operation that sends an email.
|
module EmailSender {
|
||||||
|
/**
|
||||||
|
* A data-flow node that sends an email.
|
||||||
|
*
|
||||||
|
* Extend this class to model new APIs. If you want to refine existing API models,
|
||||||
|
* extend `EmailSender` instead.
|
||||||
*/
|
*/
|
||||||
abstract class EmailSender extends DataFlow::CallCfgNode {
|
abstract class Range extends DataFlow::Node {
|
||||||
/**
|
/**
|
||||||
* Gets a data flow node holding the plaintext version of the email body.
|
* Gets a data flow node holding the plaintext version of the email body.
|
||||||
*/
|
*/
|
||||||
@@ -325,9 +330,47 @@ abstract class EmailSender extends DataFlow::CallCfgNode {
|
|||||||
* Gets a data flow node holding the subject of the email.
|
* Gets a data flow node holding the subject of the email.
|
||||||
*/
|
*/
|
||||||
abstract DataFlow::Node getSubject();
|
abstract DataFlow::Node getSubject();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A data-flow node that sends an email..
|
||||||
|
*
|
||||||
|
* Extend this class to refine existing API models. If you want to model new APIs,
|
||||||
|
* extend `EmailSender::Range` instead.
|
||||||
|
*/
|
||||||
|
class EmailSender extends DataFlow::Node {
|
||||||
|
EmailSender::Range range;
|
||||||
|
|
||||||
|
EmailSender() { this = range }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a data flow node holding the plaintext version of the email body.
|
||||||
|
*/
|
||||||
|
DataFlow::Node getPlainTextBody() { result = range.getPlainTextBody() }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a data flow node holding the html version of the email body.
|
||||||
|
*/
|
||||||
|
DataFlow::Node getHtmlBody() { result = range.getHtmlBody() }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a data flow node holding the recipients of the email.
|
||||||
|
*/
|
||||||
|
DataFlow::Node getTo() { result = range.getTo() }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a data flow node holding the senders of the email.
|
||||||
|
*/
|
||||||
|
DataFlow::Node getFrom() { result = range.getFrom() }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a data flow node holding the subject of the email.
|
||||||
|
*/
|
||||||
|
DataFlow::Node getSubject() { result = range.getSubject() }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a data flow node that refers to the HTML body or plaintext body of the email.
|
* Gets a data flow node that refers to the HTML body or plaintext body of the email.
|
||||||
*/
|
*/
|
||||||
DataFlow::Node getABody() { result in [getPlainTextBody(), getHtmlBody()] }
|
DataFlow::Node getABody() { result in [range.getPlainTextBody(), range.getHtmlBody()] }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user