1 parent
b86ca22206
commit
eaa8b59a10
2 files changed
+72
-29
No files matched your search
@@ -1884,6 +1884,40 @@ for line in sys.stdin:
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn confirmed_write_target_binding_rejects_replay_to_another_scope() {
|
||||
let confirmed_sql = Some("DELETE FROM sessions WHERE id = 7".to_string());
|
||||
let matching = verify_confirmed_target(
|
||||
Some(true),
|
||||
confirmed_sql.clone(),
|
||||
Some("connection-1".to_string()),
|
||||
Some("app".to_string()),
|
||||
Some("public".to_string()),
|
||||
"connection-1",
|
||||
"app",
|
||||
Some("public"),
|
||||
);
|
||||
assert_eq!(matching, (Some(true), confirmed_sql.clone()));
|
||||
|
||||
for (connection_id, database, schema) in [
|
||||
("connection-2", "app", Some("public")),
|
||||
("connection-1", "audit", Some("public")),
|
||||
("connection-1", "app", Some("private")),
|
||||
] {
|
||||
let rejected = verify_confirmed_target(
|
||||
Some(true),
|
||||
confirmed_sql.clone(),
|
||||
Some("connection-1".to_string()),
|
||||
Some("app".to_string()),
|
||||
Some("public".to_string()),
|
||||
connection_id,
|
||||
database,
|
||||
schema,
|
||||
);
|
||||
assert_eq!(rejected, (Some(false), None));
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn confirmed_sql_preserved_through_permission_construction() {
|
||||
let perms = AgentSqlPermissions {
|
||||
|
||||
Reference in new issue
Block a user