Add diagram in overview

This commit is contained in:
Marco Munizaga
2024-09-05 14:33:28 -07:00
parent 189492a0d7
commit 05012d7a48

View File

@@ -10,12 +10,65 @@ Interest Group: [@sukunrt], [@achingbrain]
## Introduction ## Introduction
This spec defines an authentication scheme of libp2p Peer IDs in accordance with This spec defines an HTTP authentication scheme of libp2p Peer IDs in accordance
[RFC 9110](https://datatracker.ietf.org/doc/html/rfc9110). The authentication with [RFC 9110](https://datatracker.ietf.org/doc/html/rfc9110). The
scheme is called `libp2p-PeerID`. authentication scheme is called `libp2p-PeerID`.
## Protocol Overview ## Protocol Overview
At a high level, challenges are exchanged and signed by each peer to
authenticate themselves to each other. The protocol works whether the Client
provides the first challenge, or the Server provides the first challenge.
Example Diagram of Server initiated handshake
```
┌─────────┐ ┌────────┐
│ Client │ │ Server │
└─────────┘ └────────┘
│ initial request │
├────────────────────────────>│
│ │
│ 401; challenge-client │
│<────────────────────────────┤
│ │
│ client-sig + │
│ challenge-server │
│ [client authenticated] │
├────────────────────────────>│
│ │
│ server-sig │
│ [server authenticated] │
│<────────────────────────────┤
│ │
│ application data │
├────────────────────────────>│
│ │
│ resp │
│<────────────────────────────┤
```
Example Diagram of Client initiated handshake
```
┌────────┐ ┌────────┐
│ Client │ │ Server │
└────────┘ └────────┘
│ challenge-server │
├────────────────────────────>│
│ │
│ challenge-client + │
│ server-sig │
│ [server authenticated] │
│<────────────────────────────┤
│ │
│ client-sig + │
│ application data │
│ [client authenticated] │
├────────────────────────────>│
│ │
│ resp │
│<────────────────────────────┤
```
## Parameters ## Parameters
| Param Name | Description | | Param Name | Description |