Skip to content

proposed signedUrl method#43

Open
beesperester wants to merge 2 commits into
Superbalist:masterfrom
beesperester:master
Open

proposed signedUrl method#43
beesperester wants to merge 2 commits into
Superbalist:masterfrom
beesperester:master

Conversation

@beesperester

Copy link
Copy Markdown

I think it would be great to add a public signedUrl method which you can use to present an expiring link to a 3rd party. To implement this feature GoogleStorageAdapter needs to have access to the service-account .json-file to retrieve needed information about client_email and private_key to sign the request. I therefor added a new __construct parameter $key_file_path and a new protected var $auth in which the json decoded data will be stored.

@matthewgoslett

matthewgoslett commented Jan 5, 2017

Copy link
Copy Markdown
Contributor

Thanks for your contribution.

My only concern with this is that it only works for auth via a key file, where as there are many ways for auth to be configured and auto-discovered in the Google Client.

 * 1. The client will first look at the GOOGLE_APPLICATION_CREDENTIALS env var.
 *    You can use ```putenv('GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json');``` to set the location of your credentials file.
 *
 * 2. The client will look for the credentials file at the following paths:
 * - windows: %APPDATA%/gcloud/application_default_credentials.json
 * - others: $HOME/.config/gcloud/application_default_credentials.json
 *
 * If running in Google App Engine, the built-in service account associated with the application will be used.
 * If running in Google Compute Engine, the built-in service account associated with the virtual machine instance will be used.

@artworkad

Copy link
Copy Markdown

🌮

@Rkallenkoot

Copy link
Copy Markdown
Contributor

Google has implemented the signedURL functionality in their google/cloud repository for PHP. The only thing that's necessary is to allow ^0.33.0 of google/cloud to be used with this package.

I've opened a PR for this already #62

@chrisgillis

Copy link
Copy Markdown

+1 for signed url

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.

5 participants