|
|
|
@ -22,6 +22,37 @@ API.v1.addRoute('e2e.getUsersOfRoomWithoutKey', { authRequired: true }, { |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @openapi |
|
|
|
|
* /api/v1/e2e.setRoomKeyID: |
|
|
|
|
* post: |
|
|
|
|
* description: Sets the end-to-end encryption key ID for a room |
|
|
|
|
* security: |
|
|
|
|
* - autenticated: {} |
|
|
|
|
* requestBody: |
|
|
|
|
* description: A tuple containing the room ID and the key ID |
|
|
|
|
* content: |
|
|
|
|
* application/json: |
|
|
|
|
* schema: |
|
|
|
|
* type: object |
|
|
|
|
* properties: |
|
|
|
|
* rid: |
|
|
|
|
* type: string |
|
|
|
|
* keyID: |
|
|
|
|
* type: string |
|
|
|
|
* responses: |
|
|
|
|
* 200: |
|
|
|
|
* content: |
|
|
|
|
* application/json: |
|
|
|
|
* schema: |
|
|
|
|
* $ref: '#/components/schemas/ApiSuccessV1' |
|
|
|
|
* default: |
|
|
|
|
* description: Unexpected error |
|
|
|
|
* content: |
|
|
|
|
* application/json: |
|
|
|
|
* schema: |
|
|
|
|
* $ref: '#/components/schemas/ApiFailureV1' |
|
|
|
|
*/ |
|
|
|
|
API.v1.addRoute('e2e.setRoomKeyID', { authRequired: true }, { |
|
|
|
|
post() { |
|
|
|
|
const { rid, keyID } = this.bodyParams; |
|
|
|
@ -34,6 +65,37 @@ API.v1.addRoute('e2e.setRoomKeyID', { authRequired: true }, { |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @openapi |
|
|
|
|
* /api/v1/e2e.setUserPublicAndPrivateKeys: |
|
|
|
|
* post: |
|
|
|
|
* description: Sets the end-to-end encryption keys for the authenticated user |
|
|
|
|
* security: |
|
|
|
|
* - autenticated: {} |
|
|
|
|
* requestBody: |
|
|
|
|
* description: A tuple containing the public and the private keys |
|
|
|
|
* content: |
|
|
|
|
* application/json: |
|
|
|
|
* schema: |
|
|
|
|
* type: object |
|
|
|
|
* properties: |
|
|
|
|
* public_key: |
|
|
|
|
* type: string |
|
|
|
|
* private_key: |
|
|
|
|
* type: string |
|
|
|
|
* responses: |
|
|
|
|
* 200: |
|
|
|
|
* content: |
|
|
|
|
* application/json: |
|
|
|
|
* schema: |
|
|
|
|
* $ref: '#/components/schemas/ApiSuccessV1' |
|
|
|
|
* default: |
|
|
|
|
* description: Unexpected error |
|
|
|
|
* content: |
|
|
|
|
* application/json: |
|
|
|
|
* schema: |
|
|
|
|
* $ref: '#/components/schemas/ApiFailureV1' |
|
|
|
|
*/ |
|
|
|
|
API.v1.addRoute('e2e.setUserPublicAndPrivateKeys', { authRequired: true }, { |
|
|
|
|
post() { |
|
|
|
|
const { public_key, private_key } = this.bodyParams; |
|
|
|
@ -49,6 +111,39 @@ API.v1.addRoute('e2e.setUserPublicAndPrivateKeys', { authRequired: true }, { |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @openapi |
|
|
|
|
* /api/v1/e2e.updateGroupKey: |
|
|
|
|
* post: |
|
|
|
|
* description: Updates the end-to-end encryption key for a user on a room |
|
|
|
|
* security: |
|
|
|
|
* - autenticated: {} |
|
|
|
|
* requestBody: |
|
|
|
|
* description: A tuple containing the user ID, the room ID, and the key |
|
|
|
|
* content: |
|
|
|
|
* application/json: |
|
|
|
|
* schema: |
|
|
|
|
* type: object |
|
|
|
|
* properties: |
|
|
|
|
* uid: |
|
|
|
|
* type: string |
|
|
|
|
* rid: |
|
|
|
|
* type: string |
|
|
|
|
* key: |
|
|
|
|
* type: string |
|
|
|
|
* responses: |
|
|
|
|
* 200: |
|
|
|
|
* content: |
|
|
|
|
* application/json: |
|
|
|
|
* schema: |
|
|
|
|
* $ref: '#/components/schemas/ApiSuccessV1' |
|
|
|
|
* default: |
|
|
|
|
* description: Unexpected error |
|
|
|
|
* content: |
|
|
|
|
* application/json: |
|
|
|
|
* schema: |
|
|
|
|
* $ref: '#/components/schemas/ApiFailureV1' |
|
|
|
|
*/ |
|
|
|
|
API.v1.addRoute('e2e.updateGroupKey', { authRequired: true }, { |
|
|
|
|
post() { |
|
|
|
|
const { uid, rid, key } = this.bodyParams; |
|
|
|
|