mirror of
https://github.com/cadmium-im/cadmium-docs-legacy.git
synced 2024-11-21 18:02:24 +00:00
Update
This commit is contained in:
parent
ddef4e794b
commit
7474e63fd3
@ -89,7 +89,7 @@ interface LoginRequestPayload {
|
||||
```typescript
|
||||
interface LoginResponsePayload {
|
||||
/**
|
||||
* Authentication token which required for various user actions (UUID)
|
||||
* Authentication token which required for various user actions (static SHA256 hash string from 4096 random characters)
|
||||
*/
|
||||
authToken: string,
|
||||
|
||||
@ -99,4 +99,4 @@ interface LoginResponsePayload {
|
||||
*/
|
||||
deviceID: string
|
||||
}
|
||||
```
|
||||
```
|
||||
|
@ -16,7 +16,7 @@ This extension is intended for creating user accounts on a server
|
||||
|
||||
## Use cases
|
||||
|
||||
### Basic registration flow (with CAPTCHA)
|
||||
### Basic registration flow
|
||||
|
||||
- Client:
|
||||
|
||||
@ -80,7 +80,7 @@ interface RegistrationRequestPayload {
|
||||
/**
|
||||
* The username that the user wants to register
|
||||
*/
|
||||
username: string,
|
||||
username?: string,
|
||||
|
||||
/**
|
||||
* Array of user third party IDs (email and/or MSISDN)
|
||||
@ -90,7 +90,12 @@ interface RegistrationRequestPayload {
|
||||
/**
|
||||
* Password of new account
|
||||
*/
|
||||
password: string
|
||||
password: string,
|
||||
|
||||
/**
|
||||
* Login to freshly created user account when registration will be completed
|
||||
*/
|
||||
loginOnSuccess: boolean
|
||||
}
|
||||
|
||||
interface ThirdPartyID {
|
||||
@ -113,6 +118,11 @@ interface RegistrationResponsePayload {
|
||||
/**
|
||||
* ID of user (Username in priority. If we haven't username, then we put to this field one of user's third party IDs)
|
||||
*/
|
||||
userID: EntityID
|
||||
userID: EntityID,
|
||||
|
||||
/**
|
||||
* Property with login payload (can be omit if property loginOnSuccess wasn't indicated true in RegistrationRequestPayload)
|
||||
*/
|
||||
loginPayload?: LoginResponsePayload
|
||||
}
|
||||
```
|
||||
|
@ -3,6 +3,9 @@
|
||||
- [Protocol Core](#protocol-core)
|
||||
- [Transport](#transport)
|
||||
- [Entity ID](#entity-id)
|
||||
- [Server-part](#server-part)
|
||||
- [Username/Room alias/RoomID](#usernameroom-aliasroomid)
|
||||
- [Special business rules](#special-business-rules)
|
||||
- [BaseMessage](#basemessage)
|
||||
|
||||
## Transport
|
||||
@ -16,18 +19,20 @@ For starting we simply use JSON + Websockets.
|
||||
- User ID with any 3PID: `%<type>:<data>@<serverpart>`
|
||||
- Currently supported only following types: `email` and `msisdn`.
|
||||
- Raw User ID: `@<UUID>@<serverpart>`
|
||||
- Message ID: `&<uuid>@<serverpart (from which server the message was sent)>`
|
||||
- Message ID: `&<uuid>@<serverpart (of source server)>`
|
||||
- Room ID: `!<roomID>@<serverpart>`
|
||||
- Single server-part: `<serverpart>`
|
||||
|
||||
**Server-part**:
|
||||
### Server-part
|
||||
|
||||
- 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
|
||||
|
||||
**Special business rules**:
|
||||
MUST NOT be empty, and MUST contain only the characters `a-z`, `0-9`, `.`, `_`, `=`, `-`, and `/`.
|
||||
|
||||
### Special business rules
|
||||
|
||||
- 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.
|
||||
@ -60,10 +65,15 @@ interface BaseMessage {
|
||||
to: EntityID,
|
||||
|
||||
/**
|
||||
* Operation success indicator (used to determine if the error happened while processing request)
|
||||
* Operation success indicator (used to determine if the error happened while processing request) - MUST be only in response from server
|
||||
*/
|
||||
ok: boolean,
|
||||
|
||||
/**
|
||||
* Authentication token string (can be omit if the action does not require user authentication) - MUST be only in request messages from client
|
||||
*/
|
||||
authToken?: string,
|
||||
|
||||
/**
|
||||
* Message payload (used to store extra information in message, list of permissible fields in the payload depends on "type" field)
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user