package/@git/url_897efafd565158fc4908@0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/contracts.aug diagrams
OpenID Connect login application
Project overview · Compiled explanation
Class interactions
Mermaid source
flowchart TD
n0["HttpClient"]
n1["RequestLogger"]
n2["WebHttpClient"]
n3["WebRequestLogger"]
n4["_aug_http_log"]
n5["_aug_http_request"]
n2 -->|"implements"| n0
n2 -->|"calls"| n5
n3 -->|"implements"| n1
n3 -->|"calls"| n4
Sequences
Call arrows identify checked targets; loop and branch frames determine when they run. Open that target’s module to follow its implementation. Branches describe alternatives; loops describe repeated work. Native calls and interface dispatch stop at their declared contracts. Exit notes end that path; enclosing recovery and cleanup remain visible.
Principal constructor
Immutable identity returned by an explicitly injected authentication adapter.
It takes subject as a string, kept read-only and permissions as List<string>, kept read-only.
Receive fields: subject, permissions. Explanation.
Authentication.authenticate
It takes request as HttpRequest.
It returns optional Principal. It can call Authentication.authenticate. Failures can raise HttpError.
May leave with checked errors: HttpError. Interface contract; implementation selected at runtime. Explanation.
Authorization.authorize
It takes identity as Principal and permission as a string.
It returns bool. It can call Authorization.authorize. Failures can raise HttpError.
May leave with checked errors: HttpError. Interface contract; implementation selected at runtime. Explanation.
RequestLogger.complete
It takes method and path as strings and status and milliseconds as integers.
It can call RequestLogger.complete.
Interface contract; implementation selected at runtime. Explanation.
_aug_http_log
It is private to its defining scope.
It takes method and path as strings and status and milliseconds as integers.
It can call RequestLogger.complete.
Native C implementation; only its declared contract is visible here.
Native implementation; only the declared contract is known. Explanation.
WebRequestLogger constructor
Emit escaped JSON request metadata to standard error. Credentials and query strings are excluded. It implements RequestLogger.
WebRequestLogger.complete
It takes method and path as strings and status and milliseconds as integers.
It can call RequestLogger.complete.
Mermaid source
sequenceDiagram
participant p0 as WebRequestLogger.complete
rect rgb(245, 240, 241)
Note over p0: Enter unsafe scope
p0->>p0: _aug_http_log(method=method, path=path, status=status,<br/>milliseconds=milliseconds) · native boundary
Note over p0: Leave unsafe scope
end
HttpClient.request
Perform an HTTP request with bounded bytes. Inside a task, waiting suspends the task's C stack.
It takes method and url as strings, headers as optional Headers, and body as optional Bytes. Omitted optional inputs are null.
It returns HttpResponse<Bytes>. It can call HttpClient.request. Failures can raise HttpError.
May leave with checked errors: HttpError. Interface contract; implementation selected at runtime. Explanation.
_aug_http_request
It is private to its defining scope.
It takes method and url as strings, headers as optional Headers, and body as optional Bytes. Omitted optional inputs are null.
It returns HttpResponse<Bytes>. It can call HttpClient.request. Failures can raise HttpError.
Native C implementation; only its declared contract is visible here.
May leave with checked errors: HttpError. Native implementation; only the declared contract is known. Explanation.
WebHttpClient constructor
Native libwebsockets transport. No socket is opened by construction. It implements HttpClient.
WebHttpClient.request
Perform an HTTP request with bounded bytes. Inside a task, waiting suspends the task's C stack.
It takes method and url as strings, headers as optional Headers, and body as optional Bytes. Omitted optional inputs are null.
It can call HttpClient.request. Failures can raise HttpError.
Mermaid source
sequenceDiagram
participant p0 as WebHttpClient.request
rect rgb(245, 240, 241)
Note over p0: Enter unsafe scope
p0->>p0: _aug_http_request(method=method, url=url,<br/>headers=headers, body=body) · native boundary
p0-->>p0: _aug_http_request result: HttpResponse‹Bytes›
Note over p0: Return _aug_http_request(method=method, url=url,<br/>headers=headers, body=body); required cleanup runs<br/>before exit
Note over p0: Leave unsafe scope
end
Note over p0: May leave with checked errors: HttpError
redirect
Return a redirect with an explicit status. Location is checked as a header value.
It takes location as a string and status as optional int. Omitted optional inputs are null.
Failures can raise HttpError.
Mermaid source
sequenceDiagram
participant p0 as redirect
Note over p0: Set code to 303
alt Match when null:
Note over p0: No operations in this branch
else Match when some value:
Note over p0: Set code to value
end
p0->>p0: Headers()
p0-->>p0: Headers result: Headers
p0->>p0: Headers result.with(name=”location”, value=location)
p0-->>p0: headers: Headers
p0->>p0: HttpResponse(body=””, status=code, headers=headers)
p0-->>p0: HttpResponse result: HttpResponse‹string›
Note over p0: Return HttpResponse(body=””, status=code,<br/>headers=headers); required cleanup runs before exit
Note over p0: May leave with checked errors: HttpError
_aug_http_url_encode
It is private to its defining scope.
It takes input as a string.
It returns string. Failures can raise HttpError.
Native C implementation; only its declared contract is visible here.
May leave with checked errors: HttpError. Native implementation; only the declared contract is known. Explanation.
urlEncode
Encode a UTF-8 value as one URL query or form component using RFC 3986 unreserved characters.
It takes input as a string.
Failures can raise HttpError.
Mermaid source
sequenceDiagram
participant p0 as urlEncode
rect rgb(245, 240, 241)
Note over p0: Enter unsafe scope
p0->>p0: _aug_http_url_encode(input=input) · native boundary
p0-->>p0: _aug_http_url_encode result: string
Note over p0: Return _aug_http_url_encode(input); required cleanup<br/>runs before exit
Note over p0: Leave unsafe scope
end
Note over p0: May leave with checked errors: HttpError
_aug_http_cookie
It is private to its defining scope.
It takes name, value, and path as strings, maxAge as an integer, and secure as a boolean.
It returns Headers. Failures can raise HttpError.
Native C implementation; only its declared contract is visible here.
May leave with checked errors: HttpError. Native implementation; only the declared contract is known. Explanation.
cookie
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.
It takes name, value, and path as strings, maxAge as an integer, and secure as a boolean.
Failures can raise HttpError.
Mermaid source
sequenceDiagram
participant p0 as cookie
rect rgb(245, 240, 241)
Note over p0: Enter unsafe scope
p0->>p0: _aug_http_cookie(name=name, value=value, path=path,<br/>maxAge=maxAge, secure=secure) · native boundary
p0-->>p0: _aug_http_cookie result: Headers
Note over p0: Return _aug_http_cookie(name, value, path, maxAge,<br/>secure); required cleanup runs before exit
Note over p0: Leave unsafe scope
end
Note over p0: May leave with checked errors: HttpError
Called contracts
- HttpClient — package/@git/url_897efafd565158fc4908@0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/contracts.aug
- RequestLogger — package/@git/url_897efafd565158fc4908@0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/contracts.aug
- _aug_http_cookie — package/@git/url_897efafd565158fc4908@0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/contracts.aug
- _aug_http_log — package/@git/url_897efafd565158fc4908@0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/contracts.aug
- _aug_http_request — package/@git/url_897efafd565158fc4908@0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/contracts.aug
- _aug_http_url_encode — package/@git/url_897efafd565158fc4908@0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/contracts.aug