Skip to content

feat: Support cert config openaicompatible models#143

Open
paul-cayet wants to merge 3 commits intomainfrom
support-cert-config-openaicompatible-models
Open

feat: Support cert config openaicompatible models#143
paul-cayet wants to merge 3 commits intomainfrom
support-cert-config-openaicompatible-models

Conversation

@paul-cayet
Copy link
Member

This PR adds support for SSL certificate configuration for OpenAI-compatible LLMs.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Mar 19, 2026
@dhilloulinoracle
Copy link
Contributor

Internal regression failed: Build ID #380

@dhilloulinoracle
Copy link
Contributor

Internal regression succeeded 🍏: Build ID #381


``OpenAiCompatibleConfig`` now supports optional ``key_file``, ``cert_file``, and ``ca_file``
fields for HTTPS and mTLS connections to private endpoints. These fields are treated as
sensitive values and are exported as references rather than inlined secrets.
Copy link
Member

Choose a reason for hiding this comment

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

no need for the "rather than inlined secrets"

assert llm_config.ca_file == "/etc/certs/ca.pem"


def test_openaicompatibleconfig_cannot_be_imported_without_the_required_api_key() -> None:
Copy link
Member

Choose a reason for hiding this comment

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

please change the name of this test, e.g. *_without_required_sensitive_fields

assert new_llm_config == llm_config


def test_openaicompatibleconfig_can_be_imported_with_api_key_in_component_registry() -> None:
Copy link
Member

Choose a reason for hiding this comment

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

please change the name of this test, e.g. *can_be_imported_with_sensitive_fields_in_components_registry

Copy link
Member

Choose a reason for hiding this comment

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

Can you add a test that imports a yaml without any cert fields, to check if everything still works as before?

Copy link
Member

Choose a reason for hiding this comment

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

I think that as of now this should not be allowed (if version is 26.2.0)

@dhilloulinoracle
Copy link
Contributor

do we have a how-to for LLMs where we can mention it?

certificate_path is not None
for certificate_path in (self.key_file, self.cert_file, self.ca_file)
)
if agentspec_version < AgentSpecVersionEnum.v26_2_0 or not has_certificate_configuration:
Copy link
Member

@cesarebernardis cesarebernardis Mar 20, 2026

Choose a reason for hiding this comment

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

Mhm why are we removing them also if the version is >=26.2.0, but they are None? I think this is against the current expectations, as the configuration is expected to be always complete at the moment.

Copy link
Member

Choose a reason for hiding this comment

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

I think that as of now this should not be allowed (if version is 26.2.0)

assert llm_config.api_key == "THIS_SECRET_IS_SAFELY_INLINED"


def test_configuration_new_certificate_sensitive_fields_and_old_version_26_1_0_cannot_be_loaded():
Copy link
Member

Choose a reason for hiding this comment

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

Nit: I am not sure I would put this test here, it seems more related to the behavior of openai compatible model, rather then sensitive fields. And you have already a very similar test in the other file, so I would probably just drop this one.

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