Skip to content

Basic Users API including Authentication using Http4s v0.18 and Cats Effect v0.5

Notifications You must be signed in to change notification settings

gvolpe/users-api-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

users-api

Base User Actions

Sign Up:
  • POST /v1/signup
{
  "username": "gvolpe",
  "email": "gvolpe@github.com",
  "password": "123456" // optional
}
Retrieve all users:
  • GET /v1/users
Retrieve user by id:
  • GET /v1/users/{id}
Update user's email
  • PATCH /v1/users/{id}
{
  "email": "gvolpe@gmail.com"
}
Update user's password
  • PATCH /v1/users/{id}
{
  "password: "gvolpe@gmail.com"
}
Forgot Password
  • POST /v1/users/{id}/forgotpassword
Signin:
  • POST /v1/signin
{
  "username": "gvolpe",
  "password": "123456"
}

Admin User Actions

Requires Authentication (/v1/signin)

Retrieve all users (including Password and Metadata)
  • GET /v1/admin/users
Delete user by id:
  • DELETE /v1/admin/users/{id}
Block user by id:
  • POST /v1/admin/users/{id}/block
Unblock user by id:
  • POST /v1/admin/users/{id}/unblock

Notes

For the sake of simplicity in this example the user with username = "gvolpe" and password = "" will be the only one authenticated as an administrator. Any other user will not be authorized to perform requests that require authentication.

Start the server by executing sbt run. The server will be listening at http://localhost:8080.

About

Basic Users API including Authentication using Http4s v0.18 and Cats Effect v0.5

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages