Repository navigation
feat(cloudsqlpg): add native read-only session locking - #3619
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces read-only support for Cloud SQL Postgres by adding a CLOUDSQL_PG_READONLY configuration, a new execute_sql_readonly tool, and enforcing the cloudsql_session_read_only=locked option in the connection string. An integration test is also added to verify that write operations are rejected in read-only mode. The feedback suggests improving the integration test's robustness by making the error message assertion case-insensitive.
a975dc7 to
efeaaa2
Compare
cff807b to
0c67add
Compare
efeaaa2 to
c638838
Compare
0c67add to
d641571
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a read-only mode for the Cloud SQL Postgres source, adding configuration options, a read-only execution tool, and DSN-level enforcement using cloudsql_session_read_only=locked. It also includes an integration test to verify that write operations are rejected under this mode. The reviewer feedback suggests improving the integration test by constructing the configuration map directly in Go rather than parsing a raw YAML template string, which also allows removing the unused gopkg.in/yaml.v3 import.
adfe355 to
7a43fcc
Compare
c35957e to
a6f8ff1
Compare
7a43fcc to
71bdd26
Compare
a6f8ff1 to
4091cdd
Compare
0df5dbc to
4248f3a
Compare
8a7ace5 to
6242771
Compare
4248f3a to
9ae7050
Compare
6242771 to
cc44835
Compare
9ae7050 to
2a9fa48
Compare
cc44835 to
bf538b0
Compare
2a9fa48 to
d7e5a19
Compare
bf538b0 to
b058146
Compare
d7e5a19 to
e3244d8
Compare
b058146 to
3bcf247
Compare
e3244d8 to
aaa45f2
Compare
3bcf247 to
f9cc575
Compare
aaa45f2 to
8dd2503
Compare
f9cc575 to
50037a4
Compare
8dd2503 to
c960c33
Compare
50037a4 to
bddc2c0
Compare
c960c33 to
7e458f1
Compare
bddc2c0 to
fd7a8e9
Compare
|
nit: please update the admin source docs |
Updated docs. Thanks for bringing that up! |
|
🧨 Preview deployments removed. Cloudflare Pages environments for |
Description
This PR implements native, protocol-level Read-Only session enforcement for Cloud SQL for PostgreSQL.
Changes
options='-c cloudsql_session_read_only=locked'to the connection DSN whenreadOnly: trueis configured on the source.ReadOnly booltocloudsqlpg.Configand implementedIsReadOnly() booloncloudsqlpg.Source.cloud-sql-postgres.yamlandcloud-sql-postgres-admin.yaml) to dynamically resolve read-only mode via theCLOUDSQL_PG_READONLYenvironment variable (readonly: ${CLOUDSQL_PG_READONLY:false}).COMMIT; DROP TABLE;), and side-effecting stored procedures.cloud_sql_pg_test.go, integration vulnerability tests and updated integration READMEs.