Skip to content

batch requests never use mTLS URLs #2440

Open
@jay0lee

Description

@jay0lee

At:
https://github.com/googleapis/google-api-python-client/blob/main/googleapiclient/discovery.py#L1495-L1497

we build batch_uri based off the hard-coded rootUrl discovery doc parameter. We do this even if mTLS endpoint was previously configured on build() thus using batch methods never actually uses the mTLS endpoint.

  • we should probably add an attribute like is_mtls to the Resource object so we have a simple boolean to determine mTLS status.
  • _add_basic_methods could then use the is_mtls boolean to determine whether to use rootUrl or mtlsRootUrl from the discovery data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions