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

No previews for private files #169

Closed
kashkashio opened this issue Apr 30, 2023 · 4 comments
Closed

No previews for private files #169

kashkashio opened this issue Apr 30, 2023 · 4 comments
Labels
enhancement New feature or request fixed Bug fixed

Comments

@kashkashio
Copy link

Describe the bug
The plugin in its latest version, take the environment variables Booleans as strings hence breaking the logic for the boolean flags

To Reproduce
Steps to reproduce the behavior:

  1. put a breakpoint in the node_modules provider.js file in the package folder every where basically and you will see that the flags are always true because conditions are checking !boolean on string wich always returns true.

Expected behavior
boolean should remain boolean and not be parsed as string.

Screenshots
I had to duplicate the plugin and run it locally and push this fix which is not the best one but it is workaround that works for me.
Screenshot 2023-04-30 at 15 44 45

Desktop (please complete the following information):

  • OS: MacOS

Additional context
Should be addressed because this can cause a lot confusion and burn time because this all provider thing is complicated enough with many moving parts starting from google cloud, bucket, service account etc. i mean there can be enough failure points and caveats so we should try and make sure we help the devs :)

Also I would suggest to add more flags to the return signed URL method like the cname or virtually control as can be seen here:
https://googleapis.dev/nodejs/storage/latest/Bucket.html#getSignedUrl

And also make sure you mention that the dev needs to give the service account this role:
gcloud projects add-iam-policy-binding PROJECT_ID --member=serviceAccount:ACCOUNT_EMAIL --role=roles/iam.serviceAccountTokenCreator

Because without that the app wont be able to sign those urls.

@Lith
Copy link
Collaborator

Lith commented May 9, 2023

Hi,

Seems this issue relate to PR #165 from @Marc-Roig

I will try to improve documentation and feature, but if someone else has more time to do that ? :)

Thanks,

@Lith Lith added the enhancement New feature or request label May 9, 2023
@Marc-Roig
Copy link
Contributor

Also I would suggest to add more flags to the return signed URL method like the cname or virtually control as can be seen here:

Curious about the use case here, it would be useful to return the cname of the bucket when signing a URL? How would you use this data?

@Lith
Copy link
Collaborator

Lith commented May 10, 2023

I will push a new release code today with a quick fix for your problem, not sure eval are the best solution... but I've no time to find something better 🤣

Please try the latest release : 4.10.2 and tell me if it's working fine !!

Thanks 👍

@Lith Lith closed this as completed in b5fa17e May 10, 2023
@Lith
Copy link
Collaborator

Lith commented May 10, 2023

@Lith Lith added the fixed Bug fixed label May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fixed Bug fixed
Projects
None yet
Development

No branches or pull requests

3 participants