-
Notifications
You must be signed in to change notification settings - Fork 27
Description
If I include an attenuating check in my biscuit such as check if time($time), $time < {time}—where the {time} placeholder is replaced by an expiration horizon that winds up at or later than the time fact bound during evaluation, then the (*authorizer).Authorize method fails with a freshly constructed errors.errorString, not using or wrapping any sentinel error value or type that one could detect with the errors.Is or errors.As functions.
Callers can't detect when authorization fails due to an unsatisfied check, whereas they can detect when a policy denies authorization via the ErrPolicyDenied value.
Would you be amenable to introducing a new sentinel error value such as ErrCheckUnsatisfied, ErrUnsatisfiedCheck, or ErrCheckNotSatisfied? Using a value from errors.New would be a little bit awkward, as we'd have to wrap it in a way that the resulting message produced by the String method is still sensible. We could introduce a new type that satisfies the error interface instead.
Another question is whether we'd want to allow callers to distinguish between unsatisfied authority checks and other non-authority checks that are unsatisfied.