Skip to content
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

proposed signedUrl method #43

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

beesperester
Copy link

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
Copy link
Contributor

matthewgoslett commented Jan 5, 2017

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

🌮

@Rkallenkoot
Copy link
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

+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.

None yet

5 participants