Skip to content

Commit c6ad0e6

Browse files
committed
fix doc issue
1 parent 1d665b3 commit c6ad0e6

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed

docs/conf.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,33 @@
358358
# texinfo_no_detailmenu = False
359359

360360

361+
# -- Options for autodoc --------------------------------------------------
362+
363+
364+
def autodoc_skip_member_handler(app, what, name, obj, skip, options):
365+
"""
366+
Skips the RSASigner and RSAVerifier from the internal _cryptography_rsa module
367+
if they are being documented under that internal module path,
368+
as they are publicly exposed via google.auth.crypt.
369+
"""
370+
if name in ("RSASigner", "RSAVerifier") and hasattr(obj, "__module__"):
371+
if obj.__module__ == "google.auth.crypt._cryptography_rsa":
372+
# Check if it's also available via the public google.auth.crypt path
373+
try:
374+
import google.auth.crypt
375+
376+
public_obj = getattr(google.auth.crypt, name, None)
377+
if public_obj is obj:
378+
return True # Skip this internal one
379+
except ImportError:
380+
pass # Should not happen if the library is installed
381+
return None # Default behavior (don't skip)
382+
383+
384+
def setup(app):
385+
app.connect("autodoc-skip-member", autodoc_skip_member_handler)
386+
387+
361388
# Example configuration for intersphinx: refer to the Python standard library.
362389
intersphinx_mapping = {
363390
"python": ("https://docs.python.org/3.5", None),

google/auth/crypt/rsa.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414

1515
"""RSA cryptography signer and verifier."""
1616

17-
from google.auth.crypt._cryptography_rsa import RSASigner
18-
from google.auth.crypt._cryptography_rsa import RSAVerifier
17+
from google.auth.crypt import _cryptography_rsa
1918

20-
21-
__all__ = ["RSASigner", "RSAVerifier"]
19+
RSASigner = _cryptography_rsa.RSASigner
20+
RSAVerifier = _cryptography_rsa.RSAVerifier

0 commit comments

Comments
 (0)