Anybody tried mosso CloudFiles with Google AppEngine? - python

I'm wondering if anybody tried to integrate mosso CloudFiles with an application running on Google AppEngine (mosso does not provide testing sandbox so I cann't check for myself without registering)? Looking at the code it seems that this will not work due to httplib and urllib limitations in AppEngine environment, but maybe somebody has patched cloudfiles?

It appears to implement a simple RESTful API, so there's no reason you couldn't use it from App Engine. Previously, you'd have had to write your own library to do so, using App Engine's urlfetch API, but with the release of SDK 1.1.9, you can now use urllib and httplib instead.

Related

Communication between Microservices in Google App Engine

I have currently 5 different services in Google App Engine all of them are in FastAPI Python standard environment. When a service gets called they call an authorization service and continue if permissions are valid. Im using firewall rule to disable all incoming requests but allow my computer. When using the firewall rule I cannot call the other service because it return Access Forbidden. I then found something about the requests in Python in GAE that you have to use Google's URLfetch to make calls to other services. But when I use the monkeypatch() function from requests_toolbelt.adapters.appengine I recieve an error in App Engine
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/requests_toolbelt/adapters/appengine.py", line 121, in __init__
self.appengine_manager = gaecontrib.AppEngineManager(
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/urllib3/contrib/appengine.py", line 107, in __init__
raise AppEnginePlatformError(
urllib3.contrib.appengine.AppEnginePlatformError: URLFetch is not available in this environment.
The main reason to restrict the API's is that nobody is able to read the docs from the services.
As mentioned in this docThe Python 3 runtime doesn't need an intermediary service to handle outbound requests. If you want to migrate away from using URL Fetch APIs but still need similar functionality, you should migrate those requests to use a standard Python library such as the requests library.
As discussed in this thread seems you are also facing the similar issue
The presence of requests_toolbelt dependency in the project was the
problem: it somehow forced the requests library to use urllib3, which
requires URLFetch to be present, otherwise it raises an
AppEnginePlatformError. As suggested in the app engine docs
monkey-patching Requests with requests_toolbelt forces the former to
use URLFetch, which is no longer supported by GAE in a Python 3
runtime.
You may resolve this by removing requests_toolbelt from
requirements.txt file
You can also have a look at this stackoverflow thread

File upload to a Google Cloud Storage Signed URL in Python

Can someone help me with the code to upload a file to a Google Cloud Storage Signed URL in Python, preferably using the Requests library?
You can have a look at this sample code on Github. It shows a portable way to achieve this using PyCrypto and requests.
Note that, if your app is running on App Engine, you can easily sign the string using the App Engine Identity service and its sign_blob() method, as documented here.
Here is sample code for AppEngine app using sign_blob() as mentioned in LundinCast's answer. I verified that it works.

Will Robohash run as a python app at App Engine?

We have a need for Robohashes that never change and are very secure and reliable. This is perfect for a Google app where it can be monitored, run over SSL and be extremely reliable.
I really don't have much python experience. Would someone please give a mile-high view? Would it be easy to host Robohash as a python app at the App Engine?
requirements.txt
pillow <- not supported
tornado <- looks like it will work
Are there other challenges, like say how files are accessed? Java in the appengine couldn't not read the file system last I checked it had to use resources. Do you think it will be worth-while for me to pursue?
This is the version we need: https://github.com/BitShares/Robohash
I'm afraid that won't work directly as an application deployed to the standard Google App Engine (GAE) runtime.
There is a way to add third party modules to your GAE app, and it would probably work with pillow, but not with Tornado as it would collide with the webapp2 web framework used by GAE.
Having said that, there are good news for you.
You could use Managed VMs that are in the middle of deploying only your application and of having your own virtual instance where you install everything.
With managed VMs you could build your custom runtime with exactly what you need.

Imaplib on Google App Engine Python

Is there any way to support imaplib of python in google app engine.
I want to access gmail inbox using google app engine in python. The other way also exist to do this task. But I want it to do with imap.
I searched a lot. Reason why google app engine not support imaplib is that it not support SSL socket.
Any way I how to resolved it, Is there anyway exist?
Thanks to Tim Hoffman for pointing out the brand-new support for SSL in App Engine. The documentation for it is here: https://developers.google.com/appengine/docs/python/sockets/ssl_support.
EDIT: Unfortunately, sockets are only available for paid apps. (https://developers.google.com/appengine/docs/python/sockets/overview#limitations-and-restrictions)
If it's not too much I'd recommend that you buy $5 of App Engine credit till the feature comes out of beta. Then I'm pretty sure that they'll offer a free usage tier.
Hope this helps.

Using OAuth Python service with Google App Engine

Google App Engine provides an experimental, bleeding-edge OAuth service in its Python SDK, but fails to provide simple example to work with. Has anyone succeeded in working with it? If so, could you provide a snippet? 
Here is a very good tutorial

Categories

Resources