Enum AuthFailureExposurePolicy
Controls how the resource-authorization pipeline surfaces authorization-related failures to clients. The choice is per-resource (configured via ResourceAuthorizationOptions) because different resources warrant different existence-disclosure trade-offs even within a single application.
public enum AuthFailureExposurePolicy
Fields
HideAsNotFound = 1Normalize
Error.NotFound,Error.Gone,Error.Forbidden, andError.AuthenticationRequiredto the same publicError.NotFound, so missing, removed, and withheld resources share the framework-generated error representation.Propagate = 0Preserve resource-stage error metadata. Via intermediate/owner load failures still collapse to Forbidden. This is the default policy.
Remarks
Propagate is the default: Forbidden and
AuthenticationRequired errors flow through verbatim, and the boundary layer maps
them to HTTP 403 / 401 with the original problem-details payload. This is the right choice
for public resources where existence is not itself sensitive.
HideAsNotFound normalizes Error.NotFound, Error.Gone, Error.Forbidden, and
Error.AuthenticationRequired to the same public Error.NotFound. The boundary
maps it to HTTP 404 with the configured public resource and metadata, without the original
code, detail, resource, or cause. Choose
this for resources whose mere existence reveals information (incident reports, account
records, security findings, internal correspondence, …).
Other direct-resource or via-leaf errors, including Error.Unexpected and
Error.Unavailable, pass through unchanged. Via intermediate/owner load failures
retain their collapse-to-denial behavior. Hiding Error.Unexpected as 404 would
destroy operational signal and lead clients/caches to treat transient failures as
permanent absence.