Skip to content

Commit

Permalink
Improve sequence diagram formatting in usage documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
simonneutert committed Jan 4, 2025
1 parent 1fa7b7d commit 6e0a5bd
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions docs/usage/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,21 @@ This is a simple sequence diagram of the process, when login is successful:
<pre>
<code class="language-mermaid">
sequenceDiagram
Frontend Client ->>Server-Part/Backend: Let me browser your resources.
Server-Part/Backend-->>Frontend Client: Sure! Here you go. Some stuff requires authentication.
Frontend Client ->> Server-Part/Backend: Let me browser your resources.
Server-Part/Backend -->> Frontend Client: Sure! Here you go. Some stuff requires authentication.

Frontend Client->>Server-Part/Backend: I want to edit a resource.
Server-Part/Backend-->>Frontend Client: You need to authenticate first, please auth with `picnic-auth`.
Frontend Client ->> Server-Part/Backend: I want to edit a resource.
Server-Part/Backend -->> Frontend Client: You need to authenticate first, please auth with `picnic-auth`.

Frontend Client ->>Picnic Auth: POST to `/auth` with `username` and `password`.
Picnic Auth ->>Frontend Client: You're authed! Take this JWT (it expires in 1 hour).
Frontend Client ->> Server-Part/Backend: POST `username` and `password`.
Server-Part/Backend ->> Picnic Auth: POST to `/auth` with `username` and `password`.
Picnic Auth ->> Server-Part/Backend: Your user is authed! This JWT (it expires in 1 hour).
Server-Part/Backend ->> Frontend Client: You're authed! Take this JWT (it expires in 1 hour).

Frontend Client->>Server-Part/Backend: I want to edit a resource. I have a JWT in my header for you.
Server-Part/Backend-->>Picnic Auth: Extract JWT from header and validate against /auth/bearer.
Picnic Auth-->>Server-Part/Backend: This JWT is valid. Here's the user object for you to double check.
Server-Part/Backend-->>Frontend Client: You're good to go. Here's the resource you wanted to edit.
Frontend Client ->> Server-Part/Backend: I want to edit a resource. I have a JWT in my header for you.
Server-Part/Backend -->> Picnic Auth: Extract JWT from header and validate against /auth/bearer.
Picnic Auth -->> Server-Part/Backend: This JWT is valid. Here's the user object for you to double check.
Server-Part/Backend -->> Frontend Client: You're good to go. Here's the resource you wanted to edit.
</code>
</pre>

Expand Down

0 comments on commit 6e0a5bd

Please sign in to comment.