Socket
Socket
Sign inDemoInstall

deep-app

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    deep-app

isomorphic app management tools for deepjs


Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Install size
65.9 kB
Created
Weekly downloads
 

Readme

Source

deep-app

Proposition for isomorphic app management (login/logout/impersonate/session/...) management through deep.context and deep.Modes/deep.modes usage.

Login Sequence

The login sequence is expressed both sides (client or server or shell) with same rules pattern (mainly with two customs functions : loggedIn and sessionModes), and consist in :

login({ /* email/password */ }) or impersonate({ id:... })
==> check validity server side - do a remote call client side) 
	==> if valid : place logged user in session 
		==> call loggedIn(session)
			decorate/manipulate session (do differents things client or server side)
	==> call sessionModes(session)
		define current OCM modes accordingly to current session (global modes client side - context's modes server side).

Login familly chained API and "app" config object

Usage example with OCM restful stores (valid browser, server or shell side) :

deep.app().login({ email:"toto@doe.com", password:"something" }) // login as and so endorse toto@doe.com privileges
.restful("myStore")
.get() // get-all with toto@doe.com privileges
.done(function(objects){
	//...
})
.impersonate({ id:"an_id" }) // as a login with email + password 
.resftul("myOtherStore")
.post() // post something as user with id = an_id
.session({ /*...*/ }) // endorse privileges dependending on session
.restful("myThirdStore")
.put("hello world", "e123/title")  // update an object with provided session's rights
.log();

Really usefull for manipulating objects, testing or debugging by endorseing a particular identity.

Both, single-context and concurrent-contexts "chained login" API, use (almost) the same config pattern.

You would use "single-context login chained API" from within your single page application. Keep in mind than browser side, you are in a single window environnement. So, here, login/logout/session/impersonate manages deep.Modes (aka global modes) and the current deep.context (normally the unique one) and so really modify your application login state.

Shell or server side, you would use concurrent context login chained API to manage concurrent requests or processes with contextualised (through deep.context and deep.modes) promise chains.

Server and shell side

Here, as you should manage concurrents requests/processes with differents login modes, each time you use a login familly tools, you start a new contextualised (with a new context) promise chain which hold for

Licence

LGPL 3.0

Keywords

FAQs

Last updated on 15 May 2015

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc