Skip to content

august.web ​

Install this source library with aug add https://github.com/GreenPandaStudios/augscript/src/stdlib/web --as web, then import its public names from web.

Signatures show result types and checked errors. See packages to pin a release and language constructs for built-in types.

Principal ​

text
record Principal(string subject, List<string> permissions)

Immutable identity returned by the authentication adapter.

Source

Authentication ​

text
capability Authentication

Verify the request's credentials. null means unauthenticated; adapter failures raise HttpError.

Source

Authentication.authenticate ​

text
authenticate(HttpRequest request) returns optional Principal unless HttpError

Uses Authentication.authenticate.

Source

Authorization ​

text
capability Authorization

Decide whether a verified identity has one named permission.

Source

Authorization.authorize ​

text
authorize(Principal identity, string permission) returns bool unless HttpError

Uses Authorization.authorize.

Source

RequestLogger ​

text
capability RequestLogger

Observe a completed HTTP exchange, including failures and disconnects.

Source

RequestLogger.complete ​

text
complete(string method, string path, int status, int milliseconds)

Uses RequestLogger.complete.

Source

WebRequestLogger ​

text
WebRequestLogger() implements RequestLogger

Emit escaped JSON request metadata to standard error. Credentials and query strings are excluded.

Source

WebRequestLogger.complete ​

text
complete(string method, string path, int status, int milliseconds)

Uses RequestLogger.complete.

Source

HttpClient ​

text
capability HttpClient

Make outbound HTTP requests. TLS verifies the peer; callers handle redirects.

Source

HttpClient.request ​

text
request(string method, string url, optional Headers headers, optional Bytes body) returns HttpResponse<Bytes> unless HttpError

Perform an HTTP request with bounded bytes. Waiting for a response suspends the calling task.

Uses HttpClient.request.

Source

WebHttpClient ​

text
WebHttpClient() implements HttpClient

Native libwebsockets transport. No socket is opened by construction.

Source

WebHttpClient.request ​

text
request(string method, string url, optional Headers headers, optional Bytes body) returns HttpResponse<Bytes> unless HttpError

Perform an HTTP request with bounded bytes. Waiting for a response suspends the calling task.

Uses HttpClient.request.

Source

redirect ​

text
redirect(string location, optional int status) returns HttpResponse<string> unless HttpError

Return a redirect with an explicit status. Location is checked as a header value.

Source

urlEncode ​

text
urlEncode(string input) returns string unless HttpError

Encode a UTF-8 value as one URL query or form component using RFC 3986 unreserved characters.

Source

text
cookie(string name, string value, string path, int maxAge, bool secure) returns Headers unless HttpError

Construct an HttpOnly, SameSite=Lax session cookie. Secure defaults are chosen explicitly at the call site. Values and paths reject delimiters and controls. maxAge=0 clears the cookie.

Source

ServerControl ​

text
capability ServerControl

Stop accepting requests, drain admitted exchanges up to the given milliseconds, then cancel remaining work. serve returns after request cleanup has joined.

Source

ServerControl.stop ​

text
stop(int milliseconds) unless HttpError

Uses ServerControl.stop.

Source

WebServerControl ​

text
WebServerControl() implements ServerControl

Control the server on its event-loop thread. Owned services can be disposed after serve returns.

Source

WebServerControl.stop ​

text
stop(int milliseconds) unless HttpError

Uses ServerControl.stop.

Source

The world runs on language