-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from tyr-rust-bootcamp/feature/v10-11-load-chats
feature: improve chat api to make sure no security hole
- Loading branch information
Showing
6 changed files
with
111 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,18 +22,30 @@ Content-Type: application/json | |
"password": "123456" | ||
} | ||
|
||
### signin user (valid) | ||
### signup user | ||
|
||
POST http://localhost:6688/api/signin | ||
POST http://localhost:6688/api/signup | ||
Content-Type: application/json | ||
|
||
{ | ||
"email": "[email protected]", | ||
"workspace": "acme", | ||
"fullname": "Bob Hua", | ||
"email": "[email protected]", | ||
"password": "123456" | ||
} | ||
|
||
### signin user (invalid) | ||
|
||
POST http://localhost:6688/api/signin | ||
Content-Type: application/json | ||
|
||
{ | ||
"email": "[email protected]", | ||
"password": "a123456" | ||
} | ||
|
||
### signin user (valid) | ||
|
||
# @name signin | ||
POST http://localhost:6688/api/signin | ||
Content-Type: application/json | ||
|
@@ -45,17 +57,61 @@ Content-Type: application/json | |
|
||
@token = {{signin.response.body.token}} | ||
|
||
### signin user (valid) | ||
|
||
# @name signin1 | ||
POST http://localhost:6688/api/signin | ||
Content-Type: application/json | ||
|
||
{ | ||
"email": "[email protected]", | ||
"password": "123456" | ||
} | ||
|
||
@token1 = {{signin1.response.body.token}} | ||
|
||
### create chat | ||
POST http://localhost:6688/api/chats | ||
Content-Type: application/json | ||
Authorization: Bearer {{token}} | ||
|
||
{ | ||
"name": "acme", | ||
"name": "project X", | ||
"members": [1, 2], | ||
"public": false | ||
} | ||
|
||
### create direct chat | ||
POST http://localhost:6688/api/chats | ||
Content-Type: application/json | ||
Authorization: Bearer {{token}} | ||
|
||
{ | ||
"members": [1, 2], | ||
"public": false | ||
} | ||
|
||
### create chats without me | ||
POST http://localhost:6688/api/chats | ||
Content-Type: application/json | ||
Authorization: Bearer {{token1}} | ||
|
||
{ | ||
"name": "project Y", | ||
"members": [2, 3], | ||
"public": false | ||
} | ||
|
||
### create direct chat without me | ||
POST http://localhost:6688/api/chats | ||
Content-Type: application/json | ||
Authorization: Bearer {{token1}} | ||
|
||
{ | ||
"members": [2, 3], | ||
"public": false | ||
} | ||
|
||
|
||
### get chat list | ||
|
||
|