Loading
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
newPSQLFormatdispatches onsecret_refpresence instead of format.cloudSQLIAMFormatrenamed tonoSecretFormat.projectionFormat.projection()reads format fromPostgreSQL.SecretRef.Format(its new home).- Tests renamed from
cloudsql_iam_*tono_secret_*;Formatmoved intoSecretRefin remaining cases.
Depends on fairway!103.