Skip to content

fix(boost): add caData, skipTLSVerify to OgxEntityProviderConfig #4477

Description

@gabemontero

Summary

Add per-provider TLS connection settings to the Boost OGX catalog entity provider so OgxModelEntityProvider can fetch /v1/models from OGX endpoints that use a private CA or, for development only, a certificate that must not be verified.

Add these optional fields to OgxEntityProviderConfig:

/** PEM-encoded CA certificate or certificate bundle used to verify OGX. */
caData?: string;

/** Disable TLS certificate verification. Development use only. */
skipTLSVerify?: boolean;

The existing behavior must remain unchanged when neither field is configured.

Scope

1. Extend and read the OGX entity-provider configuration

Update:

  • workspaces/boost/plugins/ogx-entity-provider/src/types.ts
  • workspaces/boost/plugins/ogx-entity-provider/src/module.ts

Read caData and skipTLSVerify from both supported config locations:

  • boost.entityProviders.ogx (standalone catalog module)
  • boost.providers.ogx (composed Boost provider configuration)

Use Backstage Config accessors (getOptionalString and getOptionalBoolean) and pass the values through OgxEntityProviderConfig.

2. Apply TLS settings to the model discovery request

Update:

  • workspaces/boost/plugins/ogx-entity-provider/src/providers/OgxModelEntityProvider.ts

Configure the HTTPS connection used by fetchModels() before requesting ${baseUrl}/v1/models:

  • caData is PEM text and must be supplied as the request's custom CA bundle.
  • skipTLSVerify: true must set rejectUnauthorized: false and log a warning through the provider's child logger. Do not log caData or other secrets.
  • When skipTLSVerify is false or unset, certificate verification remains enabled.
  • If both fields are set, skipTLSVerify: true takes precedence; the request is made with certificate verification disabled.
  • Preserve the existing Accept and optional bearer-token headers, response parsing, errors, and entity emission behavior.
  • Plain HTTP endpoints and configurations without either TLS option continue to use the existing fetch behavior.

Use request configuration that is actually supported by Node's Fetch/Undici implementation. A Node https.Agent passed as a non-standard fetch agent property is not sufficient for the built-in Node fetch. If Undici types/runtime are imported directly, declare undici as a direct dependency of ogx-entity-provider.

Do not create a second model-fetching implementation with node:http.request / node:https.request; keep one fetch-based request path.

OgxAgentEntityProvider is out of scope: it reads static agent entries from configuration and makes no outbound request.

3. Tests

Add or update focused tests in:

  • workspaces/boost/plugins/ogx-entity-provider/src/module.test.ts (create this file if configuration parsing is not currently covered elsewhere)
  • workspaces/boost/plugins/ogx-entity-provider/src/providers/OgxModelEntityProvider.test.ts

Cover at least:

  • both fields are read from boost.entityProviders.ogx;
  • both fields are read from fallback boost.providers.ogx;
  • no TLS configuration preserves the existing fetch call;
  • caData configures an HTTPS request with the custom CA and verification enabled;
  • skipTLSVerify: true configures the request with rejectUnauthorized: false and logs a warning on the child logger;
  • both fields together follow the precedence described above;
  • the API key Authorization header is preserved when TLS settings are used;
  • non-2xx responses retain the existing error behavior.

Tests must inspect the connection/dispatcher options passed to the request; do not make real network calls.

4. Examples and package metadata

  • Add commented examples for caData and skipTLSVerify under the OGX entity-provider configuration in workspaces/boost/app-config.yaml.
  • If a new direct runtime import is introduced, update workspaces/boost/plugins/ogx-entity-provider/package.json and the workspace lockfile.
  • Add a changeset for the affected published package because this adds user-visible configuration behavior.

Acceptance criteria

  • OgxEntityProviderConfig contains optional caData and skipTLSVerify fields.
  • Both supported OGX config paths populate both fields.
  • fetchModels() successfully supports a PEM custom CA.
  • skipTLSVerify: true disables certificate verification and emits a warning without exposing secrets.
  • Default behavior, bearer authentication, response parsing, and catalog entity output are unchanged.
  • No TLS/network changes are made to OgxAgentEntityProvider.
  • Unit tests cover configuration parsing and request connection options without real network access.
  • Formatting, type checks, package tests, and API reports pass.

Verification

From workspaces/boost:

YARN_ENABLE_SCRIPTS=false yarn install --immutable
yarn prettier:fix
CI=true yarn workspace @red-hat-developer-hub/backstage-plugin-ogx-entity-provider test --watchAll=false
yarn tsc:full
yarn build:api-reports:only

Commit any lockfile, changeset, formatting, and report.api.md changes produced by the implementation. The Fullsend agent should commit the completed change so its post-processing step can push the branch and open the pull request.

Out of scope

  • Changing the OGX backend provider's chat/session HTTP client
  • Changing other connectors' TLS configuration
  • Refactoring the shared boost-connector-utils CA-bundle API
  • Adding outbound network behavior to OgxAgentEntityProvider

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions