Add Peer Address section to README

This commit is contained in:
netkas 2024-09-02 19:31:29 -04:00
parent a48d2c4e89
commit bc13b0e066
2 changed files with 51 additions and 5 deletions

18
.idea/workspace.xml generated
View file

@ -4,7 +4,8 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="18345731-10ed-4927-8692-8685f20e33be" name="Changes" comment="Updated TOC"> <list default="true" id="18345731-10ed-4927-8692-8685f20e33be" name="Changes" comment="Added Peer Address section">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" /> <change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
@ -145,7 +146,7 @@
<option name="presentableId" value="Default" /> <option name="presentableId" value="Default" />
<updated>1725301232290</updated> <updated>1725301232290</updated>
<workItem from="1725301233351" duration="4877000" /> <workItem from="1725301233351" duration="4877000" />
<workItem from="1725312281181" duration="1883000" /> <workItem from="1725312281181" duration="2648000" />
</task> </task>
<task id="LOCAL-00001" summary="Nothing ever went wrong with plain-old markdown, right?"> <task id="LOCAL-00001" summary="Nothing ever went wrong with plain-old markdown, right?">
<option name="closed" value="true" /> <option name="closed" value="true" />
@ -243,7 +244,15 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1725318323694</updated> <updated>1725318323694</updated>
</task> </task>
<option name="localTasksCounter" value="13" /> <task id="LOCAL-00013" summary="Added Peer Address section">
<option name="closed" value="true" />
<created>1725319221672</created>
<option name="number" value="00013" />
<option name="presentableId" value="LOCAL-00013" />
<option name="project" value="LOCAL" />
<updated>1725319221672</updated>
</task>
<option name="localTasksCounter" value="14" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
@ -274,6 +283,7 @@
<MESSAGE value="Corrected Error tables as messages itself can be descriptive, but the code remains the same" /> <MESSAGE value="Corrected Error tables as messages itself can be descriptive, but the code remains the same" />
<MESSAGE value="Updated TOC" /> <MESSAGE value="Updated TOC" />
<MESSAGE value="Add DNS Handshake section to README" /> <MESSAGE value="Add DNS Handshake section to README" />
<option name="LAST_COMMIT_MESSAGE" value="Add DNS Handshake section to README" /> <MESSAGE value="Added Peer Address section" />
<option name="LAST_COMMIT_MESSAGE" value="Added Peer Address section" />
</component> </component>
</project> </project>

View file

@ -55,6 +55,10 @@ This project is licensed under GNU Free Documentation License v1.3, see the [LIC
* [UUID v4](#uuid-v4) * [UUID v4](#uuid-v4)
* [DNS Handshake](#dns-handshake) * [DNS Handshake](#dns-handshake)
* [Peer Address](#peer-address) * [Peer Address](#peer-address)
* [User Address](#user-address)
* [Server Address](#server-address)
* [Reserved Usernames](#reserved-usernames)
* [Regex Pattern (PCRE)](#regex-pattern-pcre)
* [RPC Communication](#rpc-communication) * [RPC Communication](#rpc-communication)
* [Notification & Request-Response Communication](#notification--request-response-communication) * [Notification & Request-Response Communication](#notification--request-response-communication)
* [Request Object](#request-object) * [Request Object](#request-object)
@ -68,7 +72,6 @@ This project is licensed under GNU Free Documentation License v1.3, see the [LIC
------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------
# Specifications # Specifications
Specifications are used to define exactly how each part of the Socialbox standard works, from communication to privacy, Specifications are used to define exactly how each part of the Socialbox standard works, from communication to privacy,
@ -129,6 +132,38 @@ This record indicates that the Socialbox instance is hosted on the subdomain soc
address stays consistent as john@example.com. This is because clients always resolve the main domain to find the TXT address stays consistent as john@example.com. This is because clients always resolve the main domain to find the TXT
record, which provides the URL of the Socialbox instance. record, which provides the URL of the Socialbox instance.
> TODO: Should specify username and domain name restrictions, such as length, character set, etc. (?)
### User Address
A user address is a peer address that identifies a user associated with a Socialbox instance. The user address format
consists of a username the domain name to which the user's account is registered, for example, *john@example.com*
### Server Address
A server address is a strict peer address that is similar a regular user address but instead the username is always
`host` and the domain name is the domain name of the server, for example, *host@example.com* indicates that the server
itself is the peer.
### Reserved Usernames
Certain usernames are reserved and cannot be used by users to register accounts. The following usernames are reserved:
- `host`: Reserved for server addresses.
- `admin`: Reserved for administrative purposes.
- `root`: Reserved for the root user.
- `system`: Reserved for system-related tasks.
- `anonymous`: Reserved for anonymous users.
- `guest`: Reserved for guest users.
- `support`: Reserved for support-related tasks.
### Regex Pattern (PCRE)
The following regex pattern can be used to validate a peer address:
```regex
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
```
## RPC Communication ## RPC Communication
@ -254,6 +289,7 @@ The fields in the error response object are as follows:
| `error` | `String` | Yes | Method not found | The error message. | | `error` | `String` | Yes | Method not found | The error message. |
| `code` | `Integer` | Yes | 0 | The error code. | | `code` | `Integer` | Yes | 0 | The error code. |
------------------------------------------------------------------------------------------------------------------------
# Error Codes # Error Codes