Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[google-auth] Feat: ECP and hardware-backed cert support for X.509 workloads

オープン
#17,967 コメント 1 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@attharva-24 がすでに取り組んでいます。

2026年8月24日 から。

  • #18222 @attharva-24 による — オープン

評価

この issue はまだ評価されていません。

説明

auth priority: p3 type: feature request
Determine this is the right repository
  • I determined this is the correct repository in which to report this feature request.
Summary of the feature request

I would like to use my hardware-backed (TPM, Secure Enclave, HSM, etc) certificates with a X.509 Workload Identity Provider.

Today google-auth X.509 provider assumes it will be given the private key of the certificate and hard fails if it doesn't:

packages/google-auth/google/auth/external_account.py line 480:

        # Inject client certificate into request.
        if self._mtls_required():
            request = functools.partial(
                request, cert=self._get_mtls_cert_and_key_paths()
            )

this limits the implementation to only private keys stored directly on the filesystem.

Allowing hardware-backed certificates provides iron-clad security for service account authentication. The library will be able to authenticate as a WIF Identity / Service account using a private key that was generated on the TPM / Secure Enclave and cannot be exported.

Desired code experience
from google.auth import default
from google.auth.transport.requests import AuthorizedSession

# certificate_config.json has ECP libs + macos_keychain (hardware-backed key)
# but NO "workload" section (no private key file on disk)

creds, _ = default(scopes=["https://www.googleapis.com/auth/cloud-platform"])
session = AuthorizedSession(creds)
session.configure_mtls_channel()  # ECP handles mTLS via hardware signing
response = session.get("https://cloudresourcemanager.googleapis.com/v1/projects/my-project")
Expected results

_get_cert_bytes() should fall back to the ECP signer library (GetCertPemForPython) to retrieve the certificate from the OS keystore when no workload file path exists. _perform_refresh_token() should skip injecting cert=(cert_path, key_path) when paths are (None, None), letting the session's ECP adapter (via configure_mtls_channel()) handle mTLS. Currently it crashes with TypeError (None path) or SSLError: [SSL] PEM libs (placeholder path).

API client name and version

google-auth 2.56.2

Use case

This feature would be useful in allowing non-GCP service account / WIF authenticating while never needing to expose a private key for export and theft.

Additional context

I'm glad to discuss further internally next week. go/teams/jayhlee.

主要言語
Python
スター
5.4k
フォーク
1.8k
平均マージ
2日 11時間
マージ済み PR(30日)
129

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

googleapis/google-cloud-python のほかの issue

googleapis/google-cloud-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。