fix(auth): C3 review — surface seam not-found (no silent success), partial-reconcile-failure guidance, create validation order, concurrent-edit reconciler test
This commit is contained in:
@@ -331,9 +331,21 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach (var update in plan.Updates)
|
||||
try
|
||||
{
|
||||
await ApiKeyAdmin.SetMethodsAsync(update.KeyId, update.NewMethods);
|
||||
foreach (var update in plan.Updates)
|
||||
{
|
||||
var ok = await ApiKeyAdmin.SetMethodsAsync(update.KeyId, update.NewMethods);
|
||||
if (!ok)
|
||||
throw new InvalidOperationException(
|
||||
$"Key '{NameFor(update.KeyId)}' was not found in the key store.");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
$"Method '{methodName}' was saved, but updating approved-key scopes failed partway: {ex.Message} " +
|
||||
"Some keys may be partially updated — review them on the API Keys page and retry.", ex);
|
||||
}
|
||||
|
||||
// Selection is now the baseline (matters if save is retried without reload).
|
||||
@@ -341,6 +353,10 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
// Returns the display name for a keyId if available from the loaded key list, else the id itself.
|
||||
private string NameFor(string keyId) =>
|
||||
_allKeys.FirstOrDefault(k => string.Equals(k.KeyId, keyId, StringComparison.Ordinal))?.Name ?? keyId;
|
||||
|
||||
private void GoBack() => NavigationManager.NavigateTo("/design/external-systems");
|
||||
|
||||
private void ToggleTestRunPanel() => _showTestRun = !_showTestRun;
|
||||
|
||||
Reference in New Issue
Block a user