Skip to content

Conversation

@mrDzurb
Copy link
Member

@mrDzurb mrDzurb commented Mar 12, 2025

Overview

This PR updates the documentation to include a new section for the HttpxOCIAuth class.
The HttpxOCIAuth class enables HTTPX clients to sign requests using OCI signers, making them compatible
with OCI Model Deployment services and LLM models. This integration facilitates the use of OCI authentication
with HTTPX-based clients and extends compatibility to third-party libraries such as the OpenAi client.

Changes

  • Added a new documentation section titled HTTPX Client Integration with OCI Authentication (HttpxOCIAuth)
  • Included code examples for both synchronous and asynchronous HTTPX client usage
  • Enhanced the ads.set_auth() with default client_kwargs = {"service_endpoint": OCI_ODSC_SERVICE_ENDPOINT}

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Mar 12, 2025
@github-actions
Copy link

📌 Cov diff with main:

Coverage-20%

📌 Overall coverage:

Coverage-19.48%

@github-actions
Copy link

📌 Cov diff with main:

Coverage-100%

📌 Overall coverage:

Coverage-58.55%

Parameters
----------
**kwargs : Any
Arbitrary keyword arguments for configuring the httpx.Client. An optional 'auth'
Copy link
Member

Choose a reason for hiding this comment

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

Keyword arguments supported by httpx.Client.

Copy link
Member Author

Choose a reason for hiding this comment

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

done


def get_httpx_client(**kwargs: Any) -> httpx.Client:
"""
Creates and returns a synchronous httpx Client configured with OCI authentication.
Copy link
Member

Choose a reason for hiding this comment

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

Creates and returns a synchronous httpx Client configured with OCI authentication signer based the authentication type setup using ads.set_auth method or env variable OCI_IAM_TYPE. More information - https://accelerated-data-science.readthedocs.io/en/stable/user_guide/cli/authentication.html

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@mrDzurb mrDzurb requested a review from mayoor March 12, 2025 16:43
@github-actions
Copy link

📌 Cov diff with main:

Coverage-75%

📌 Overall coverage:

Coverage-58.54%

mayoor
mayoor previously approved these changes Mar 12, 2025
lu-ohai
lu-ohai previously approved these changes Mar 12, 2025
@qiuosier
Copy link
Member

I think OCI_ODSC_SERVICE_ENDPOINT can only be used by DataScienceClient. Similarly, different client will have different service endpoint (if the users choose to set it). However, seems like this PR is setting the same service endpoint for all clients, which may cause errors. There will be no errors unit tests as it is not actually connected to the endpoint.

@mrDzurb mrDzurb dismissed stale reviews from lu-ohai and mayoor via 999fc95 March 12, 2025 17:56
@mrDzurb mrDzurb requested review from lu-ohai and mayoor March 12, 2025 17:58
@github-actions
Copy link

📌 Cov diff with main:

Coverage-71%

📌 Overall coverage:

Coverage-58.55%

@mrDzurb mrDzurb enabled auto-merge March 12, 2025 18:27
@mrDzurb mrDzurb merged commit 340c61b into main Mar 12, 2025
1 check passed
@github-actions
Copy link

📌 Cov diff with main:

No lines with coverage information in this diff.

📌 Overall coverage:

Coverage-58.58%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants