google-nomulus/core/src
Weimin Yu 5b4b86317b Add a presubmit check to require use of templated SQL string literals (#954)
* Add a presubmit check to require use of templated SQL string literals

This PR proposes a coding style convention that helps prevent
SQL-injection attacks, and is easy to enforce in the presubmit check.

SQL-injections can be effectively prevented if all parameterized queries
are generated using the proper param-binding methods. In our project
which uses Hibernate exclusively, this can be achieved if we all follow
a simple convention: only use constant sql templates assigned to static
final String variables as the first parameter to creat(Native)Query
methods.

This PR adds a presubmit check to enforce the proposed rule, and
modified one class as a demo. If the team agrees with this proposal, we
will change all other use cases.
2021-02-06 19:28:38 -05:00
..
main Add a presubmit check to require use of templated SQL string literals (#954) 2021-02-06 19:28:38 -05:00
nonprod Add a command to generate ER diagram for SQL schema (#839) 2020-10-15 17:31:43 -04:00
test Remove dual-write of registrar from tool commands (#952) 2021-02-05 11:06:14 -05:00