Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

life_star-auth

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

life_star-auth

Authentication and authorization for Lively Web servers

  • 0.1.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
2
Weekly downloads
 
Created
Source

life_star-auth Build Status

Authentication and authorization for Lively Web servers.

Usage

LivelyKernel/core/lively/localconfig.js

lively.Config.userAuthEnabled = true;
lively.Config.usersFile = "user-db.json";
lively.Config.authRequireLogin = false;

LivelyKernel/user-db.json`

{
  "users": [{"name": "test-user", "email": "", "password": "xxx"}],
  "accessRules": [
    "function(userDB, user, req, callback) { if (user && user.name === 'test-user') callback(null, 'allow'); else callback(null, req.method === 'PUT' ? 'deny' : 'allow'); }"
  ]
}

user-db.json can be modified while the server is running, it will be automatically updated.

accessRules can be functions returning 'allow', 'deny' or a falsy value (undecided) via the callback. If request is denied a 403 response is send.

user objects can have the fields:

  • name : String
  • email : String
  • password : String (optional, will be replaced with a password hash once the server starts! No passwords are stored.)
  • custom fields, whatever makes sense for applications. E.g. a field groups (Array) is used in Lively apps to create rules for several users at once.

User objects are automatically created when a user registers but can be added and modified by changing user-db.json.

License

MIT License

FAQs

Package last updated on 12 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc