Skip to content

feat(generator): gapic generator centralization mtls#17818

Open
hebaalazzeh wants to merge 6 commits into
feat/api-core-centralize-mtlsfrom
feat/gapic-generator-centralization-mtls
Open

feat(generator): gapic generator centralization mtls#17818
hebaalazzeh wants to merge 6 commits into
feat/api-core-centralize-mtlsfrom
feat/gapic-generator-centralization-mtls

Conversation

@hebaalazzeh

Copy link
Copy Markdown
Contributor

This PR updates the generator templates to rely on the centralized MTLS fallback logic from google-api-core.

Since the MTLS helpers (use_client_cert_effective, get_client_cert_source, read_environment_variables) are being centralized into google/api_core/gapic_v1/config.py in the linked api-core PR, we no longer need the generator to produce fallback implementations for them. The generated _compat.py will now import these directly from config.py.

Depends on the api-core MTLS centralization PR.

related pr: #17817

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors mTLS configuration and client certificate source logic into a new compatibility template _compat.py.j2 to support older versions of google-api-core, updating client.py.j2 and unit tests accordingly. Feedback suggests using the imported mtls module directly in the test template's hasattr check to avoid a potential NameError, and notes that the generated golden files should be regenerated to ensure they are fully in sync with the updated templates.

@hebaalazzeh
hebaalazzeh marked this pull request as ready for review July 21, 2026 22:21
@hebaalazzeh
hebaalazzeh requested a review from a team as a code owner July 21, 2026 22:22
@hebaalazzeh hebaalazzeh self-assigned this Jul 21, 2026
@hebaalazzeh
hebaalazzeh force-pushed the feat/gapic-generator-centralization-mtls branch from 1d81ba9 to 3cc6389 Compare July 21, 2026 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant