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

admin?clj

(admin? request)

Whether the signed-in user has the global admin role.

Whether the signed-in user has the global admin role.
sourceraw docstring

correlation-idclj

(correlation-id request fresh)

The caller's X-Correlation-ID, or fresh when it sent none.

The caller's X-Correlation-ID, or `fresh` when it sent none.
sourceraw docstring

error-page-htmlclj

(error-page-html status message correlation-id)

A bare error page, for an app that renders none of its own.

A bare error page, for an app that renders none of its own.
sourceraw docstring

escape-htmlclj

(escape-html s)

s safe in HTML text or an attribute.

`s` safe in HTML text or an attribute.
sourceraw docstring

forbidden-responseclj

(forbidden-response message _request correlation-id)

403 for a signed-in caller who may not do this, as refusal-response answers. A web page once redirected to the login form, which only sent the user back here.

403 for a signed-in caller who may not do this, as `refusal-response`
answers. A web page once redirected to the login form, which only sent the
user back here.
sourceraw docstring

in-tenant-scope?clj

(in-tenant-scope? request)

Whether the caller may use the schema the request runs in. With a tenant resolved: a member of it, a user of it, or a platform admin. Without one, the public schema: only a user of no tenant.

Whether the caller may use the schema the request runs in. With a tenant
resolved: a member of it, a user of it, or a platform admin. Without one,
the public schema: only a user of no tenant.
sourceraw docstring

platform-admin?clj

(platform-admin? user)

Whether user is an admin outside any tenant, whom platform-wide pages such as the audit trail admit. The role may be a string in an older session.

Whether `user` is an admin outside any tenant, whom platform-wide pages such
as the audit trail admit. The role may be a string in an older session.
sourceraw docstring

public?clj

(public? data)

Whether Reitit endpoint data opts out of authentication.

Whether Reitit endpoint data opts out of authentication.
sourceraw docstring

refusal-responseclj

(refusal-response status error message correlation-id)

status for a signed-in caller who may not do this: the error body, which the router shows a browser on /web as the app's error page. Not the login redirect, which would send them back here.

`status` for a signed-in caller who may not do this: the error body, which
the router shows a browser on /web as the app's error page. Not the login
redirect, which would send them back here.
sourceraw docstring

same-id?clj

(same-id? a b)

Whether a names the same id as b, a UUID or its string; never for nil a.

Whether `a` names the same id as `b`, a UUID or its string; never for nil `a`.
sourceraw docstring

tenant-admin?clj

(tenant-admin? request)

Whether the caller is an admin where the request runs. In a tenant: a platform admin, an admin by membership of it, or an admin user of it; an admin of another tenant is not one here. Without a tenant, admin?.

Whether the caller is an admin where the request runs. In a tenant: a
platform admin, an admin by membership of it, or an admin user of it; an
admin of another tenant is not one here. Without a tenant, `admin?`.
sourceraw docstring

unauthorized-responseclj

(unauthorized-response message request correlation-id)

401 for an API caller; a web page sends the browser to the login form, which returns it here afterwards.

401 for an API caller; a web page sends the browser to the login form,
which returns it here afterwards.
sourceraw docstring

web-request?clj

(web-request? request)

Whether request is for a page under /web.

Whether `request` is for a page under /web.
sourceraw 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