mirror of
https://github.com/cadmium-im/cadmium-docs-legacy.git
synced 2024-11-25 03:42:21 +00:00
Lint all MDs files
This commit is contained in:
parent
50807e52c0
commit
89e14cbcee
@ -1,16 +1,22 @@
|
|||||||
# Account login by username
|
# Account login by username
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
This extension is intended for logging into user account on a server by username
|
This extension is intended for logging into user account on a server by username
|
||||||
|
|
||||||
## Message type identifiers
|
## Message type identifiers
|
||||||
|
|
||||||
- `profile:login`
|
- `profile:login`
|
||||||
|
|
||||||
## Error codes
|
## Error codes
|
||||||
|
|
||||||
- 0: limit exceed
|
- 0: limit exceed
|
||||||
- 1: user ID/password isn't valid
|
- 1: user ID/password isn't valid
|
||||||
|
|
||||||
## Use cases
|
## Use cases
|
||||||
|
|
||||||
*Request*:
|
*Request*:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"id": "abcd",
|
"id": "abcd",
|
||||||
@ -24,6 +30,7 @@ This extension is intended for logging into user account on a server by username
|
|||||||
```
|
```
|
||||||
|
|
||||||
*Response*:
|
*Response*:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"id": "abcd",
|
"id": "abcd",
|
||||||
@ -38,6 +45,7 @@ This extension is intended for logging into user account on a server by username
|
|||||||
```
|
```
|
||||||
|
|
||||||
*<b>Error</b> response*:
|
*<b>Error</b> response*:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"id": "abcd",
|
"id": "abcd",
|
||||||
@ -52,33 +60,40 @@ This extension is intended for logging into user account on a server by username
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Business Rules
|
## Business Rules
|
||||||
|
|
||||||
None.
|
None.
|
||||||
|
|
||||||
## JSON Schema
|
## JSON Schema
|
||||||
**Payload**
|
|
||||||
|
### Payload
|
||||||
|
|
||||||
- Request:
|
- Request:
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface LoginRequestPayload {
|
interface LoginRequestPayload {
|
||||||
/**
|
/**
|
||||||
* The username of account which user wants to login
|
* The username of account which user wants to login
|
||||||
*/
|
*/
|
||||||
username: string,
|
username: string,
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Password of new account
|
* Password of new account
|
||||||
*/
|
*/
|
||||||
password: string
|
password: string
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
- Response:
|
- Response:
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface LoginResponsePayload {
|
interface LoginResponsePayload {
|
||||||
/**
|
/**
|
||||||
* Authentication token which required for various user actions (UUID)
|
* Authentication token which required for various user actions (UUID)
|
||||||
*/
|
*/
|
||||||
authToken: string,
|
authToken: string,
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Identifier of new user device (created by this login action)
|
* Identifier of new user device (created by this login action)
|
||||||
*/
|
*/
|
||||||
|
@ -48,7 +48,8 @@ This extension is intended for creating user accounts on a server
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
*<b>Error</b> response*:
|
- Error response:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"id": "abcd",
|
"id": "abcd",
|
||||||
|
@ -1,14 +1,19 @@
|
|||||||
# The Sections of a Cadmium Extension (CE) document
|
# The Sections of a Cadmium Extension (CE) document
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
The introduction to a CE document should contain description of the extension and example of problems which this extension can solve.
|
The introduction to a CE document should contain description of the extension and example of problems which this extension can solve.
|
||||||
|
|
||||||
## Message type identifiers
|
## Message type identifiers
|
||||||
|
|
||||||
In this section, specify the identifiers of the new types of protocol messages (which are introduced by the extension)
|
In this section, specify the identifiers of the new types of protocol messages (which are introduced by the extension)
|
||||||
|
|
||||||
## Glossary
|
## Glossary
|
||||||
|
|
||||||
If your CE document uses terms that may not be familiar to the reader, please define them in this section.
|
If your CE document uses terms that may not be familiar to the reader, please define them in this section.
|
||||||
|
|
||||||
## Use Cases
|
## Use Cases
|
||||||
|
|
||||||
It is recommended that document authors structure their proposals according to the use cases that the proposal will address. We have found that use cases force authors to focus on functionality rather than "protocol for the sake of protocol". It is also helpful to sort use cases by actor. Include one subsection for each use case.
|
It is recommended that document authors structure their proposals according to the use cases that the proposal will address. We have found that use cases force authors to focus on functionality rather than "protocol for the sake of protocol". It is also helpful to sort use cases by actor. Include one subsection for each use case.
|
||||||
|
|
||||||
When writing use cases and the associated protocols, make sure to:
|
When writing use cases and the associated protocols, make sure to:
|
||||||
@ -18,6 +23,7 @@ When writing use cases and the associated protocols, make sure to:
|
|||||||
* Include lots of protocol examples.
|
* Include lots of protocol examples.
|
||||||
|
|
||||||
*Example 1. An Example from Shakespeare*
|
*Example 1. An Example from Shakespeare*
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"id": "abcd",
|
"id": "abcd",
|
||||||
@ -29,31 +35,41 @@ When writing use cases and the associated protocols, make sure to:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Error Codes
|
## Error Codes
|
||||||
|
|
||||||
If your proposal defines a number of error and status codes, it is a good idea to include a table of all the codes defined in your document.
|
If your proposal defines a number of error and status codes, it is a good idea to include a table of all the codes defined in your document.
|
||||||
|
|
||||||
## Business Rules
|
## Business Rules
|
||||||
|
|
||||||
You may want to include a section describing various business rules (essentially, a variety of MUSTs, SHOULDs, and MAYs regarding application behavior). This is not required but can be helpful to implementers.
|
You may want to include a section describing various business rules (essentially, a variety of MUSTs, SHOULDs, and MAYs regarding application behavior). This is not required but can be helpful to implementers.
|
||||||
|
|
||||||
## Implementation Notes
|
## Implementation Notes
|
||||||
|
|
||||||
You may want to include a section devoted to implementation notes. Again, this is not required but can be helpful to implementers.
|
You may want to include a section devoted to implementation notes. Again, this is not required but can be helpful to implementers.
|
||||||
|
|
||||||
## Internationalization Considerations
|
## Internationalization Considerations
|
||||||
|
|
||||||
If there are any internationalization or localization issues related to your proposal, define them in this optional section.
|
If there are any internationalization or localization issues related to your proposal, define them in this optional section.
|
||||||
|
|
||||||
## Security Considerations
|
## Security Considerations
|
||||||
|
|
||||||
Your proposal MUST include a section entitled "Security Considerations". Even if there are no security features or concerns related to your proposal, you MUST note that fact. For helpful guidelines, refer to RFC 3552.
|
Your proposal MUST include a section entitled "Security Considerations". Even if there are no security features or concerns related to your proposal, you MUST note that fact. For helpful guidelines, refer to RFC 3552.
|
||||||
|
|
||||||
## JSON Schema
|
## JSON Schema
|
||||||
|
|
||||||
An JSON Schema is required in order for protocols to be approved by the Cadmium Developers. The Cadmium Developers team can assist you in defining an JSON Schema for the protocol you are proposing. Also you can define your schema as TypeScript interfaces, this is also allowed.
|
An JSON Schema is required in order for protocols to be approved by the Cadmium Developers. The Cadmium Developers team can assist you in defining an JSON Schema for the protocol you are proposing. Also you can define your schema as TypeScript interfaces, this is also allowed.
|
||||||
|
|
||||||
## Acknowledgements (optional)
|
## Acknowledgements (optional)
|
||||||
|
|
||||||
Most CE documents end with a section thanking non-authors who have made significant contributions or who have provided feedback regarding the specification.
|
Most CE documents end with a section thanking non-authors who have made significant contributions or who have provided feedback regarding the specification.
|
||||||
|
|
||||||
# Cadmium Extension Styleguide
|
## Cadmium Extension Styleguide
|
||||||
|
|
||||||
CE document are written in English. It is not expected that you will be a fine prose writer, but try to write in a clear, easily-understood fashion.
|
CE document are written in English. It is not expected that you will be a fine prose writer, but try to write in a clear, easily-understood fashion.
|
||||||
|
|
||||||
## Code Examples
|
### Code Examples
|
||||||
|
|
||||||
To show the hierarchy of JSON objects, indent two spaces for every level.
|
To show the hierarchy of JSON objects, indent two spaces for every level.
|
||||||
|
|
||||||
If an element possesses a large number of attributes, include a line break before each attribute and indent them so that they are vertically aligned for readability.
|
If an element possesses a large number of attributes, include a line break before each attribute and indent them so that they are vertically aligned for readability.
|
||||||
@ -61,6 +77,7 @@ If an element possesses a large number of attributes, include a line break befor
|
|||||||
If the JSON data of an element is long, include line breaks and indent by two spaces.
|
If the JSON data of an element is long, include line breaks and indent by two spaces.
|
||||||
|
|
||||||
*Example*:
|
*Example*:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"id": "abcd",
|
"id": "abcd",
|
||||||
@ -76,14 +93,19 @@ If the JSON data of an element is long, include line breaks and indent by two sp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Some examples include strings that are the output of a hashing algorithm such as SHA-1 or SHA-256. An easy way to generate these is to use the OpenSSL "dgst" command to generate the hash. For example, the following command will generate the SHA-1 hash `a6cf4baabcefb63189a1a1c56158aa431990bba9`:
|
Some examples include strings that are the output of a hashing algorithm such as SHA-1 or SHA-256. An easy way to generate these is to use the OpenSSL "dgst" command to generate the hash. For example, the following command will generate the SHA-1 hash `a6cf4baabcefb63189a1a1c56158aa431990bba9`:
|
||||||
```
|
|
||||||
|
```bash
|
||||||
echo -n '@juliet@396277b7dcd0f1173f2007baa604de7593529cc3fbf335fb7924851cb25c1fdf' | openssl dgst -hex -sha1
|
echo -n '@juliet@396277b7dcd0f1173f2007baa604de7593529cc3fbf335fb7924851cb25c1fdf' | openssl dgst -hex -sha1
|
||||||
```
|
```
|
||||||
|
|
||||||
Some examples include strings that are encoded using Base64. An easy way to generate these is to use the OpenSSL "enc" command to generate the base64-encoded equivalent. For example, the following command will generate the base64-encoded string `QGp1bGlldEAzOTYyNzdiN2RjZDBmMTE3M2YyMDA3YmFhNjA0ZGU3NTkzNTI5Y2MzZmJmMzM1ZmI3OTI0ODUxY2IyNWMxZmRm`:
|
Some examples include strings that are encoded using Base64. An easy way to generate these is to use the OpenSSL "enc" command to generate the base64-encoded equivalent. For example, the following command will generate the base64-encoded string `QGp1bGlldEAzOTYyNzdiN2RjZDBmMTE3M2YyMDA3YmFhNjA0ZGU3NTkzNTI5Y2MzZmJmMzM1ZmI3OTI0ODUxY2IyNWMxZmRm`:
|
||||||
```
|
|
||||||
|
```bash
|
||||||
echo -n '@juliet@396277b7dcd0f1173f2007baa604de7593529cc3fbf335fb7924851cb25c1fdf' | openssl enc -nopad -base64
|
echo -n '@juliet@396277b7dcd0f1173f2007baa604de7593529cc3fbf335fb7924851cb25c1fdf' | openssl enc -nopad -base64
|
||||||
```
|
```
|
||||||
## Conformance Terms
|
|
||||||
|
### Conformance Terms
|
||||||
|
|
||||||
Conformance terms (e.g,, "MUST" and "SHOULD") are specified in RFC 2119. Use them. When such terms are not in ALL CAPS, the special conformance sense does not apply (although it is preferable to use terms such as 'might' instead of 'may' and 'ought' instead of 'should').
|
Conformance terms (e.g,, "MUST" and "SHOULD") are specified in RFC 2119. Use them. When such terms are not in ALL CAPS, the special conformance sense does not apply (although it is preferable to use terms such as 'might' instead of 'may' and 'ought' instead of 'should').
|
@ -6,32 +6,38 @@
|
|||||||
- [BaseMessage](#basemessage)
|
- [BaseMessage](#basemessage)
|
||||||
|
|
||||||
## Transport
|
## Transport
|
||||||
|
|
||||||
For starting we simply use JSON + Websockets.
|
For starting we simply use JSON + Websockets.
|
||||||
|
|
||||||
## Entity ID
|
## Entity ID
|
||||||
* Room alias: `#<roomAlias>@<serverpart>`
|
|
||||||
* Username: `@<username>@<serverpart>`
|
- Room alias: `#<roomAlias>@<serverpart>`
|
||||||
* User ID with any 3PID: `%<type>:<data>@<serverpart>`
|
- Username: `@<username>@<serverpart>`
|
||||||
* Currently supported only following types: `email` and `msisdn`.
|
- User ID with any 3PID: `%<type>:<data>@<serverpart>`
|
||||||
* Raw User ID: `@<UUID>@<serverpart>`
|
- Currently supported only following types: `email` and `msisdn`.
|
||||||
* Message ID: `&<uuid>@<serverpart (from which server the message was sent)>`
|
- Raw User ID: `@<UUID>@<serverpart>`
|
||||||
* Room ID: `!<roomID>@<serverpart>`
|
- Message ID: `&<uuid>@<serverpart (from which server the message was sent)>`
|
||||||
* Single server-part: `<serverpart>`
|
- Room ID: `!<roomID>@<serverpart>`
|
||||||
|
- Single server-part: `<serverpart>`
|
||||||
|
|
||||||
**Server-part**:
|
**Server-part**:
|
||||||
|
|
||||||
- hostname: `IPv4 / [IPv6] / dns-domain:<port (1-65535)>` (for end-users use)
|
- hostname: `IPv4 / [IPv6] / dns-domain:<port (1-65535)>` (for end-users use)
|
||||||
- server ID: static SHA256 hash string from 4096 characters (for internal protocol use)
|
- server ID: static SHA256 hash string from 4096 characters (for internal protocol use)
|
||||||
|
|
||||||
**Username/Room alias/RoomID** - MUST NOT be empty, and MUST contain only the characters `a-z`, `0-9`, `.`, `_`, `=`, `-`, and `/`.
|
**Username/Room alias/RoomID** - MUST NOT be empty, and MUST contain only the characters `a-z`, `0-9`, `.`, `_`, `=`, `-`, and `/`.
|
||||||
|
|
||||||
**Special business rules**:
|
**Special business rules**:
|
||||||
|
|
||||||
- RoomID SHOULD be UUID identifier.
|
- RoomID SHOULD be UUID identifier.
|
||||||
- Servers MUST use server ID in internal purposes instead of normal server-part with hostname. Only end-users MUST use normal server-part with hostname. This is done for easy multi-domain serving.
|
- Servers MUST use server ID in internal purposes instead of normal server-part with hostname. Only end-users MUST use normal server-part with hostname. This is done for easy multi-domain serving.
|
||||||
|
|
||||||
## BaseMessage
|
## BaseMessage
|
||||||
|
|
||||||
BaseMessage is a basic message model, basis of the whole protocol. It is used for a very easy protocol extension process.
|
BaseMessage is a basic message model, basis of the whole protocol. It is used for a very easy protocol extension process.
|
||||||
|
|
||||||
BaseMessage scheme:
|
BaseMessage scheme:
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface BaseMessage {
|
interface BaseMessage {
|
||||||
/**
|
/**
|
||||||
@ -63,4 +69,4 @@ interface BaseMessage {
|
|||||||
*/
|
*/
|
||||||
payload: Map<K,V>
|
payload: Map<K,V>
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -1,13 +1,18 @@
|
|||||||
# Protocol Errors
|
# Protocol Errors
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
Mechanism of error processing included into protocol.
|
Mechanism of error processing included into protocol.
|
||||||
Adds into any response message `ok` variable. If `ok` is true - we have no errors, if `ok` is false - we have an error.
|
Adds into any response message `ok` variable. If `ok` is true - we have no errors, if `ok` is false - we have an error.
|
||||||
|
|
||||||
## Message type identifiers
|
## Message type identifiers
|
||||||
- `*:error`
|
|
||||||
|
None.
|
||||||
|
|
||||||
## Use cases
|
## Use cases
|
||||||
|
|
||||||
*Request*:
|
*Request*:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"id": "abcd",
|
"id": "abcd",
|
||||||
@ -21,6 +26,7 @@ Adds into any response message `ok` variable. If `ok` is true - we have no error
|
|||||||
```
|
```
|
||||||
|
|
||||||
*Response*:
|
*Response*:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"id": "abcd",
|
"id": "abcd",
|
||||||
@ -37,7 +43,8 @@ Adds into any response message `ok` variable. If `ok` is true - we have no error
|
|||||||
```
|
```
|
||||||
|
|
||||||
## JSON Schema
|
## JSON Schema
|
||||||
**Payload**
|
|
||||||
|
### Payload
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface ErrorPayload {
|
interface ErrorPayload {
|
||||||
@ -56,4 +63,4 @@ interface ErrorPayload {
|
|||||||
*/
|
*/
|
||||||
errPayload: Map<K,V>
|
errPayload: Map<K,V>
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user