refactor(v2/postgres): dispatch on secret_ref presence, not format

Summary

Follow-up to !523 (merged). Aligns with the fairway proto change that drops the CLOUDSQL_IAM enum value and treats absence of secret_ref as an unauthenticated connection.

Why

CLOUDSQL_IAM was a category error on PostgreSQLFormat — the enum names Secret shapes, but CLOUDSQL_IAM had no Secret. Redis already treats secret_ref as optional (absence = no auth); we now do the same for PostgreSQL. Any passwordless topology (Cloud SQL Auth Proxy with --auto-iam-authn, mTLS, RDS IAM via sidecar, in-cluster Postgres without auth) maps to the same shape: no secret_ref.

Changes

  • newPSQLFormat dispatches on secret_ref presence instead of format.
  • cloudSQLIAMFormat renamed to noSecretFormat.
  • projectionFormat.projection() reads format from PostgreSQL.SecretRef.Format (its new home).
  • Tests renamed from cloudsql_iam_* to no_secret_*; Format moved into SecretRef in remaining cases.

Depends on fairway!103.

Merge request reports

Loading
Loading