client/logout.aug diagrams
OpenID Connect login application
Project overview · Compiled explanation
Class interactions
logout
View 1 of 2
Mermaid source
flowchart LR
n0["logout"]
n1["authenticate"]
n2["securityHeaders"]
n3["withCookie"]
n4["SigningKeys"]
n5["settings"]
n6["ExpiringStore"]
n0 -->|"calls"| n1
n0 -->|"calls"| n2
n0 -->|"calls"| n3
n0 -->|"depends on"| n4
n0 -->|"calls"| n5
n0 -->|"calls take; depends on"| n6
View 2 of 2
Mermaid source
flowchart LR
n0["logout"]
n1["Crypto"]
n2["Clock"]
n0 -->|"calls equal; depends on"| n1
n0 -->|"calls now; depends on"| n2
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.
logout
logout handles POST /logout.
POST logout checks the origin and session-bound CSRF value, then removes the live registry entry before clearing the cookie.
It takes input as LogoutForm from the HTTP form, token as optional string from the HTTP cookie aug_session, and origin as optional string from the HTTP header. It gets crypto (Crypto), clock (Clock), keys (SigningKeys), and sessions (ExpiringStore<SessionClaims>) from dependency injection. Omitted optional inputs are null.
It can call Crypto.equal, Clock.now, ExpiringStore<SessionClaims>.take, SigningKeys.session, Crypto.publicRsa, ExpiringStore<SessionClaims>.get, Crypto.decodeBase64url, and Crypto.verifyRsa.
The handler responds with HTTP 403 for SessionError.
It can also raise CryptoError, HttpError, KeyError, and TimeError.
Sequence 1 of 2
Mermaid source
sequenceDiagram
participant p0 as logout
participant p1 as common/settings
participant p2 as client/session
participant p3 as crypto: Crypto
participant p4 as clock: Clock
participant p5 as sessions: ExpiringStore
Note over p0: POST /logout
p0->>p1: settings()
p1-->>p0: config: Settings
alt origin does not equal config.baseUrl
p0->>p0: SessionError() · construct value
p0-->>p0: SessionError result: SessionError
Note over p0: Raise checked failure SessionError(); required cleanup<br/>runs before exit
end
p0->>p2: authenticate(token=token)
p2-->>p0: session: SessionClaims
p0->>p0: input.csrf.bytes()
p0-->>p0: bytes result: Bytes
p0->>p0: session.csrf.bytes()
p0-->>p0: bytes result 2: Bytes
p0->>p3: equal(left=bytes result, right=bytes result 2) ·<br/>interface dispatch
p3-->>p0: equal result: bool
alt crypto.equal with left from the UTF-8 bytes of<br/>input.csrf and right from the UTF-8 bytes of<br/>session.csrf returns false
p0->>p0: SessionError() · construct value
p0-->>p0: SessionError result 2: SessionError
Note over p0: Raise checked failure SessionError(); required cleanup<br/>runs before exit
end
p0->>p4: now() · interface dispatch
p4-->>p0: now result: int
p0->>p5: take(key=session.jti, now=now result) · interface<br/>dispatch
p5-->>p0: take result: optional SessionClaims
Sequence 2 of 2 (continued)
Mermaid source
sequenceDiagram
participant p0 as logout
participant p1 as common/headers
Note over p0: Sequence continued from the previous view
p0->>p1: securityHeaders()
p1-->>p0: securityHeaders result: Headers
p0->>p0: securityHeaders result.with(name=”location”, value=”/”)
p0-->>p0: with result: Headers
p0->>p1: withCookie(headers=with result, name=”aug_session”,<br/>value=””, path=”/”, maxAge=0,<br/>secure=config.secureCookies)
p1-->>p0: headers: Headers
p0->>p0: HttpResponse(body=‹p›Signed out.‹/p›, status=303,<br/>headers=headers)
p0-->>p0: HttpResponse result: HttpResponse‹Html›
Note over p0: Return HttpResponse(body=‹p›Signed out.‹/p›, status=303,<br/>headers=headers); required cleanup runs before exit
Note over p0: May leave with checked errors: CryptoError, HttpError,<br/>KeyError, SessionError, TimeError
Note over p0: HTTP result follows declared response and error mapping;<br/>unhandled request failure returns 500
Called contracts
- SessionError — client/contracts.aug
- authenticate — client/session.aug
- securityHeaders — common/headers.aug
- withCookie — common/headers.aug
- SigningKeys — common/keys.aug
- settings — common/settings.aug
- ExpiringStore — package/@git/url_0eb7c89453c87681ed15@0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/store.aug
- ExpiringStore.take — package/@git/url_0eb7c89453c87681ed15@0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/store.aug
- Crypto — package/@git/url_9ef654c66d34ab8f5527@0.0.0-git.b14a0f9aa41f1ce58bd51133bcdc424033e40d40/contracts.aug
- Crypto.equal — package/@git/url_9ef654c66d34ab8f5527@0.0.0-git.b14a0f9aa41f1ce58bd51133bcdc424033e40d40/contracts.aug
- Clock — package/@git/url_c092cd151499c4e1d8a1@0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/contracts.aug
- Clock.now — package/@git/url_c092cd151499c4e1d8a1@0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/contracts.aug