Skip to main content

Crate semiont_http_transport

Crate semiont_http_transport 

Source
Expand description

Semiont’s HTTP transport: a knowledge base’s bus over its gateway’s HTTP surface, as semiont::transport::Transport (transport, with its stream in actor and the stream’s framing in sse); its bytes, as ContentTransport (content); the gateway’s own operations, as GatewayOperations; and the SDK’s client over the three (client).

And the sign-in that reaches it. For a service: its account’s token at the issuer (service_account), proved by its secret or by an assertion signed with its key (client_assertion), and its bearer at the gateway as the agent it is (agent). For a person, behind the sign-in feature: the issuer’s grants (oauth), sessions over a gateway and a registry’s sign-in (session), the address an application with no web page is sent back to (loopback), and a launcher’s discovery document over HTTP (discovery). A service links none of those.

Modules§

agent
An agent’s token at a knowledge base’s gateway. An agent is an account, as a person is: it signs in at its issuer (service_account), and the token its issuer grants is its bearer at the gateway. The gateway names it by that account: its DID, which the gateway answers at GET /api/users/me, is who its work is attributed to. The engine it runs is no part of it: each write names that itself.
client
A client of a knowledge base over its gateway: the SDK’s SemiontClient with this crate’s transport under all three of its contracts, so auth and system are there.
client_assertion
A service account’s assertion of itself, signed with its own key: OpenID Connect’s private_key_jwt, the client assertion of RFC 7523 §2.2.
content
Bytes over the gateway’s HTTP transport, as semiont::transport::ContentTransport: an upload (POST /resources), a resource’s bytes whole or as a stream (GET /resources/{id}), its description as linked data (GET /resources/{id}/jsonld), its annotations (GET /resources/{id}/annotations), and its anchored text (GET /resources/{id}/anchored-text). Bytes never ride the bus.
service_account
Signing in as a service account: the issuer’s OIDC discovery, then its client-credentials grant, proved by the account’s secret or by an assertion signed with its key (client_assertion). The token is kept until it is due for renewal by the schedule every Semiont client keeps (semiont::session): half its lifetime before it expires, at most REFRESH_BEFORE_EXP. A service reaches another as itself with this token.
transport
A knowledge base’s bus over its gateway’s HTTP transport (protocol/contract/TRANSPORT-HTTP.md), as semiont::transport::Transport: one stream, POST /bus/subscribe, naming the client’s global channels and an entry per resource scope it holds, and POST /bus/emit for what it sends. The gateway’s own operations ride plain request and response.