Pretty sure there's no way to do this but would be great to reach out to see if anyone else has any ideas.
What I'm trying to do is this:
I guess it's just not possible to do what I'm trying to and instead need to create my 2nd microservice in app engine or elsewhere where i can verify a domain.
Thanks in advance!
When Pub/Sub delivers a message to a push endpoint, Pub/Sub sends the message in the body of a POST request. The body of the request is a JSON object and the message data is in the message. data field. The message data is base64-encoded.
For Cloud Functions (1st gen): In the Trigger type field, select Cloud Pub/Sub. In the Select a Cloud Pub/Sub topic field, select a topic for the trigger to monitor. Messages published to this topic will trigger calls to your function.
The Pub/Sub server sends each message as an HTTPS request to the subscriber client at a pre-configured endpoint.
Not just domain registrar based verification, you can verify your site using any of the methods listed here. I agree most of these will not work with Cloud Functions, but it is possible to get HTML Tag
based verification working in matter of minutes with Cloud functions.
You will need to add the given meta
attribute in the HTML response just before the body attribute.
Example:
<meta name="google-site-verification" content="VERIFICATION_TAG" />
Also, Google verifies the domain periodically (even after initial success) and hence you will have to continue returning this response as long as you want to have the URL verified.
How long does verification last?
Google periodically checks if your verification is valid in a way appropriate to your verification method (for example, by checking for the presence of an HTML tag on your site). If verification can no longer be confirmed, your permissions on that property will expire after a certain grace period.
This is same as the option explained in the other answer you linked, and IMO simpler. Take currentRetryAttempt
as one parameter of the request and increment this value every time you queue up a retry request recursively back to the same function when you're timing out. You will need to check currentRetryAttempt
against a maxRetriesAllowed
value before queuing up a new retry request.
It does not impose any restrictions on the responses from your Cloud function unlike the previous option.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With