noKeyHint method

String noKeyHint(
  1. String? entryKey,
  2. String baseUrl,
  3. ProviderSpec? spec,
  4. String scopedName,
  5. List<String> names,
)

The fallback hint when no key resolved (or the token was rejected). A degraded secure store (gh-1679 AC3) replaces the bare "no key set" with the store-health wording: an earlier paste may never have reached the durable store, which is exactly the incident's self-contradicting 401.

Implementation

String noKeyHint(
  String? entryKey,
  String baseUrl,
  ProviderSpec? spec,
  String scopedName,
  List<String> names,
) {
  final suggested =
      entryKey ??
      (baseUrl != spec?.defaultBaseUrl ? scopedName : names.first);
  if (!explicitToken) {
    final degraded = degradedStoreHint(suggested);
    if (degraded != null) return degraded;
  }
  return explicitToken
      ? ' — the /provider token was rejected; set a fresh one with '
            '/key set $suggested <value>'
      : ' — no key set; store one with /key set $suggested <value>';
}