Skip to content

feat: Use the proxy v2 engine but keep CLI flags unchanged.#2583

Draft
hessjcg wants to merge 1 commit intov1from
v1-to-v2-translation
Draft

feat: Use the proxy v2 engine but keep CLI flags unchanged.#2583
hessjcg wants to merge 1 commit intov1from
v1-to-v2-translation

Conversation

@hessjcg
Copy link
Copy Markdown
Collaborator

@hessjcg hessjcg commented Apr 8, 2026

Cloud SQL Auth Proxy v1 will internally use Proxy V2 by default. This will allow Auth Proxy V2 users to benefit from the improved compatibility with Cloud SQL services (for example, connecting to MySQL with caching_sha2_password) without any updates to their proxy configuration.

Customers may fall back to the legacy Proxy v1 code by adding the -legacy-v1-proxy flag.

The proxy will automatically fall back to legacy Proxy v1 code if flags are used that are unsupported by Proxy v2, for example: -projects, -instances_metadata.

This also adds an end-to-end test suite in proxy-v1/translatev2/translatev2_test.go that verifies:

  • Parity: Every test case runs in both translated_v2 and legacy_v1 modes to ensure identical behavior.
  • Database Support: Verified connectivity for MySQL, PostgreSQL, and SQL Server.
  • Auth Methods: Validated Password Auth, IAM Auth, and CAS/MCP instance types.
  • Connection Types: Tested TCP, Unix sockets, and FUSE (on supported platforms).
  • Edge Cases: Used URL-style DSNs to ensure special characters in IAM usernames are handled correctly across both modes.

These are the V1 flags that are not directly supported by the v2 proxy, and the expected behavior.

-projects

  • v1: Connect to all instances in a project
  • v2: alternative: List instances explicitly or use FUSE
  • v1-to-v2 mode: Fallback to v1 code

-instances_metadata

  • v1: Get instance list from GCE metadata
  • v2: List instances explicitly
  • v1-to-v2 mode: Fallback to v1 code

-check_region

  • v1: Verify region matches metadata
  • v2: Required/Verified by default in conn string
  • v1-to-v2 mode: ?

-fd_rlimit

  • v1: Automatically increase ulimit -n
  • v2: Manage via ulimit or LimitNOFILE in systemd
  • v1-to-v2 mode: ignored

-refresh_config_throttle

  • v1: Rate limit cert refreshes
  • v2: Handled automatically by Go Connector
  • v1-to-v2 mode: ignored

@hessjcg hessjcg force-pushed the v1-to-v2-translation branch from 28a434e to 5720bfb Compare April 8, 2026 18:26
@hessjcg hessjcg changed the title feat: Use proxy v2 code feat: Use the proxy v2 engine but keep CLI flags unchanged. Apr 8, 2026
Cloud SQL Auth Proxy v1 will internally use Proxy V2 by default. This will allow Auth Proxy V2 users to benefit from the improved compatibility with Cloud SQL services (for example, connecting to MySQL with caching_sha2_password) without any updates to their proxy configuration.

Customers may fall back to the legacy Proxy v1 code by adding the -legacy-v1-proxy flag.

The proxy will automatically fall back to legacy Proxy v1 code if flags are used that are unsupported by Proxy v2, for example: -projects, -instances_metadata.

This also adds an end-to-end test suite in proxy-v1/translatev2/translatev2_test.go that verifies:
- Parity: Every test case runs in both translated_v2 and legacy_v1 modes to ensure identical behavior.
- Database Support: Verified connectivity for MySQL, PostgreSQL, and SQL Server.
- Auth Methods: Validated Password Auth, IAM Auth, and CAS/MCP instance types.
- Connection Types: Tested TCP, Unix sockets, and FUSE (on supported platforms).
- Edge Cases: Used URL-style DSNs to ensure special characters in IAM usernames are handled correctly across both modes.
@hessjcg hessjcg force-pushed the v1-to-v2-translation branch from 5720bfb to 75a2672 Compare April 8, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant