
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
futoin-invoker
Advanced tools
FutoIn Invoker - Reference Implementation. Transparently and efficiently invoke remote or local service methods with strict API definition
This project is in active development and is not feature-complete yet, but is already mature enough. The documentation of this specific implementation is not complete either.
Reference implementation of:
FTN7: FutoIn Invoker Concept
Version: 1.3
FTN3: FutoIn Interface Definition
Version: 1.1
Spec FTN7: FTN7: Interface Invoker Concept v1.x Spec FTN3: FTN3: FutoIn Interface Definition v1.x
FutoIn Invoker is a peer which initiates a request - invokes a FutoIn interface method as described in FTN3: FutoIn Interface Definition. It is not necessary a client - e.g. server may initiate request for event delivery to client.
The method can be implemented locally or remotely - it is transparent to invoking code. A similar concept can be found in CORBA and other more heavy request brokers.
Strict FutoIn interface (iface) definition and transport protocol is defined in FTN3 spec mentioned above. As it is based on JSON, both client and server can be implemented in a few minutes almost in any technology. However, Invoker and Executor concept provide significant benefits for efficiency, reliability and error control.
The core of invoker is CCM - Connection and Credentials Manager. It has the following advantages:
The primary communication channel is WebSockets. Large raw data upload and download is also supported through automatic fallback to HTTP(S).
SimpleCCM - a light version without heavy processing of iface definition (ideal for browser) AdvancedCCM - full featured CCM (extends SimpleCCM)
Communication methods:
Note: Invoker and Executor are platform/technology-neutral concepts. The implementation is already available in JS and PHP. Hopefully, others are upcoming
Command line:
$ npm install futoin-invoker --save
$ bower install futoin-invoker --save
Please note that browser build is available under in dist/ folder in sources generated with pure-sjc. It depends on lodash.
Note: there are the following globals available:
TODO
The concept is described in FutoIn specification: FTN7: Interface Invoker Concept v1.x
#Index
Modules
Classes
Members
##class: futoin-invoker.SimpleCCM Members
###new futoin-invoker.SimpleCCM([options]) Simple CCM - Reference Implementation
Params
object
- map of OPT_* named variables##class: futoin-invoker.AdvancedCCM Members
###new futoin-invoker.AdvancedCCM() Advanced CCM - Reference Implementation
##class: futoin-invoker.FutoInError Members
###new futoin-invoker.FutoInError() Easy access of futoin-asyncsteps.FutoInError errors, which may be extended in the future
##class: futoin-invoker.NativeIface Members
###new futoin-invoker.NativeIface() Useful base for custom implementation of NativeIface
##class: futoin-invoker.InterfaceInfo Members
###new futoin-invoker.InterfaceInfo() NativeInterface.ifaceInfo() class for custom implementations of NativeIface
##new InterfaceInfo() FutoIn interface info
##interfaceInfo.name() Get FutoIn interface type
Returns: string
##interfaceInfo.version()
Get FutoIn interface version
Returns: string
##interfaceInfo.inherits()
Get list of inherited interfaces starting from the most derived, may be null
Returns: object
##interfaceInfo.funcs()
Get list of available functions, may be null
Returns: object
##interfaceInfo.constraints()
Get list of interface constraints, may be null
Returns: object
#class: NativeIface
Members
##new NativeIface() Native Interface for FutoIn ifaces
##nativeIface.call(as, name, params, upload_data, [download_stream], [timeout]) Generic FutoIn function call interface Result is passed through AsyncSteps.success() as a map.
Params
AsyncSteps
- AsyncSteps objectstring
- FutoIn iface function nameobject
- map of func parametersstring
| stream.Readable
- raw upload data or input stramstream.Writable
- output stream for raw download dataint
- if provided, overrides the default. <=0 - disables timeout##nativeIface.ifaceInfo() Get interface info
Returns: object
##nativeIface.burst()
Returns extended API interface as defined in [FTN10 Burst Calls][]
Returns: object
##nativeIface.bindDerivedKey()
Results with DerivedKeyAccessor through as.success()
##spectools.loadIface(as, info, specdirs) Load FutoIn iface definition.
NOTE: Browser uses XHR to load specs, Node.js searches in local fs.
Params
AsyncSteps
Object
- destination object with "iface" and "version" fields already setArray
- each element - search path/url (string) or raw iface (object)##spectools.parseIface(as, info, specdirs, raw_spec) Parse raw futoin spec (preloaded)
Params
AsyncSteps
Object
- destination object with "iface" and "version" fields already setArray
- each element - search path/url (string) or raw iface (object)Object
- iface definition object##spectools.checkConsistency(as, info) Deeply check consistency of loaded interface.
NOTE: not yet implemented
Params
AsyncSteps
Object
- previously loaded iface##spectools.checkType(info, type, val) Check if value matches required type
Params
Object
- previously loaded ifacestring
- standard or custom iface type*
- value to checkReturns: Boolean
##spectools.checkParameterType(as, info, funcname, varname, value)
Check if parameter value matches required type
Params
AsyncSteps
Object
- previously loaded ifacestring
- function namestring
- parameter name*
- value to check##spectools.checkResultType(as, info, funcname, varname, value) Check if result value matches required type
Params
AsyncSteps
Object
- previously loaded ifacestring
- function namestring
- result variable name*
- value to check##const: spectools.standard_errors Enumeration of standard errors
#SimpleCCM window.SimpleCCM - Browser-only reference to futoin-asyncsteps.SimpleCCM
#AdvancedCCM window.AdvancedCCM - Browser-only reference to futoin-asyncsteps.AdvancedCCM
#Invoker futoin.Invoker - Browser-only reference to futoin-invoker module
#FutoInInvoker window.FutoInInvoker - Browser-only reference to futoin-invoker module
documented by jsdoc-to-markdown.
FAQs
Transparently, efficiently and securely invoke remote or local service methods with strict API definition for Node and Browser
The npm package futoin-invoker receives a total of 2 weekly downloads. As such, futoin-invoker popularity was classified as not popular.
We found that futoin-invoker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.