Skip to content

docs: enhance auth module documentation and type hints - #173

Open
maslinedwin wants to merge 1 commit into
xai-org:mainfrom
maslinedwin:fix/auth-types
Open

docs: enhance auth module documentation and type hints#173
maslinedwin wants to merge 1 commit into
xai-org:mainfrom
maslinedwin:fix/auth-types

Conversation

@maslinedwin

Copy link
Copy Markdown

Improves auth module with comprehensive documentation, type hints, and examples.

@maslinedwin
maslinedwin requested a review from a team as a code owner July 10, 2026 06:26
Comment thread src/xai_sdk/auth.py
from xai_sdk.auth import BaseClient

# Create a synchronous channel
channel = grpc.insecure_channel("api.xai.com:50051")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Semgrep identified a blocking 🔴 issue in your code:
The domain xai.com is owned by a Chinese company and not xAI. Please use the proper x.ai domain.

Why this might be safe to ignore:

The matched code 'api.xai.com' is in a docstring example comment for the xAI SDK, and 'api.xai.com' appears to be the correct API endpoint for xAI's service (not a mistaken reference to the unrelated xai.com Chinese company domain). The rule is overly broad, matching any occurrence of 'xai.com' including valid subdomains like 'api.xai.com' which is the legitimate xAI API endpoint.

To resolve this comment:

🔧 No guidance has been designated for this issue. Fix according to your organization's approved methods.

💬 Ignore this finding

Reply with Semgrep commands to ignore this finding.

  • /fp <comment> for false positive
  • /ar <comment> for acceptable risk
  • /other <comment> for all other reasons

Alternatively, triage in Semgrep AppSec Platform to ignore the finding created by xai-incorrect-domain.

You can view more details about this finding in the Semgrep AppSec Platform.

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