Skip to content

A JWT Secured REST interface to a user manager written in Go

Notifications You must be signed in to change notification settings

rmccomb/go_userapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go_userapi

A JWT secured REST interface to a basic user manager written in Go as a programming challenge.

Methods available are:

HTTP Method Description
GET /status Check the seb server status
POST /signin A valid username(email) & password should be provided in the request body in JSON. e.g. {"email":"rob@rm.com","password":"abc123"} The method returns a JWT token which is used to authenticate other methods.
GET /validatetoken Validate the given JWT token (in the request header) and return OK on success
GET /users Get all users in the backend store
GET /user/{email} Get a specific user
PUT /user Add (register) a new user to the store (non secured)
POST /user Update an existing user in the store (admin only)
DELETE /user/{email} Delete a specific user in the store (admin only)

The back end store is an in-memory cache for simplicity.

Configuration is in the config.yaml file. The configurable elements are:

AdminEmail and AdminPassword define the admin user.

JWTSigningKey is a string used to sign the token

A front-end is available in another repository as a .NET Core MVC application, see UserManagerFrontEnd.

About

A JWT Secured REST interface to a user manager written in Go

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages