Skip to main content

Crate sofie_http

Crate sofie_http 

Source

Modules§

remote
What a split app serves the apps it left: contracts, batch lookups and its event feed, each call proven by a principal token signed with the keys every app of the deployment shares.

Structs§

ActionRoute
ActiveBlock
An address is shown by its network only.
ActiveBlocks
What a GET may take: lifting a block needs ShieldBlocks, in a POST.
App
AppName
Given by Serving::named, sofie without one; for an authenticator’s issuer and the like.
Bearer
BrowserSample
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.
Cors
Allows nothing until told; methods default to GET, HEAD and POST.
CorsOrigins
area=origin pairs separated by commas, an area named once per origin.
CsvRows
The request body’s CSV, each row read as its input is from a form; a row the input refuses refuses them all, its errors named <row>.<field>.
CurrentSession
The session the request’s cookie carries, read in a page’s loader as in an action.
Delivery
The body exactly as sent.
Entitlement
Named <module>.<entitlement> like a flag; what grants one is the app’s billing.
FlagRules
What a GET may take: setting a flag needs Flags, in a POST.
Form
Gates
Listed
Answered as {items, page, size, has_next, sort, filter, query, controls, errors}, what a Table links from; errors holds each filter whose value its field refuses, with its message’s key and arguments, so a client area shows it in the viewer’s language.
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.
Listing
A path parameter naming a field filters too, so a child is listed only under its own parent. Q reads the query’s other parameters, as crate::Query does; () reads none.
Menu
MenuEntry
Method
The Request Method (VERB)
MetricsToken
Never printed: Debug shows only that there is one.
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
Permission
Derived by sofie gen, never written by hand; a * axis stands for every value.
Permissions
Nothing outside a Permitted area.
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
RequestHead
ResourceRoutes
ResponseHead
The status and body are the handler’s and the framework’s; a step changes headers only.
RouteFeature
RouteName
RoutePath
Made by a contract’s route builders, so links and tests name a route by its handler.
RoutePermission
Routes
Handlers are plain async fns whose arguments all resolve in A; a GET’s in its ReadContext.
Screen
sofie check holds the template against T; JSON callers get the data alone.
Screens
Keyed <module>/<area>/<name>.
Sealing
Encrypts small values with the app’s keys, each for one purpose: a value sealed for one purpose never opens for another, and none opens without the keys.
Serving
Session
Changes reach the cookie only once the handler’s outcome has committed.
Setting
Shield
sofie::run reads it from SOFIE_SHIELD, SOFIE_SHIELD_THRESHOLDS and SOFIE_SHIELD_SHARED.
ShieldBlocks
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:
SignIns
Without the shield running it counts nothing and locks nothing.
SignedUrls
Opens a .signed() route without a session until it expires.
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.
Thresholds
SOFIE_SHIELD_THRESHOLDS: scan=60, member.probe=40; an area’s own count wins.
Tls
TrustedProxies
Nothing is trusted by default, so a client cannot name its own address.
Upload
A file received with the request, already in the app’s Storage. Only the framework makes one, from a multipart/form-data body; a JSON body cannot name a stored file.
Visitor
Another area cannot resolve it:
Web
WebhookRoute

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.
Resource
SessionRecord
What a session store holds of a session.
SettingValue
ShieldMode
SOFIE_SHIELD: on, dry-run, off.
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.
Entitled
What a principal’s plan holds, read once per request that needs it.
Groups
Loader
What a GET, a screen or an island is answered by.
Navigation
NeedsPermission
For a framework crate’s own routes, which sofie gen does not read.
OwnerOf
PipelineStep
check can only refuse and runs after CSRF, the guard and rate limits, so a step cannot let through what they refused.
Resources
Shipped
Verify

Functions§

built_in_screen_source
What sofie scaffold screen writes out for a module to override.
is_permission
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.
screen_key
screens_from_sources
translations
As sofie gen writes them: the source language first, then each module’s lang/<language>.toml files; enums by their enum.<name>.<variant> names, so badges and selects show their variants translated.
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§

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