Expand description
XetService — HuggingFace-XET CAS HTTP face (epic #654, task #5, FOUNDATION).
Exposes the exact HuggingFace-XET CAS wire routes (as spoken by xet-core’s
cas_client/src/remote_client.rs) so a standard xet-enabled git repo can use
hyprstream as an alternative XET backend to HuggingFace by pointing its
CAS endpoint at us:
| Route | Status | Notes |
|---|---|---|
GET /get_xorb/{hash}/ | IMPLEMENTED | raw xorb bytes from CasStore, Range-aware |
GET /v1/reconstructions/{hash} | 501 | needs verified HF term/fetch_info mapping |
GET /v1/chunks/{key} | 501 | global dedup index is follow-up |
POST /v1/xorbs/{key} | 501 | xorb→putBlob(grantRepo) mapping unresolved |
POST /v1/shards | 501 | shard ingest is follow-up |
§Architecture
An HTTP data plane (this file’s axum Router) implemented as a thin
translator over the authenticated core — it dials the registry
service (reusing the authenticated putBlob/getBlob RPCs) and holds no
standing CAS write authority of its own. Reads for /get_xorb go through
the Subject-threaded CAS mount, not a bare store read.
§Auth
Every data route uses the same shared resource authentication and rate-limit
middleware as OAI: DPoP sender binding/replay protection, federated issuer
resolution, rotation and composite keys, JTI revocation, strict audience
validation, and per-subject quotas. The mapped identity (sub) is attached
as AuthenticatedUser for downstream authorization.
§Known provenance gap (foundation-level)
The HF /get_xorb/{hash}/ route carries a xorb hash and no grantRepo,
so it cannot be mapped onto the registry’s getBlob (which is file-merkle +
grantRepo and enforces per-repo entitlement — “the hash is not a
capability”). #813 moved this route behind the Subject-threaded CAS mount so
the policy boundary is the same Mount surface used by namespaces, and
#1270 made that boundary a MAC-enforcing PEP: the mount runs
MacCasAuthorizer, which derives the trusted
content-bound label from the dedup domain and checks the subject clearance
via the CAS PEP. Until an authority-backed CAS clearance adapter is
configured, this explicitly installed PEP is fail-closed (deny all reads).
Structs§
- XetService
- XetService — HF-XET CAS HTTP face.
- XetState
- Shared state for the axum HTTP handlers.
Constants§
- SERVICE_
NAME - Service name for registry and logging.
Functions§
- create_
xet_ router - Build the HF-XET CAS wire router. Route paths are the exact compatibility
contract with xet-core’s
cas_client— do not rename them.