customEndpointAuthHint method

String? customEndpointAuthHint(
  1. String baseUrl
)

The auth hint for a CUSTOM endpoint (no catalog spec's default URL) — roles mode included, which otherwise shows its generic env-only hint for genuine chain failures. Null for catalog-default endpoints.

Names the failing provider (the saved entry serving the endpoint, or the endpoint itself), the expected source (the entry's key slot or the endpoint-scoped store slot), and the one-line fix — never the bare roles-mode hint (gh-1000 AC2/AC5).

Implementation

String? customEndpointAuthHint(String baseUrl) {
  if (_isCatalogDefaultEndpoint(baseUrl)) return null;
  final entry = _entryForEndpoint(baseUrl);
  final keyName =
      entry?.keyName ?? CustomProviderRegistry.keyNameFor(baseUrl);
  final storedHint = storedKeyHint(keyName, baseUrl);
  if (storedHint != null) return storedHint;
  // gh-1679 AC3: a degraded store gets the store-health wording here
  // too (roles mode's custom-endpoint path), naming the slot it would
  // write.
  final degraded = degradedStoreHint(keyName);
  if (degraded != null) return degraded;
  final target = entry != null ? 'provider "${entry.name}"' : baseUrl;
  final login = entry != null ? ' (or /provider ${entry.name})' : '';
  return ' — no key resolved for $target; set it with '
      '/key set $keyName <value>$login';
}