add fetch.Headers.Authorization as a CredentialsExpr

This commit is contained in:
Erik Krogh Kristensen
2020-06-02 23:02:16 +02:00
parent 14f0d1687a
commit b6dc94fccb
3 changed files with 40 additions and 0 deletions

View File

@@ -1147,5 +1147,21 @@ module NodeJSLib {
or
result = DataFlow::globalVarRef("fetch")
}
/** An expression that is passed as `http.request({ auth: <expr> }, ...)`. */
class FetchAuthorization extends CredentialsExpr {
FetchAuthorization() {
this =
moduleImport()
.getAConstructorInvocation("Headers")
.getArgument(0)
.getALocalSource()
.getAPropertyWrite("Authorization")
.getRhs()
.asExpr()
}
override string getCredentialsKind() { result = "authorization headers" }
}
}
}