mirror of
https://github.com/nais/wonderwall.git
synced 2026-02-14 17:49:54 +00:00
docs: use mermaid for diagrams
This commit is contained in:
24
README.md
24
README.md
@@ -24,12 +24,34 @@ By default, it does not actually modify any proxied request if the user agent do
|
||||
|
||||
The image below shows the overall architecture of an application when using Wonderwall as a sidecar:
|
||||
|
||||

|
||||
```mermaid
|
||||
flowchart TB
|
||||
accTitle: System Architecture
|
||||
accDescr: The architectural diagram shows the browser sending a request into the Kubernetes container, requesting the ingress https://<app>.nav.no, requesting the service https://<app>.<namespace>, sending it to the pod, which contains the sidecar. The sidecar sends a proxy request to the app, in addition to triggering and handling the Open ID Connect Auth Code Flow to the identity provider. The identity provider is outside the Kubernetes environment.
|
||||
|
||||
idp(Identity Provider)
|
||||
Browser -- 1. initial request --> k8s
|
||||
Browser -- 2. redirected by Wonderwall --> idp
|
||||
idp -- 3. performs OpenID Connect Auth Code flow --> Browser
|
||||
|
||||
subgraph k8s [Kubernetes]
|
||||
direction LR
|
||||
Ingress(Ingress<br>https://<app>.nav.no) --> Service(Service<br>http://<app>.<namespace>) --> Wonderwall
|
||||
subgraph Pod
|
||||
direction TB
|
||||
Wonderwall -- 4. proxy request with access token --> Application
|
||||
Application -- 5. return response --> Wonderwall
|
||||
end
|
||||
end
|
||||
```
|
||||
|
||||
The sequence diagram below shows the default behavior of Wonderwall:
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
accTitle: Sequence Diagram
|
||||
accDescr: The sequence diagram shows the default behaviour of the sidecar, depending on whether the user already has a session or not. If the user does have a session, the sequence is as follows: 1. The user visits a path, that requests the ingress. 2. The request is forwarded to wonderwall 3. Wonderwall checks for a session in session storage. 4. Wonderwall attaches Authorization header and proxies request and sends it to the application. 5. The application returns a response to Wonderwall. 6. Wonderwall returns the response to the user. If the user does not have a session, the sequence is as follows: 1. The user visits a path, that requests the ingress. 2. The request is forwarded to wonderwall 3. Wonderwall checks for a session in session storage. 4. Wonderwall proxies the request as-is and sends it to the application. 5. The application returns a response to Wonderwall. 6. Wonderwall returns the response to the user.
|
||||
|
||||
actor User
|
||||
User->>Ingress: visits /path
|
||||
Ingress-->>Wonderwall: forwards request
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 386 KiB |
Reference in New Issue
Block a user