Skip to content

fix: uploadfs gcs application default credentials#5504

Open
eri-vi-maddyie wants to merge 3 commits into
apostrophecms:mainfrom
eri-vi-maddyie:bugfix/uploadfs-gcp-creds
Open

fix: uploadfs gcs application default credentials#5504
eri-vi-maddyie wants to merge 3 commits into
apostrophecms:mainfrom
eri-vi-maddyie:bugfix/uploadfs-gcp-creds

Conversation

@eri-vi-maddyie

@eri-vi-maddyie eri-vi-maddyie commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Please indicate which branch this PR should merge into:

Check one

  • main
  • latest
  • stable
  • Check if this PR will be resubmitted against another branch

Summary

Allow all supported Google Cloud application default credentials by removing the hard-coded check.

Let the Google Cloud Storage client handle failure itself.

What are the specific steps to test this change?

Use uploadfs with a GCS bucket as normal, but authentication now supports credentials from:

  • gcloud auth application-default login
  • Mounted on the Google service (Google Compute Engine, Google Cloud Run, etc.)

What kind of change does this PR introduce?

(Check at least one)

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Build-related changes
  • Other

Make sure the PR fulfills these requirements:

  • It includes a) the existing issue ID being resolved, b) a convincing reason for adding this feature, or c) a clear description of the bug it resolves
  • The changelog is updated
  • Related documentation has been updated
  • Related tests have been updated

@boutell boutell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. Are you working on an ApostropheCMS project that is hosted on GCS?

@eri-vi-maddyie

Copy link
Copy Markdown
Contributor Author

Thanks. Yeah I'm using ApostropheCMS and Astro hosted on Google Cloud Run (Astro as main container, Apos as sidecar, so proxying requests to Apos via Astro); GCS for blob storage and Firestore with MongoDB compatibility for the database, and Google auth via passport-bridge.

There was one other possible issue with apostrophecms/apostrophe-astro using the astro redirect which drops all the headers except location, so the auth callback is unable to set cookies. I'm patching it locally currently, but was going to raise an issue to get feedback in case I'm missing something.

@boutell

boutell commented Jul 10, 2026

Copy link
Copy Markdown
Member

Interesting! Would be glad to talk more about that, making sure the Astro journey is smooth is a priority. hit us up on our Discord ( https://chat.apostrophecms.com/ ) or drop me an email ( tom@apostrophecms.com ) if you're not into that option.

Meanwhile, we will get this PR considered soon. Not for today's release but it should make it into the next maintenance release in 4 weeks.

@eri-vi-maddyie

Copy link
Copy Markdown
Contributor Author

Sounds good, I'd be happy to talk. I'll reach out by email at some point.

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.

2 participants