See internal issue 173104871 for more details.
Some APIs require routing headers (location info inx-goog-request-params) for successful requests. https://google.aip.dev/client-libraries/4222
|
# Certain fields should be provided within the metadata header; |
|
# add these here. |
|
metadata = tuple(metadata) + ( |
|
gapic_v1.routing_header.to_grpc_metadata(( |
|
{%- for field_header in method.field_headers %} |
|
{%- if not method.client_streaming %} |
|
('{{ field_header }}', request.{{ field_header }}), |
|
{%- endif %} |
|
{%- endfor %} |
|
)), |
|
) |
|
{%- endif %} |
|
|
|
# Send the request. |
|
{% if not method.void %}response = {% endif %}rpc( |
|
{%- if not method.client_streaming %} |
|
request, |
|
{%- else %} |
|
requests, |
|
{%- endif %} |
|
retry=retry, |
|
timeout=timeout, |
|
metadata=metadata, |
|
) |
These headers are added to normal requests to the API but are missing in calls to the Operations API. This results in requests failing with permission denied errors.
|
{%- if method.lro %} |
|
|
|
# Wrap the response in an operation future. |
|
response = {{ method.client_output.ident.module_alias or method.client_output.ident.module }}.from_gapic( |
|
response, |
|
self._transport.operations_client, |
|
{{ method.lro.response_type.ident }}, |
|
metadata_type={{ method.lro.metadata_type.ident }}, |
|
) |
A fix will require:
- new version of
google-api-core with an operations client that accepts and uses gRPC metadata
- An update to the generator templates.
See internal issue 173104871 for more details.
Some APIs require routing headers (location info in
x-goog-request-params) for successful requests. https://google.aip.dev/client-libraries/4222gapic-generator-python/gapic/templates/%namespace/%name_%version/%sub/services/%service/client.py.j2
Lines 412 to 435 in e5b7648
These headers are added to normal requests to the API but are missing in calls to the Operations API. This results in requests failing with permission denied errors.
gapic-generator-python/gapic/templates/%namespace/%name_%version/%sub/services/%service/client.py.j2
Lines 436 to 444 in e5b7648
A fix will require:
google-api-corewith an operations client that accepts and uses gRPC metadata