Skip to main content

Crate sofie_http

Crate sofie_http 

Source

Structs§

ActionRoute
App
AppName
Given by Serving::named, sofie without one; for an authenticator’s issuer and the like.
ContentSecurity
Hosts an area’s pages may reach besides their own; nothing until told. Each source is https://host[:port], its leftmost label * for any subdomain.
CookieNames
__Host- makes browsers refuse a cookie unless Secure, Path=/ and without Domain, so no other host can set or shadow it.
CurrentSession
The session the request’s cookie carries, read in a page’s loader as in an action.
Form
ListedRoute
A row of a package’s ROUTES table, named <crate>.<area>.<handler> once mounted; mount is the route function adding it. sofie routes reads the tables without compiling, so every row stays a call with literal arguments.
Method
The Request Method (VERB)
Module
A module crate’s MODULE: its manifest (name, tier, context, settings) spreading what sofie gen writes in its src/wiring.rs; a package writes its own.
Next
PageRoute
Principal
Resolves only in A, so a handler cannot ask for another area’s principal.
Query
A GET’s query string read as Q, an Input checked as a body is: a refused value is a 422 with its field errors, a key Q has no field for a 400 unless it is a tracking key. Query alone reads keys by name.
QueryText
The query string as it came, for a caller such as an OAuth provider sending keys of its own.
Rate
A token bucket: all at once, then one more each period / count.
RequestContext
RouteName
RoutePath
Made by a contract’s route builders, so links and tests name a route by its handler.
Routes
Handlers are plain async fns whose arguments all resolve in A; a GET’s in its ReadContext.
Screens
Keyed <module>/<area>/<name>.
Serving
Session
Changes reach the cookie only once the handler’s outcome has committed.
Setting
SignInRight
The right to sign a principal in, minted only for an Admitter; zero-sized, so carrying it costs nothing. It cannot be built any other way:
SigningKeys
The first key seals and signs, every key opens: rotate by putting the successor first.
Text
What a document route’s loader answers: its whole body.
Visitor
Another area cannot resolve it:
Web

Enums§

Access
Client
What an area’s pages are: HTML over the wire, or the same templates compiled into a client framework’s components when the app is built.
Media
What a document route’s text is, for crawlers and feed readers rather than pages.
Reading
Answers a GET, a screen or an island: a handler resolved in it never writes.
SettingValue
Tier
A module depends only on its own tier or lower ones.
Writing
Answers every other method: the unit of work commits its handler’s outcome.

Traits§

Admitter
Implemented by a private type of each package whose job is signing principals in, such as sofie-identity’s: it alone mints the SignInRight that Session::sign_in takes. Code that implements it for a type of its own can sign anyone in, so only such a package should.
Area
Its principal resolves only in its own area.
AreaMembers
AreaPrincipal
An aggregate is its own principal, owning its records; a marker such as sofie-identity’s Permitted names the aggregate that signs in under another access.
Loader
What a GET, a screen or an island is answered by.

Functions§

migrations
path_rest
For {*rest}: each part is encoded, the slashes between them kept.
path_segment
A / in value stays inside the segment.
percent_encode
Unreserved bytes and / as they are, every other byte as %XX.
require_aggregate
Called in a const block by a route builder, whose contract cannot name the module’s aggregate: an id of any other aggregate fails the build.
wired_screens
With development, each template is read and parsed again whenever it or one of the module components ((name, path)) is edited; otherwise its compiled program is loaded. A screen keyed under another module than the one listing it replaces that module’s own.
worker

Type Aliases§

Mount
PrincipalRecord
The aggregate an area’s principal signs in as.
ReadContext