Giter Site home page Giter Site logo

userize's Introduction

Userize

Build Status

This is a very BETA project to abstract the storage and authentication requirements for basic user features on an API. This is not a full service authentication module. This is designed for rapid prototyping and is inspired upon the features available in the backlift.com user authentication project.

Too many times I have needed a drop in restful API login feature. This project, which might be a duplicate of an existing project, is designed to be a micro module and boilerplate for basic features.

GET /api/login

This enables a public login route /api/login to setup a session.

curl -XPOST /api/register { 
  username: 'JoeBlow', 
  password: 'XXXXX'
}

GET /api/logout

This enables logout of a given user/session.

curl -XPOST /api/logout

POST /api/register

This enables a /api/register to setup a user account. The route can be configured to require an email authentication process or simply return a valid session.

curl -XPOST /api/register { 
  username: 'JoeBlow', 
  password: 'XXXXX', 
  name: 'Joe Blow',
  city: 'Bosotn'
  ...
}

GET /api/profile/:user - Retrieve a Profile

The allows a public and private user profile. Long term the configuration for the module will allow the user to configure the values returned by both.

curl -XGET /api/profile/JoeBlow

PUT /api/profile/:user - Update a Profile

This allows a logged in user to submit changes to their profile.

curl -XPUT /api/profile/JoeBlow { 
  username: 'JoeBlow', 
  password: 'XXXXX', 
  name: 'Joe Blow',
  city: 'Boston',
}

Storage Options

The module will support several storage options. Since this is designed to be boilerplate, we want this module to flexible in the storage location for user information.

Usage

The following are pending configuration options.

var options = {
  storage: { 
    type: 'couch', 
    auth: { ... } 
  },
  enabled: [ 
    'login', 
    'register',
    'profile public', 
    'profile private', 
    'profile update',
    or 'all'
  ]
};

var userize = require('userize')( options );

Configuration

The following are pending configuration options.

  • Change the express routes as needed.
  • Define the data fields to return for public and private profile requests.
  • Define storage options in the server setup.

Installation

This module is not ready for npm. Once it completed and submitted, it will installable using. npm install userize

userize's People

Stargazers

A Gurha avatar Stephan L. Smith avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.