pub struct LfsAccess {
pub store: Arc<dyn LfsStore>,
pub limits: Limits,
pub allowance: Option<NamespaceAllowance>,
}Expand description
An authorised repository’s LFS object store, and what it will accept.
Returned by LfsTransport::open_lfs, and deliberately not a session: LFS
over HTTP is four independent requests (batch, GET, PUT, verify),
each authorised on its own, so there is nothing for a session to hold
between them. What the two surfaces share is the store and the limits,
which is exactly what this carries.
Fields§
§store: Arc<dyn LfsStore>Where the objects are. Arc because the caller runs the actual I/O on a
blocking thread and has to own it there.
limits: LimitsThe quota and the batch cap in force, from the same
WireConfig::lfs the SSH session is built with. A second home for these
is how 8 GiB comes to be enforced on one transport and not the other.
allowance: Option<NamespaceAllowance>The tenant’s remaining LFS room, decided by the same
crate::PlanGate chain that decided
crate::ServiceRequest::pack_ceiling for a push, and None wherever a
push would get no ceiling: a community build, an uncapped namespace, a
download.
Beside Self::limits rather than inside it because they are different
kinds of number. limits is the operator’s, one set for the whole box,
Copy, and comes off the command line; this is one namespace’s plan,
re-measured per transfer, and carries a sentence built from a signed
entitlement fact. A tenant who fills it is told to buy more; a client
that trips limits is told the box does not take objects that big.