pub struct GitRequest {
pub method: String,
pub path: String,
pub query: String,
pub headers: Vec<(String, String)>,
pub body: Bytes,
pub host_url: Option<String>,
}Expand description
Opaque HTTP request shape consumed by the service.
The crate stays intentionally binder-agnostic — callers (axum,
actix-web, hyper raw, …) translate their native request type into
this struct before calling handle.
Fields§
§method: Stringe.g. "GET", "POST", "OPTIONS".
path: StringThe URL path ("/alice/repo/info/refs"), already
percent-decoded.
query: StringThe raw query string without the leading ?.
headers: Vec<(String, String)>All request headers as (name, value) tuples. Name is
compared case-insensitively by the service.
body: BytesRequest body (empty for GETs).
host_url: Option<String>Scheme + host ("https://pod.example.com") — used only to
reconstruct the URL that NIP-98 verification checks. If None,
we fall back to http://localhost.
Implementations§
Source§impl GitRequest
impl GitRequest
Sourcepub fn auth_url(&self) -> String
pub fn auth_url(&self) -> String
Reconstruct the canonical URL that a NIP-98 u tag is
expected to point at.
Sourcepub fn is_read(&self) -> bool
pub fn is_read(&self) -> bool
true if this request fetches repository data (clone/fetch/ls).
Smart-HTTP read traffic is the git-upload-pack service plus the
info/refs capability advertisement that precedes it, and the
dumb-HTTP object/pack paths under objects/. These previously
bypassed every auth check while GIT_HTTP_EXPORT_ALL exported
each repo verbatim, so a private pod’s git history was world-
clonable (P1-3). The service now gates reads through the same
auth provider as writes.
Trait Implementations§
Source§impl Clone for GitRequest
impl Clone for GitRequest
Source§fn clone(&self) -> GitRequest
fn clone(&self) -> GitRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more