Skip to content

Validates potential new user names for a number of criteria

Notifications You must be signed in to change notification settings

getcarina/signup-validation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Signup Validation

Validates potential new user names for a number of criteria.

This provides a simple API can check whether a given username is available for use in Carina, and mark a username as having been used, to ensure future availability checks remain accurate.

Installation

$ docker-compose build
$ docker-compose up

The service consists of a Node.js container running node-restify and a Redis container.

API

GET /validate/:username

Returns status code 200 and no output if the provided username is valid.

Returns status code 409 if the provided username is invalid. Also includes JSON output with the reason for the failure.

{
  "status": "error",
  "message": "The provided username already exists."
}

POST /signup

Expects a JSON payload.

{
  "username": "[email protected]"
}

Also does all the same validation as GET /validate/:username.

Return status code 202 if the username was valid and successfully saved. This has no external effect other than marking the username as taken within this specific service.

Returns status code 409 if the provided username is invalid. Also includes JSON output with the reason for the failure.

{
  "status": "error",
  "message": "The provided username already exists."
}

About

Validates potential new user names for a number of criteria

Resources

Stars

Watchers

Forks

Packages

No packages published