github-advanced-security[bot] commented on code in PR #18366:
URL: https://github.com/apache/druid/pull/18366#discussion_r2257889629
##########
sql/src/test/java/org/apache/druid/sql/avatica/DruidAvaticaHandlerTest.java:
##########
@@ -355,6 +359,20 @@
}
}
+ @Test
+ public void testForbiddenContextKey() throws SQLException
+ {
+ final Properties propertiesSetForbiddenKey = new Properties();
+ propertiesSetForbiddenKey.setProperty("user", "regularUserLA");
+ propertiesSetForbiddenKey.setProperty("forbidden-key", "val");
+ Connection conn = DriverManager.getConnection(server.url,
propertiesSetForbiddenKey);
+ Statement stmt = conn.createStatement();
+ AvaticaSqlException e = Assert.assertThrows(AvaticaSqlException.class, ()
-> {
+ stmt.executeQuery("SELECT COUNT(*) AS cnt FROM druid.foo");
Review Comment:
## Potential database resource leak
This ResultSet is not always closed on method exit.
[Show more
details](https://github.com/apache/druid/security/code-scanning/9944)
##########
sql/src/test/java/org/apache/druid/sql/avatica/DruidAvaticaHandlerTest.java:
##########
@@ -355,6 +359,20 @@
}
}
+ @Test
+ public void testForbiddenContextKey() throws SQLException
+ {
+ final Properties propertiesSetForbiddenKey = new Properties();
+ propertiesSetForbiddenKey.setProperty("user", "regularUserLA");
+ propertiesSetForbiddenKey.setProperty("forbidden-key", "val");
+ Connection conn = DriverManager.getConnection(server.url,
propertiesSetForbiddenKey);
+ Statement stmt = conn.createStatement();
Review Comment:
## Potential database resource leak
This Statement is not always closed on method exit.
[Show more
details](https://github.com/apache/druid/security/code-scanning/9943)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]