Is there a way to port the functionality of
from google.appengine.api import app_identity
from google.appengine.api import urlfetch
in the flexible environment?
I have a service running on the flex environment which needs to make a request to the standard environment and would like to use App Engine's native app identity and X-Appengine-Inbound-Appid
header to do so.
It seems that if the origin of the request is from the standard environment, the header is passed on to the flex environment but not the other way around?
Update: It is not possible to use the
X-Appengine-Inbound-Appid
header in this case because, as you observed, it is removed on the ingress side of the standard env service after being specifically set on the egress side of the flexible env service, following the suggested experiment:Original post:
From App identity:
So you could try to get the app ID in the flex env service as mentioned above and manually set the
X-Appengine-Inbound-Appid
response header. It might not be removed on the ingress side of the standard env service (it's not explicitly mentioned to be removed in Request headers).As for the urlfetch porting, from URL Fetch:
So check for the specific method to set the response header for whichever HTTP library you decide to use.