Can I read from a private google cloud storage bucket from the client frontend - google-cloud-storage

I have a cordova app running on android with a spring boot backend.
In the app the client can upload a photo.
At the moment the file is uploaded to google cloud storage via the backend, who has a service credentials file.
When we want to display a photo in the app should the photo be read from google cloud platform via the spring boot app?
Or can we read directly from the google cloud bucket, (in this case how do we authenticate)?

I would say it's simplest to read the data from GCS in the Java code, and then serve the data from your application.
An alternative you could consider is to generate a signed URL in your backend; the client can then use that signed URL to fetch the data. The Google Cloud Storage client library should make generating the signed URL fairly straightforward. You'll want to regenerate each time the client loads a page of photos though, as signed URLs (deliberately) have a limited lifespan.

Related

Is there a way to sync PWA web client IndexedDB data to OneDrive?

I am developing a PWA web client app. The data is stored on local IndexedDB.
Is there a way to sync the IndexedDB data to OneDrive with its api? Or I have to develop my own server for syncing data.
I have checked the OneDrive api, and I know it supports files sync. I don't know how draw.io does, seems like it saves the file to OneDrive.
Right now I am considering to change the app to Chrome extension with google sync or make an Electron app to use OneDrive to sync the data.

How to authenticate IOT devices to Google Cloud Services

I have a Raspberry Pi3 device which has Android Things dev preview 0.6.1 installed. On completing certain operations, the device needs to send data to Google Cloud Storage. To do so it must have an API key to authenticate itself.
In Android devices it could be done easily using by integrating Google Sign in Option but since my Android Thing device doesn't have any interface, Google Sign In could not be implemented in it.
I have gone through github project Android Things Weather Station Sample which is using Google Service Account to publish data to PubSub. To do so, it generates and imports a credential.json file into the project and somehow generates credentials from it.
So my question stands is, without user consent, can we use Google Service Accounts to authenticate with Google Cloud Storage? If yes, how can we generate access token from it ? If no, is there any other method to authenticate with GCS?
The simplest and most secure way to authenticate your IoT devices with Google Cloud is using Cloud IoT Core to publish data over MQTT or HTTP into Cloud Pub/Sub. Cloud IoT Core is a bridge designed to securely manage large fleets of devices and authenticate them with your cloud project.
Take a look at the SensorHub sample app on GitHub, which is similar to the weather station, but uses Cloud IoT Core to authenticate and publish instead.
As Shubham stated, using a service account is one way to authenticate devices. Otherwise you'd need to build a mobile companion app which you use to authenticate the user. Then you would have to transfer that token to the IoT device.
In case anyone faces the same issue, I found this document which has explained the way to authenticate devices with Google Cloud without the consent of a user.

Google Analytics Embed API with Server Side Authorization - Firebase Hosting

I completed the basic setup for Google Analytics and inserted the tracking code into my webpage(s). I can log in to analytics.google.com and see historical data just fine.
I have an admin page on my website where I want to display Google Analytics information to several users automatically (no additional logon req'd) and read that this is possible using the Embed API with Server-side Authorization.
I followed the instructions and created a Service Account that shows up under Service account keys in my Google API Manager portal. I also successfully ran 'sudo pip install --upgrade google-api-python-client' on my Cloud9 IDE and pushed the change to my hosting provider, Firebase, i.e. 'firebase deploy'. Lastly, I located and pasted my Analytics View ID in to the code sample provided with the Demo/Setup. My page is served with <!DOCTYPE html> declared.
I can't get it to work. Browser console says:
Uncaught TypeError: window.google.load is not a function
I am thinking that I am not invoking the get_access_token() in that Python module. In other words, I am thinking that server-side scripting is not supported with Firebase hosting.
Anyone know if and how to get Google Analytics Embed API with Server Side Authorization running with Firebase hosting?
This is not exactly a direct answer to your question, but rather an alternative solution to this problem. At least I’m using approach.
You can use Google Design Studio to build and embed amazing analytics and BI dashboards anywhere you like (also on your Admin website). But even easier would be to use Google’s authentication (via gmail) to provide access to select dashboards directly, as Google’s authentication and authorisation is likely more secure that your website’s.

How to connect to Google Storage with Bucket Explorer

I generated Access & Secret Key put it into Bucket Explorer just as I saw on their screenshots but I get an error that Keys are not recognized on AWS, so it keeps trying to connect to AWS. I have latest version for OS X.
Looking at the Bucket Explorer website, it sounds like you need a special version of their software -- however, the download link does not actually seem to have that version available. Have you contact the developers of Bucket Explorer about it?
Alternatively, you can use the Google Cloud Console to upload and access your data in Google Cloud Storage without depending on a particular client application.

tinyMCE upload image to cloud instead of server

I am using tinyMCE 4.x latest version and it has Moxie Manager integrated, but it uploads my image files directly on server. I need to avoid that because my website is hosted at AppFog where is not possible to store information because it's PaaS. Can anyone tell me is it possible to redirect the image upload to cloud service or other storage method capable with AppFog or maybe Heroku, because I found that Moxie Manager wants 700Euro to give me plugin for image upload to Amazon S3, but 700Euro is impossible to pay. I will be very thankful for other plugins that can be integrated to tinyMCE its not necessary to use Moxie Manager ( it looks great but this price... )