- Rate limiting (1 call/minute)
- JWT Token
- Configuration Based
- install goose
- Run Migration by running
cd config/migration && goose postgres "user={postgre_username} password={postgre_password} dbname=simplejwt sslmode=disable" up - Run
make buildto build the app - Run
./build/user
- Create a user
curl -X POST \
http://localhost:8796/1.0/user \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{
"username": "{username}",
"password": "{password}"
}'it will return response
{
"data": {
"username": "{username}"
},
"meta": {
"now": 1552844417203127000,
"requestId": "f93df545-06b7-4723-a94a-efc895c4d86e"
}
}- Signin a user
curl -X POST \
http://localhost:8796/1.0/user/signin \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{
"username": "{username}",
"password": "{password}"
}'it will return response something like below
{
"data": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InBhaWpvMSIsImV4cCI6MTU1NDA1NDE2OSwiaXNzIjoiRmFpc2FsIFJhaG1hbiJ9.coegp2JyAGRnzBYsmehn1mCkCr2alZMUWpyiNKD0Lvk"
},
"meta": {
"now": 1552844569804990000,
"requestId": "a8b34098-77b9-4be4-9651-1852a76c8de3"
}
}