pub struct WhenActive { /* private fields */ }Expand description
A route that is not there yet.
§Why 404 and not 403
A 403 is an admission. It says “there is something at this address, and
you are not it” — which tells anyone who tries the URL that the feature
exists, roughly what it is called, and that it is worth coming back for.
Half-built features get found this way: somebody diffs the routes between
two deploys, walks the ones that answer 403, and reads the names.
A route behind a flag that is off has not shipped. The honest answer, and
the same one the router gives for a path nobody ever wrote, is 404 — and
it is byte-for-byte the router’s own 404 here, because a body that differed
would give the whole thing away again.
This is concealment, not authorization. It keeps a URL from being
interesting; it does not keep anybody out. If the feature behind the flag
must not be reachable by the people outside the rollout — because it costs
money, or exposes somebody else’s data — put rustlavel_rbac::Can in front
of it as well. A flag is a release tool.
§What it does to the request
On the way through, the ScopedFlags it resolved is attached to the
request, so a handler that asks the same or another flag reuses the memo
instead of running the resolvers again.
Implementations§
Trait Implementations§
Source§impl Clone for WhenActive
impl Clone for WhenActive
Source§fn clone(&self) -> WhenActive
fn clone(&self) -> WhenActive
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more