pub enum Delivery {
Session,
Advertisement,
StatelessRpc,
}Expand description
Which part of a git conversation one call to the seam carries.
§Why an SSH crate names an HTTP shape
This module is the seam, not the SSH transport: it is the join every
front end plugs the protocol state machines into, and gunnar-http plugs
into this one rather than growing a second copy of it. That is the whole
reason the crate docs above call GitTransport “the seam” and not “the SSH
bridge”.
The alternative was a second trait in gunnar-http with its own
ServiceRequest, its own authorisation call and its own join to
gunnar-wire — which is exactly the shape that produces two answers to
“may this principal push”. Sharing one seam costs an enum with three
variants and no dependencies; gunnar-http linking gunnar-ssh adds
nothing to any build, because a gunnar server that speaks HTTP also speaks
SSH and gunnar-ssh was already there.
If a build ever wants HTTP without SSH, this module and
crate::server::Dispatch move to their own crate and nothing else
changes. That build does not exist today, and inventing the crate for it
now would be inventing a boundary before there is anything on both sides of
it.
Variants§
Session
One connection carries the advertisement, the negotiation and the pack.
This is SSH, and it is what gunnar-wire’s Session::Connected means.
Advertisement
Smart HTTP GET /<path>/info/refs?service=…: write the advertisement
and stop. Nothing is read from the client.
StatelessRpc
Smart HTTP POST /<path>/<service>: one stateless-rpc round.