-
Notifications
You must be signed in to change notification settings - Fork 59
log in using GOOGLE_*_CREDENTIALS if present for CloudSQL import #1136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
log in using GOOGLE_*_CREDENTIALS if present for CloudSQL import #1136
Conversation
Signed-off-by: Stephen Compall <stephen.compall@digitalasset.com>
1c00f2c to
f84b283
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the CloudSQL import process by leveraging GOOGLE_*_CREDENTIALS for authentication and adds additional logging for better traceability of service account usage.
- Introduces logic to use GOOGLE_APPLICATION_CREDENTIALS or GOOGLE_CREDENTIALS if present
- Adds logging for authentication steps and displays the current gcloud login
- Enhances logging around temporary bucket creation, SQL upload, CloudSQL import, and cleanup
| gcloud auth activate-service-account --key-file="$GOOGLE_APPLICATION_CREDENTIALS" | ||
| elif [ -n "$GOOGLE_CREDENTIALS" ]; then | ||
| echo "Using GOOGLE_CREDENTIALS for authentication" | ||
| echo "$GOOGLE_CREDENTIALS" | gcloud auth activate-service-account --key-file=- |
Copilot
AI
Jun 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using echo to pipe GOOGLE_CREDENTIALS may risk exposing sensitive information to stdout or logs. Consider securely passing the credentials (e.g., through a temporary file with appropriate permissions) to reduce potential security exposure.
| echo "$GOOGLE_CREDENTIALS" | gcloud auth activate-service-account --key-file=- | |
| TEMP_CREDENTIALS_FILE="$(mktemp)" | |
| echo "$GOOGLE_CREDENTIALS" > "$TEMP_CREDENTIALS_FILE" | |
| chmod 600 "$TEMP_CREDENTIALS_FILE" | |
| gcloud auth activate-service-account --key-file="$TEMP_CREDENTIALS_FILE" | |
| rm -f "$TEMP_CREDENTIALS_FILE" |
isegall-da
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤞 thanks
Backport of #1136 Signed-off-by: Stephen Compall <stephen.compall@digitalasset.com>
Signed-off-by: Stephen Compall <stephen.compall@digitalasset.com>
* split off script * support create/delete, invoke script from pulumi * incorporate #1136 gcloud login/logging changes * set -u and better quoting --------- Signed-off-by: Stephen Compall <stephen.compall@digitalasset.com>
Also adds more logging so we can be sure what service account we're dealing with.
From an idea by @isegall-da as to how to avoid getting stuck with the default infra node pool SA and its scopes problems for
-pub-replicate-slotson devnet/generally via pulumi operator.Pull Request Checklist
Cluster Testing
/cluster_teston this PR to request it, and ping someone with access to the DA-internal system to approve it./hdm_teston this PR to request it, and ping someone with access to the DA-internal system to approve it.PR Guidelines
Fixes #n, and mention issues worked on using#nMerge Guidelines