X-Appengine-Inbound-Appid not being set in python3 standard environment

99 views
Skip to first unread message

Santiago Del Valle

unread,
Jun 4, 2019, 2:23:58 PM6/4/19
to Google App Engine
I did a migration of a python 2 app in the standard environment to python 3. One of the things that changed was how we communicated with other services. For instance we communicated to another service like this:
urlfetch.create_rpc(deadline=60)
urlfetch
.make_fetch_call(rpc, url)


And in the other service we checked the header X-Appengine-Inbound-Appid to see it the call came from an authorized app.
In python3 standard environment we do not have urlfetch anymore, so I switched to using requests like this:
requests.get(url, timeout=60)


but the header X-Appengine-Inbound-Appid is not being set anymore so I just get 403s from the other app
I tried changing the request to use the fully versioned service after reading this: https://cloud.google.com/appengine/docs/standard/python3/communicating-between-services
so I have an URL like this: https://[VERSION_ID]-dot-[SERVICE_ID]-dot-[MY_PROJECT_ID].appspot.com
But the X-Appengine-Inbound-Appid is still not being set.

Is there another way to make the call for it to be set or this is just not possible in python 3 standard environments?

Yasser Karout

unread,
Jun 4, 2019, 4:51:44 PM6/4/19
to Google App Engine
Only requests from URLFetch service will include that header. Otherwise you would have to use the methods listed here [1].

Reply all
Reply to author
Forward
0 new messages