gcsdropbox

command module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

README

gcsdropbox

gcsdropbox is a tool for generating pre-signed URLs that allow you to upload and download files from a Google Cloud Storage bucket. These URLs can be used on hosts and/or by third parties without needing to give those hosts/users credentials for direct access.

It uses the signBlob api to sign the url using a service account's Google-managed key.

(The caller needs the iam.serviceAccounts.signBlob IAM permission on the service account.)

Usage

Uploading to GCS

To create a url for uploading:

gcsdropbox -serviceAccount myserviceaccount@myproject.iam.gserviceaccount.com -bucket myBucket -name foo/bar.tar

To use the url to upload:

curl -T localfileToUpload https://storage.googleapis.com/myBucket/foo/bar.tar?Expires=...
Downloading from GCS

To create a URL for downloading:

gcsdropbox -serviceAccount myserviceaccount@myproject.iam.gserviceaccount.com -bucket myBucket -name baz.zip -method GET

To use the url to download:

curl -O https://storage.googleapis.com/myBucket/baz.zip?Expires=...

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL