pub enum Readiness {
Ready,
AwaitingBootstrap,
SealedAndEmpty {
record: Option<Box<BootstrapRecord>>,
},
}Expand description
What state the identity table is in at start-up, and therefore whether the unauthenticated enrolment door is open.
Until 2026-08-05 there were two states and one of them was refuse to
start: a server whose identity table was empty and which had been given no
--admin-key bailed out of Server::start. That is why there was no first
boot at all — the box could not be reached to be given its first key, and
the only way in was gunnar key add with the server down, which needs a
shell on the machine and there is no shell on the appliance.
The refusal is replaced by Readiness::AwaitingBootstrap: the server
starts, and Bootstrap.Enroll is servable without a credential for
exactly as long as AuthTable::bootstrap_record is None.
Three states, and each predicate below answers false for at least one of
them: a may_serve() that had become true for every state would be an
identity value, and a test sitting on it could not tell a working gate from
a dead one (measured, not asserted).
Variants§
Ready
There is at least one registered key, and bootstrap has happened. Ordinary operation.
AwaitingBootstrap
Nothing has ever been enrolled. The identity table is empty and
there is no BootstrapRecord. Bootstrap.Enroll is open, to anyone
who can reach the control port. This must be said out loud at every
start and reported in status; see gunnar_grpc::service::bootstrap.
SealedAndEmpty
The enrolment window is shut and there is no key to authenticate
with. Nobody can reach this server over either listener until a key is
put back with gunnar key add, offline — and the window stays shut
regardless, which is the attack this design exists to refuse.
Fields
record: Option<Box<BootstrapRecord>>Who bootstrapped it, and when, so the operator can tell an attack from an accident.
None for a table that holds principals but no keys and carries no
bootstrap record: a half-provisioned data path written before the
record existed. That is a real state and must be described as
itself rather than with an invented record.
Implementations§
Source§impl Readiness
impl Readiness
Sourcepub fn bootstrap_window_open(&self) -> bool
pub fn bootstrap_window_open(&self) -> bool
Is the unauthenticated Bootstrap.Enroll window open?
True for exactly one of the three states.
Sourcepub fn has_an_identity(&self) -> bool
pub fn has_an_identity(&self) -> bool
Can anybody actually authenticate against this server right now?
False for both non-Ready states, for two different reasons, which is
why this is not the negation of Readiness::bootstrap_window_open.