GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: Add public wrapper for _mtls_helper.check_use_client_cert which enables mTLS if GOOGLE_API_USE_CLIENT_CERTIFICATE is not set, when the MWID/X.509 cert sources detected by agrawalradhika-cell · Pull Request #1859 · googleapis/google-auth-library-python

This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Conversation

@agrawalradhika-cell

@agrawalradhika-cell agrawalradhika-cell commented Nov 4, 2025

Copy link
Copy Markdown
Contributor

Add public wrapper for check_use_client_cert which enables mTLS if GOOGLE_API_USE_CLIENT_CERTIFICATE is not set, when the MWID/X.509 cert sources detected. Also, fix check_use_client_cert to return boolean value.

Change #1848 added the check_use_client_cert method that helps know if client cert should be used for mTLS connection. However, that was in a private class, thus, created a public wrapper of the same function so that it can be used by python Client Libraries. Also, updated check_use_client_cert to return a boolean value instead of existing string value for better readability and future scope.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
agrawalradhika-cell added 2 commits November 4, 2025 14:30
@agrawalradhika-cell
feat: Add public wrapper for use_client_Cert function
fb37ed0
Signed-off-by: Radhika Agrawal <[email protected]>
@agrawalradhika-cell
fix: update lint fixes
39bff9b
Signed-off-by: Radhika Agrawal <[email protected]>
@agrawalradhika-cell agrawalradhika-cell changed the title Add public wrapper for _mtls_helper.check_use_client_cert which enables mTLS if GOOGLE_API_USE_CLIENT_CERTIFICATE is not set, when the MWID/X.509 cert sources detected feat: Add public wrapper for _mtls_helper.check_use_client_cert which enables mTLS if GOOGLE_API_USE_CLIENT_CERTIFICATE is not set, when the MWID/X.509 cert sources detected Nov 4, 2025
@agrawalradhika-cell
agrawalradhika-cell marked this pull request as ready for review November 4, 2025 22:40
@agrawalradhika-cell
agrawalradhika-cell requested review from a team November 4, 2025 22:40
daniel-sanche
daniel-sanche reviewed Nov 4, 2025
View reviewed changes
Comment thread google/auth/transport/_mtls_helper.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google/auth/transport/_mtls_helper.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google/auth/transport/_mtls_helper.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google/auth/transport/grpc.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google/auth/transport/mtls.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread tests/transport/test__mtls_helper.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@nbayati nbayati added the kokoro:run Add this label to force Kokoro to re-run the tests. label Nov 4, 2025
@yoshi-kokoro yoshi-kokoro removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Nov 4, 2025
agrawalradhika-cell added 2 commits November 4, 2025 16:01
@agrawalradhika-cell
fix: Fix docstrings and minor nits
ff1de0a
Signed-off-by: Radhika Agrawal <[email protected]>
@agrawalradhika-cell
fix: check update in _mtls_helper
8fa9fb6
Signed-off-by: Radhika Agrawal <[email protected]>
nbayati
nbayati reviewed Nov 5, 2025
View reviewed changes

@nbayati nbayati left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Overall LGTM, I just have a minor suggestion: Add a test case to verify the behavior when GOOGLE_API_USE_CLIENT_CERTIFICATE is set to a string other than "true" or "false". The current implementation correctly evaluates such cases to False, and adding an explicit test for this would make the test suite more comprehensive.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

agrawalradhika-cell reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
daniel-sanche
daniel-sanche previously approved these changes Nov 5, 2025
View reviewed changes

@daniel-sanche daniel-sanche left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM, but one more small comment

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

agrawalradhika-cell reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread google/auth/transport/_mtls_helper.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@daniel-sanche daniel-sanche added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 5, 2025
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 5, 2025
@agrawalradhika-cell
chore: Add unit test for specific case and improve docstring
cf6df54
Signed-off-by: Radhika Agrawal <[email protected]>
@agrawalradhika-cell
agrawalradhika-cell dismissed daniel-sanche’s stale review via cf6df54 November 5, 2025 00:30
nbayati
nbayati approved these changes Nov 5, 2025
View reviewed changes
yaoliugg
yaoliugg approved these changes Nov 5, 2025
View reviewed changes
@nbayati nbayati added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 5, 2025
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 5, 2025
@andyrzhao andyrzhao added the kokoro:run Add this label to force Kokoro to re-run the tests. label Nov 5, 2025
@andyrzhao
andyrzhao self-requested a review November 5, 2025 06:30
andyrzhao
andyrzhao approved these changes Nov 5, 2025
View reviewed changes

@andyrzhao andyrzhao left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

lgtm, thanks for working on this!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@daniel-sanche
Merge branch 'main' into public-method-for-mtls-update
8557c3e
daniel-sanche
daniel-sanche approved these changes Nov 5, 2025
View reviewed changes
@yoshi-kokoro yoshi-kokoro removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Nov 5, 2025
@agrawalradhika-cell
agrawalradhika-cell merged commit 1535ecc into googleapis:main Nov 5, 2025
This was referenced Nov 5, 2025
chore: librarian release pull request: 20251105T223742Z #1861
Closed
chore: librarian release pull request: 20251105T230735Z #1863
Merged
Linchin added a commit that referenced this pull request Nov 5, 2025
@Linchin
chore: librarian release pull request: 20251105T230735Z (#1863)
89a8838
Librarian Version: v0.5.0
Language Image:
us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator:latest
<details><summary>google-auth: 2.43.0</summary>

##
[2.43.0](v2.42.1...v2.43.0)
(2025-11-05)

### Features

* Add public wrapper for _mtls_helper.check_use_client_cert which
enables mTLS if GOOGLE_API_USE_CLIENT_CERTIFICATE is not set, when the
MWID/X.509 cert sources detected (#1859)
([1535ecc](1535eccb))

* Enable mTLS if GOOGLE_API_USE_CLIENT_CERTIFICATE is not set, if the
MWID/X.509 cert sources detected (#1848)
([395e405](395e405b))

* onboard `google-auth` to librarian (#1838)
([c503eaa](c503eaa5))

</details>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

4 more reviewers
@daniel-sanche daniel-sanche daniel-sanche approved these changes
@andyrzhao andyrzhao andyrzhao approved these changes
@yaoliugg yaoliugg yaoliugg approved these changes
@nbayati nbayati nbayati approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@agrawalradhika-cell @daniel-sanche @andyrzhao @yaoliugg @nbayati @yoshi-kokoro
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.