mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Add Client::Watch
This commit is contained in:
@@ -3,6 +3,7 @@ extensions:
|
||||
pack: codeql/go-all
|
||||
extensible: sourceModel
|
||||
data:
|
||||
- ["go.mongodb.org/mongo-driver/mongo", "Client", True, "Watch", "", "", "ReturnValue[0]", "database", "manual"]
|
||||
- ["go.mongodb.org/mongo-driver/mongo", "Collection", True, "Aggregate", "", "", "ReturnValue[0]", "database", "manual"]
|
||||
- ["go.mongodb.org/mongo-driver/mongo", "Collection", True, "Distinct", "", "", "ReturnValue[0]", "database", "manual"]
|
||||
- ["go.mongodb.org/mongo-driver/mongo", "Collection", True, "Find", "", "", "ReturnValue[0]", "database", "manual"]
|
||||
|
||||
@@ -104,3 +104,16 @@ func test_mongo_driver_mongo_database(db *mongo.Database, ctx context.Context, p
|
||||
sink(userCs) // $ hasTaintFlow="userCs"
|
||||
}
|
||||
}
|
||||
|
||||
func test_mongo_driver_mongo_Client(client *mongo.Client, ctx context.Context) {
|
||||
changestream, err := client.Watch(ctx, nil) // $ source
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
for changestream.Next(ctx) {
|
||||
var user User
|
||||
changestream.Decode(&user)
|
||||
sink(user) // $ hasTaintFlow="user"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user