diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/rfc.md | 69 | ||||
| -rw-r--r-- | docs/rfc.txt | 114 |
2 files changed, 134 insertions, 49 deletions
diff --git a/docs/rfc.md b/docs/rfc.md index 8c5818e..8296cfa 100644 --- a/docs/rfc.md +++ b/docs/rfc.md @@ -153,15 +153,16 @@ Payload type attributes describes following characteristics: * C - Client: can be send only by a client * E - Empty: signals an event but does not carry any data -| Type | Name | Attributes | -|------|-----------|------------| -| 0x00 | | R | -| 0x01 | Success | SCE | -| 0x02 | Error | S | -| 0x03 | Handshake | SC | -| 0x04 | Auth | C | -| 0x05 | Message | SC | -| 0xFF | Test | R | +| Type | Name | Attributes | +|------|------------|------------| +| 0x00 | | R | +| 0x01 | Success | SCE | +| 0x02 | Error | S | +| 0x03 | Handshake | SC | +| 0x04 | UserAuth | C | +| 0x05 | Message | SC | +| 0x06 | ServerAuth | S | +| 0xFF | Test | R | ### Success @@ -177,8 +178,9 @@ Payload is always empty for this type. | Type | Description | |------|-----------------------------------------------------------| -| 0x01 | Auth failed. Invalid username or password. | +| 0x01 | Client auth failed. Invalid username or password. | | 0x02 | Not found. User or channel cannot access user or channel. | +| 0x03 | Server auth failed. Unknown name. | ### Handshake @@ -200,13 +202,19 @@ different auth method will be used. | 0x01 | User -> Server | | 0x02 | Server -> Server | -### Auth +### UserAuth | Type | Name | |--------|----------| | string | username | | string | password | +### ServerAuth + +| Type | Name | +|--------|----------| +| string | name | + ### Message | Type | Name | @@ -238,7 +246,7 @@ Some operations require multiple rounds of communication. In this case payloads are send in a sequence. Payload that is not part of this specific operation (for example incoming message) cannot interrupt this process. -### Connection initialisation +### Client-Server connection initialisation ~~~ ascii-art +--------+ +--------+ @@ -254,7 +262,7 @@ specific operation (for example incoming message) cannot interrupt this process. | +- If [ver_major] does not match server | | protocol version close the connection | | - | Send [Auth] | + | Send [UserAuth] | +--------------------------->| | | | Send [Error 0x01] | @@ -263,4 +271,37 @@ specific operation (for example incoming message) cannot interrupt this process. | | | Send [Sucesss] | |<---------------------------+ -~~~
\ No newline at end of file +~~~ + +### Server-Server connection initialisation + +~~~ ascii-art ++--------+ +--------+ +| Server | | Server | ++----+---+ +----+---+ + | | + | Initialise TCP connection | + +--------------------------->| + | | + | Send [Handshake] | + +--------------------------->| + | | + | +- If [ver_major] does not match server + | | protocol version close the connection + | | + | Send [ServerAuth] | + +--------------------------->| + | | + | Send [Error 0x03] | + |<---------------------------+- If [name] is not present in known public + | | keys list. + | | + | Send [Sucesss] | + |<---------------------------+ +~~~ + +## Server to server operation + +Exchanging messages between SOLEC servers is a core concept behind the project. +Sending message to user residing on a different server require estabilishing a +connection between both servers. diff --git a/docs/rfc.txt b/docs/rfc.txt index f9e8bca..ffd2f67 100644 --- a/docs/rfc.txt +++ b/docs/rfc.txt @@ -1,7 +1,7 @@ SOLEC Working Group bt, Ed. Internet-Draft RCTT.net -Intended status: Experimental 14 April 2026 -Expires: 16 October 2026 +Intended status: Experimental 18 April 2026 +Expires: 20 October 2026 System of Lightweight Electronic Communication @@ -29,11 +29,14 @@ Table of Contents 2.4.1. Success 2.4.2. Error 2.4.3. Handshake - 2.4.4. Auth - 2.4.5. Message - 2.4.6. Test + 2.4.4. UserAuth + 2.4.5. ServerAuth + 2.4.6. Message + 2.4.7. Test 2.5. Sequential operations - 2.5.1. Connection initialisation + 2.5.1. Client-Server connection initialisation + 2.5.2. Server-Server connection initialisation + 2.6. Server 1. Introduction @@ -153,25 +156,27 @@ Table of Contents * C - Client: can be send only by a client * E - Empty: signals an event but does not carry any data - +======+===========+============+ - | Type | Name | Attributes | - +======+===========+============+ - | 0x00 | | R | - +------+-----------+------------+ - | 0x01 | Success | SCE | - +------+-----------+------------+ - | 0x02 | Error | S | - +------+-----------+------------+ - | 0x03 | Handshake | SC | - +------+-----------+------------+ - | 0x04 | Auth | C | - +------+-----------+------------+ - | 0x05 | Message | SC | - +------+-----------+------------+ - | 0xFF | Test | R | - +------+-----------+------------+ - - Table 1 + +======+============+============+ + | Type | Name | Attributes | + +======+============+============+ + | 0x00 | | R | + +------+------------+------------+ + | 0x01 | Success | SCE | + +------+------------+------------+ + | 0x02 | Error | S | + +------+------------+------------+ + | 0x03 | Handshake | SC | + +------+------------+------------+ + | 0x04 | UserAuth | C | + +------+------------+------------+ + | 0x05 | Message | SC | + +------+------------+------------+ + | 0x06 | ServerAuth | S | + +------+------------+------------+ + | 0xFF | Test | R | + +------+------------+------------+ + + Table 1 2.4.1. Success @@ -192,10 +197,12 @@ Table of Contents +======+============================================================+ | Type | Description | +======+============================================================+ - | 0x01 | Auth failed. Invalid username or password. | + | 0x01 | Client auth failed. Invalid username or password. | +------+------------------------------------------------------------+ - | 0x02 | Not found. User or channel cannot access | - | | user or channel. | + | 0x02 | Not found. User or channel cannot access user or | + | | channel. | + +------+------------------------------------------------------------+ + | 0x03 | Server auth failed. Unknown name. | +------+------------------------------------------------------------+ Table 3 @@ -231,7 +238,7 @@ Table of Contents Table 5 -2.4.4. Auth +2.4.4. UserAuth +========+==========+ | Type | Name | @@ -243,7 +250,17 @@ Table of Contents Table 6 -2.4.5. Message +2.4.5. ServerAuth + + +========+======+ + | Type | Name | + +========+======+ + | string | name | + +--------+------+ + + Table 7 + +2.4.6. Message +===========+=================+ | Type | Name | @@ -257,9 +274,9 @@ Table of Contents | string | message_content | +-----------+-----------------+ - Table 7 + Table 8 -2.4.6. Test +2.4.7. Test Test payload is used for encoder and decoders testing. Clients and servers should ignore this kind of payload. @@ -284,7 +301,7 @@ Table of Contents | uint64 | num4 | +-----------+-------+ - Table 8 + Table 9 2.5. Sequential operations @@ -293,7 +310,7 @@ Table of Contents this specific operation (for example incoming message) cannot interrupt this process. -2.5.1. Connection initialisation +2.5.1. Client-Server connection initialisation +--------+ +--------+ | Client | | Server | @@ -308,7 +325,7 @@ Table of Contents | +- If [ver_major] does not match server | | protocol version close the connection | | - | Send [Auth] | + | Send [UserAuth] | +--------------------------->| | | | Send [Error 0x01] | @@ -317,3 +334,30 @@ Table of Contents | | | Send [Sucesss] | |<---------------------------+ + +2.5.2. Server-Server connection initialisation + + +--------+ +--------+ + | Server | | Server | + +----+---+ +----+---+ + | | + | Initialise TCP connection | + +--------------------------->| + | | + | Send [Handshake] | + +--------------------------->| + | | + | +- If [ver_major] does not match server + | | protocol version close the connection + | | + | Send [ServerAuth] | + +--------------------------->| + | | + | Send [Error 0x03] | + |<---------------------------+- If [name] is not present in known public + | | keys list. + | | + | Send [Sucesss] | + |<---------------------------+ + +2.6. Server |
