endpoints:allow_cors: true
< HTTP/2 403< server: nginx< date: Wed, 16 May 2018 20:58:12 GMT< content-type: application/json< www-authenticate: Bearer<{"code": 7,"message": "The service does not allow CORS traffic.","details": [{"@type": "type.googleapis.com/google.rpc.DebugInfo","stackEntries": [],"detail": "service_control"}]}
I'm trying to enable CORS on my endpoint by adding the following to my service configuration file:endpoints:- name: bookstore.endpoints.foo-project.cloud.googallow_cors: true
The x-google-endpoints property is not allowed in a gcloud service configuration file. The name of the attribute is allow_cors which is documented inAnything else results in an endpoints services deployment failure, e.g.ERROR: (gcloud.endpoints.services.deploy) INVALID_ARGUMENT: Cannot convert to service config.'ERROR: api-config.yaml:16: Found field 'x-google-endpoints' which is unknown in 'google.api.Service'.'
--
You received this message because you are subscribed to the Google Groups "Google Cloud Endpoints" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-endpoints+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-endpoints/187de3cb-f1e0-4e26-8e47-bc12fd3b892d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Yes, it's using gRPC. I understand that vanilla gRPC does not have CORS support, but that is *not* the problem. The ESP does not allow CORS requests to flow through despite it being configured to allow_cores as per the documentation.
There are workarounds, but the ones discussed on stackoverflow, etc., are a way to get CORS to "work" with vanilla gRPC; it basically returns a canned reply to pre-flight checks with no security checks what so ever. I am not interested in using that kludgy workaround.
I have augmented my gRPC server to handle CORS pre-flight requests and have confirmed that it is properly working. My final, hopefully, impediment is getting the ESP to simply let CORS pre-flight requests through.
On Fri, May 18, 2018 at 11:52 AM, 'Christophe Taton' via Google Cloud Endpoints <google-clou...@googlegroups.com> wrote:
On Friday, May 18, 2018 at 11:35:02 AM UTC-7, Alan Cabrera wrote:The x-google-endpoints property is not allowed in a gcloud service configuration file. The name of the attribute is allow_cors which is documented inAnything else results in an endpoints services deployment failure, e.g.ERROR: (gcloud.endpoints.services.deploy) INVALID_ARGUMENT: Cannot convert to service config.'ERROR: api-config.yaml:16: Found field 'x-google-endpoints' which is unknown in 'google.api.Service'.'My mistake, I had assumed you were using OpenAPI.Is your backend using gRPC with HTTP/JSON transcoding then?Can you describe your use-case a little bit more, maybe?
--
You received this message because you are subscribed to the Google Groups "Google Cloud Endpoints" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-endp...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-endpoints+unsub...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Google Cloud Endpoints" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-endpoints+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-endpoints/b3b1b3e6-f139-4e10-be95-a295df382e22%40googlegroups.com.
i could transcode the gRPC requests I guess. I'd rather not go through the effort.Is there a way to simply let all OPTIONS requests flow through to the backend?
--
You received this message because you are subscribed to the Google Groups "Google Cloud Endpoints" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-endpoints+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-endpoints/d50e341b-a07a-45e0-9d3f-e9d75533c89d%40googlegroups.com.
Yes, this approach might work for HTTP transcoded requests, although I wonder if it's possible to set the headers returned in the response.That being said, I believe that Alan is trying to call the gRPC methods directly from the browser, without transcoding (ie. /endpoints.examples.bookstore.Bookstore/ListShelves).
--
You received this message because you are subscribed to the Google Groups "Google Cloud Endpoints" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-endpoints+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-endpoints/a3312417-401e-447d-968f-4a5a91ea776b%40googlegroups.com.