Skip to content
Storage Providers

Google Cloud Storage (GCS)

GCS JSON API v1 driver with Service Account RS256 JWT, OAuth2 PKCE, anonymous public buckets, 256 KiB resumable uploads, and rewrite copies.

The gcs backend (backend-gcs) targets Google Cloud Storage JSON API v1 with three authentication modes — Service Account JSON (RS256 JWT), Desktop OAuth 2.0 PKCE, or anonymous public bucket access — plus custom endpoint routing for emulators like fake-gcs-server.

Setup Recipes#

rship auth gcs gcs-prod \
  --bucket my-archive \
  --prefix 2026/ \
  --storage-class NEARLINE \
  --service-account-file ./gcp-sa.json

rship ls gcs-prod:

Flags Reference (rship auth gcs)#

FlagDefaultDescription
<REMOTE>—Logical remote name (e.g. gcs, gcp-archive)
--bucketOptionalDefault bucket; omit to address buckets via remote:bucket/path
--prefixEmptyObject prefix inside the bucket
--project-numberNoneOptional Google Cloud project number
--storage-classBucket defaultSTANDARD, NEARLINE, COLDLINE, or ARCHIVE
--service-account-fileNonePath to GCP Service Account JSON key
--impersonateNoneDomain-Wide Delegation impersonated subject (sub)
--client-id / --client-secretNoneGoogle OAuth 2.0 Desktop credentials for PKCE flow
--scopefullAlias full, read_write, read_only, cloud-platform, or scope URL
--anonymousfalseAccess public buckets without credentials
--endpointGCS defaultCustom root URL (derives /storage/v1 and /upload/storage/v1)

Protocol Internals#

  • Chunk alignment & crash resume: Files <= 8 MiB use single-shot uploadType=multipart; larger objects stream via 256 KiB-aligned resumable upload sessions (16 MiB default chunk = 64 × 256 KiB).
  • Strict RFC 3986 path encoding: Encodes /, +, #, ?, %, spaces, and multi-byte UTF-8 segments accurately for GCS JSON /b/{bucket}/o/{object} routes.
  • Checksums & server-side rewrite: Verifies native MD5 and CRC32C object hashes and uses GCS rewriteTo for instant intra-GCS copies.