Make user optional when passing enable_iam_auth #310
Labels
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
Feature Description
If I'm using this in an environment like cloud run, there really only is one account - the currently active service account. I think the default assumption is that the user that is going to be doing the proxying is also the one that is being logged in, so it's quite redundant to have to get the current service account, and then chop off the
gserviceaccount.com
as required.A cleaner API would be to simply no longer have user required when enable_iam_auth is passed, and have the connector correctly detect service account emails and appropriately chop them, cleanly abstracting away the internals.
That would take the common use case from
to the extremely elegant
connector.connect(MY_DB_STR, "pg8000", db=MY_DB, enable_iam_auth=True)
Alternatives Considered
We could continue to keep this redundant, but it's forcing the calling code to still be dealing with GCP internals.
Thank you for your consideration :P
The text was updated successfully, but these errors were encountered: