Skip to content

Component: Smrt.CloudProviders

Canonical source: SmrtApps/src/Smrt.CloudProviders/README.md (mirrored below)


Smrt.CloudProviders

Overview & Responsibilities

Smrt.CloudProviders is the shared cloud provider “spine” for SmrtHub.

Responsibilities: - Own provider profile configuration and non-secret per-service settings. - Own secret storage discipline (Windows Credential Manager targets and access helpers). - Provide capability-based routing (select vendor/service/profile) based on the current configuration and last known connection-test state. - Provide connection testing for supported vendor/service pairs and return structured, privacy-safe results. - Persist non-secret discovery/cache metadata (for example, model, location, and processor listings) to provider state.

Non-Responsibilities

  • Does not render UI (Settings UI lives in Smrt.CloudProviders.UI.WinUI3 and host apps).
  • Does not store secrets in JSON config/state (secrets are stored in Windows Credential Manager).
  • Does not own shell integration (HubWindow command entry points, deep links, tray UI, etc.).

Public Surface / Entry Points

Primary entry points (non-exhaustive): - CloudProvidersStore.LoadConfig() / CloudProvidersStore.SaveConfig(...) - CloudProvidersStore.LoadState() / CloudProvidersStore.SaveState(...) - CloudProviderRouter.TryResolve(...) (capability routing) - CloudProviderConnectionTester.TestAsync(...) (connection tests) - CloudProviderSecrets (read/write/delete secrets via Credential Manager) - CloudProviderSecretTargets.BuildTarget(...) (canonical secret target naming)

Connection test prerequisites (per vendor/service) are defined in CloudProviderConnectionTestRequirements. For example, Azure OpenAI requires non-secret endpoint + deployment settings and an api-key secret.

Dependencies / Integrations

  • Smrt.CloudProviders.Contracts for shared IDs/contracts (VendorId, ServiceIds, CapabilityId, etc.).
  • SmrtHub.Config for canonical config/state paths and atomic JSON persistence.
  • SmrtHub.Security.WindowsCredentialHelper for Windows Credential Manager integration.

Common consumers (not exhaustive): - Smrt.CloudProviders.UI.WinUI3 (provider cards UI) - SettingsHost (Settings host for provider management) - Feature libraries that request capabilities (for example, chat and extraction components).

Configuration, Operational Data, and Paths

Component slug: - cloud-providers (see CloudProvidersComponent.ComponentName)

Roaming config/state (canonical, via SmrtHub.Config.ConfigPathResolver): - %AppData%/SmrtHub/Config/cloud-providers/cloud-providers-config.json - %AppData%/SmrtHub/Config/cloud-providers/cloud-providers-state.json

State contents (high level, non-secret): - LastConnectionTests: last structured connection test results. - DiscoveryCache: metadata-only discovery payloads (for future UI surfaces), keyed by {vendor}/{profileId}/{serviceId}/{kind}.

Discovery kinds (as-built): - models (OpenAI, Anthropic, Google Gemini API, Azure OpenAI deployments, AWS Bedrock foundation models) - locations (Google Cloud DocumentAI, VertexAI, AWS Bedrock regions) - processors (Google Cloud DocumentAI)

Discovery payload shapes (stable and metadata-only): - models: { "models": string[] } - locations: { "locations": string[] } - processors: { "processors": { "locationId": string, "processorId": string, "processorType": string }[] }

Secrets (Windows Credential Manager targets): - Prefix: SmrtHub/cloud-providers - Target shape: SmrtHub/cloud-providers/<vendor>/<profileId>/<secretKey> - Slug normalization: lower-case; spaces/_/.// collapse to -; non [a-z0-9-] characters are dropped.

Observability and Diagnostics

  • This library returns structured results (ConnectionTestResult, routing failure reasons) intended to be logged by host components.
  • Connection-test error handling is privacy-safe (best-effort suppression of full URLs that may contain query-string secrets).

Testing & Validation

  • Unit tests live under SmrtApps/src/Smrt.CloudProviders.Tests/.
  • Opt-in integration tests (real endpoints; secrets from Credential Manager) live under SmrtApps/src/Smrt.CloudProviders.IntegrationTests/.
  • Build:
  • dotnet build SmrtApps/src/Smrt.CloudProviders/Smrt.CloudProviders.csproj -c Debug -r win-x64

Support Bundle

  • Config/state files should be included via Support Bundle collection.
  • Secrets are not included in Support Bundles (secrets live in Windows Credential Manager).
  • vNext plan checklist: README.Files/SmrtHub-vNext-Architecture/Plans/Smrt.CloudProviders.plan.md
  • Cloud Providers UI: SmrtApps/src/Smrt.CloudProviders.UI.WinUI3/README.md
  • Operational data policy: README.Files/System/Policies/SmrtHub-Operational-Data-Policy-v1.0.README.md
  • Privacy/security policy: README.Files/System/Policies/SmrtHub-Privacy-and-Security-Policy.README.md