GoogleCloudPlatform / GoogleCloudPlatform/java-docs-samples

Refactoring code sample for connecting to CloudSQL databases using Cloud SQL Connector for Java

Đang mở
#8,794 5 bình luận 0 reaction 1 người được giao Được giao cho @hessjcg Xem trên GitHub
priority: p2 samples type: feature request
Ngôn ngữ chính
Java
Star
1.9k
Fork
2.9k
Merge trung bình
3 ngày 3 giờ
Pull request đã merge (30 ngày)
17

Mô tả

The repo hosts three code samples that demonstrate the use of the Cloud SQL Connector for Java to connect to the managed versions of [MySQL], [Postgres] and [SQL Server][sqlserver] databases (CloudSQL).
These three samples are implemented as three-tier applications with the frontend running in the browser, backend running on CloudRun and using CloudSQL database as a datalayer.

In its current format these code samples are hard to maintain. They also go out of the line compared to other code samples because of their complexity, lack of region tag association and loosely trackable exposure via code samples browser only.
Additionally these code samples show connectivity practices that are discouraged due their poor security.

The following modifications are recommended to **ALL** code samples:

- [ ] Source code should be simplified to cover only connectivity part. If the three tier application format is essential, the code samples should be migrated to designated repo.
- [ ] Source code should utilize region tags; The code snippets can be added to the connection options documentations (see [overview] page for MySql connection as an example)
- [ ] Authentication methods should be revised to embrace a more secure connectivity methods that leverage underlying identity of GCP infrastructure

These recommendations can be implemented in the scope of this issue or designated issues can be created to address each of them separtely.

[mysql]: https://github.com/GoogleCloudPlatform/java-docs-samples/tree/main/cloud-sql/mysql/servlet
[postgres]: https://github.com/GoogleCloudPlatform/java-docs-samples/tree/main/cloud-sql/postgres/servlet
[sqlserver]: https://github.com/GoogleCloudPlatform/java-docs-samples/tree/main/cloud-sql/sqlserver/servlet
[overview]: https://cloud.google.com/sql/docs/mysql/connect-overview

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.