[Auth] Typed exception for a missing API-key pepper in ZB.MOM.WW.Auth.ApiKeys (mxaccessgw#195 residual) #23
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up from mxaccessgw#195 (8ba5667b).
ZB.MOM.WW.Auth.ApiKeys0.3.0 reports a missing pepper as a plainInvalidOperationException("pepper unavailable"). Consumers can't catch that by type, so mxaccessgw now checksIApiKeyPepperProvideritself before create and rotate, instead of matching the exception message.Do:
ZB.MOM.WW.Auth.ApiKeys(for exampleApiKeyPepperUnavailableException : InvalidOperationException, so existing catches keep working), or aTryGetPepperon the provider.DashboardApiKeyManagementService, and any similar code in the other apps.Fixed on main
243c3fa— newZB.MOM.WW.Auth.ApiKeys.ApiKeyPepperUnavailableException : InvalidOperationException(message unchanged,pepper unavailable) thrown byApiKeyAdminCommands.RequirePepper()on create/rotate; existingcatch (InvalidOperationException)keeps working. Verifier unchanged (stillApiKeyFailure.PepperUnavailable). Auth version 0.4.1 → 0.4.2 in Directory.Build.props — not yet published to the feed; mxaccessgw can drop its pre-check once it pins 0.4.2.Evidence: ApiKeys.Tests 153 passed / 0 failed (new tests: catch-as-base, null/empty/whitespace pepper, ctors).