Liking cljdoc? Tell your friends :D

wagoe.platform.core.http.access

Who may reach a route, and what a refused caller is told.

Every route requires a signed-in user unless its route data carries :public true (BOU-568). A refusal has the shape the user module's require-authenticated interceptor answers with, so a client sees one 401 whichever layer refused it: the one error body of wagoe.platform.core.http.errors (BOU-586). No Content-Type: muuntaja encodes a map body only when none is set (ZZP-120).

Who may reach a route, and what a refused caller is told.

Every route requires a signed-in user unless its route data carries
`:public true` (BOU-568). A refusal has the shape the user module's
`require-authenticated` interceptor answers with, so a client sees one 401
whichever layer refused it: the one error body of
`wagoe.platform.core.http.errors` (BOU-586). No Content-Type: muuntaja encodes a map body
only when none is set (ZZP-120).
raw docstring

wagoe.platform.core.http.client-ip

The address a request came from, as opposed to the proxy that delivered it.

:remote-addr is the peer, which behind a reverse proxy is the proxy. Any client can send X-Forwarded-For, so it is read only when the peer is a trusted proxy, and from the right: each proxy appends the address it saw, so the first hop that is not one of ours is the client.

The address a request came from, as opposed to the proxy that delivered it.

`:remote-addr` is the peer, which behind a reverse proxy is the proxy. Any
client can send X-Forwarded-For, so it is read only when the peer is a
trusted proxy, and from the right: each proxy appends the address it saw,
so the first hop that is not one of ours is the client.
raw docstring

wagoe.platform.core.http.error-pages

What a browser is shown for an error body: a page for a /web request, a toast for an htmx one. An API caller, or a script asking for JSON, keeps the body of wagoe.platform.core.http.errors.

What a browser is shown for an error body: a page for a /web request, a
toast for an htmx one. An API caller, or a script asking for JSON, keeps the
body of `wagoe.platform.core.http.errors`.
raw docstring

wagoe.platform.core.http.errors

The one JSON error body (BOU-586):

{"error": {"type": "not-found", "message": "User not found", "details": {...}, ; optional "correlation-id": "...", ; optional "dev": {...}}} ; optional, dev only (WGE code)

Everything about the failure sits inside error, so a client reads one key. type is a string: the :type keyword of the ex-info, without its colon.

The one JSON error body (BOU-586):

  {"error": {"type":           "not-found",
             "message":        "User not found",
             "details":        {...},    ; optional
             "correlation-id": "...",  ; optional
             "dev":            {...}}}   ; optional, dev only (WGE code)

Everything about the failure sits inside `error`, so a client reads one
key. `type` is a string: the `:type` keyword of the ex-info, without its
colon.
raw docstring

wagoe.platform.core.http.nav

The sidebar navigation modules contribute, as data.

A module's route contribution may carry :nav, groups by id:

{:user {:label [:t :user/nav-title] :icon :users :entities [:users] ; admin entities this module owns :items [{:href "/web/audit" :label .. :icon :file-text :access :platform-admin :description ..}]}} ; optional, for dashboard cards

An item with :entity (the admin contributes one per entity) is placed by module: its :module, else the group whose :entities names it, else :other. Other items stay in the group that declared them.

The platform binds *nav* around each request, so a page renders the whole sidebar without depending on the modules in it.

The sidebar navigation modules contribute, as data.

A module's route contribution may carry `:nav`, groups by id:

  {:user {:label    [:t :user/nav-title]
          :icon     :users
          :entities [:users]          ; admin entities this module owns
          :items    [{:href "/web/audit" :label .. :icon :file-text
                      :access :platform-admin
                      :description ..}]}}  ; optional, for dashboard cards

An item with `:entity` (the admin contributes one per entity) is placed by
module: its `:module`, else the group whose `:entities` names it, else
`:other`. Other items stay in the group that declared them.

The platform binds `*nav*` around each request, so a page renders the whole
sidebar without depending on the modules in it.
raw docstring

wagoe.platform.core.http.pages

Whether a page is mounted, for layouts deciding what to link to.

Whether a page is mounted, for layouts deciding what to link to.
raw docstring

wagoe.platform.core.http.problem-details

Exceptions to error responses, and the :type -> status table.

The name is historical: these were RFC 7807 bodies until BOU-586 made every JSON error the one shape of wagoe.platform.core.http.errors.

Exceptions to error responses, and the `:type` -> status table.

The name is historical: these were RFC 7807 bodies until BOU-586 made every
JSON error the one shape of `wagoe.platform.core.http.errors`.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close