#[non_exhaustive]pub enum Mode {
Open,
Closed,
}Expand description
How a Gate combines its checks’ answers (spec 004).
The mode is part of Gate::config_hash: a closed gate never hashes the
same as an open one, whatever its checks.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Open
The 0.1.0 and 0.2.0 behaviour, and the default. Checks run in
registration order; the first Some wins, whatever its outcome; when
no check returns Some, the gate allows with
gate:allow:no_check_triggered.
Closed
Deny by default, with required checks. Before any check runs, every
required id must name a registered check, or the gate denies with
closed::REQUIRED_UNREGISTERED. Checks then run in registration
order:
- a
Denyends the evaluation and is the decision; later checks do not run; - a required check that returns
Noneis a deny,closed::REQUIRED_UNDECIDED, and ends the evaluation the same way; - an
Allowor aDegradedoes not end the evaluation, so a later check can still deny.
When every check has run without a deny, the decision is the first
Degrade if there was one, else an allow (closed::AFFIRMED) if at
least one check returned Allow, else a deny
(closed::NO_CHECK_DECIDED). Every deny the gate itself produces is
blocking; a check’s own decision is returned unchanged.