Skip to content

shovanmaity/grpc-task

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grpc-task

Clone the repo

git clone --recurse-submodules --remote-submodules https://github.com/shovanmaity/grpc-task.git
cd grpc-task

Run the app

make run

Get profile without auth header

curl http://0.0.0.0:8090/api/v1/shovan/profile
{"code":16,"message":"authorization token not found","details":[]}

Update profile without auth header

curl -X PUT http://0.0.0.0:8090/api/v1/shovan/profile -d '{"name":"Shovan Maity", "email":"shovan.cse91+1@gmail.com"}'
{"code":16,"message":"authorization token not found","details":[]}

Registration

curl -X POST http://localhost:8090/api/v1/registration -d '{"username":"shovan", "password":"shovan"}'
{"jwt":"JWT_TOKEN"}

Login

curl -X POST http://localhost:8090/api/v1/login -d '{"username":"shovan", "password":"shovan"}'
{"jwt":"JWT_TOKEN"}

Get profile

curl http://0.0.0.0:8090/api/v1/shovan/profile -H "authorization: Token ${JWT_TOKEN}"
{"username":"shovan", "name":"", "email":""}

Update profile

curl -X PUT http://0.0.0.0:8090/api/v1/shovan/profile -H "Authorization: Token ${JWT_TOKEN}" -d '{"name":"Shovan Maity", "email":"shovan.cse91@gmail.com"}'

Get profile after update

curl http://0.0.0.0:8090/api/v1/shovan/profile -H "Authorization: Token ${JWT_TOKEN}"
{"username":"shovan", "name":"Shovan Maity", "email":"shovan.cse91@gmail.com"}

Logout

curl -X DELETE http://localhost:8090/api/v1/logout -H "authorization: Token ${JWT_TOKEN}"

Get profile after logout

curl http://0.0.0.0:8090/api/v1/shovan/profile -H "Authorization: Token ${JWT_TOKEN}"
{"code":16, "message":"invalid session", "details":[]}

Update profile after logout

curl -X PUT http://0.0.0.0:8090/api/v1/shovan/profile -H "Authorization: Token ${JWT_TOKEN}" -d '{"name":"Shovan Maity", "email":"shovan.cse91+1@gmail.com"}'
{"code":16, "message":"invalid session", "details":[]}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published