
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
futoin-executor
Advanced tools
Documentation --> FutoIn Guide
FutoIn Executor is a peer which processes a request - handles a FutoIn interface method as described in FTN3: FutoIn Interface Definition. It is not necessary a server - e.g. client may handle callback request from server.
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.
Executor class is the core which encapsulate pure FutoIn Executor logic. It can be extended to platform-specific implementation (e.g. Browser or Node)
The primary communication channel is WebSockets and HTTP as secondary. Large raw data upload and download is also supported through HTTP(S) only.
Executor - neutral Executor concept logic NodeExecutor - available only if used in Node.js
Note: Invoker and Executor are platform/technology-neutral concepts. The implementation is already available in JS and PHP. Hopefully, others are upcoming
Reference implementation of:
FTN6: FutoIn Executor Concept
Version: 1.7
FTN3: FutoIn Interface Definition
Version: 1.9
FTN5: FutoIn HTTP integration
Version: 1.3
FTN4: FutoIn Interface - Ping-Pong
Version: 1.0 (service)
Author: Andrey Galkin
Command line:
$ npm install futoin-executor --save
or
$ yarn add futoin-executor
Hint: checkout FutoIn CID for all tools setup.
All public classes can be accessed through module:
var Executor = require('futoin-executor').Executor;
or included modular way, e.g.:
var Executor = require('futoin-executor/Executor');
Pre-built ES5 CJS modules are available under es5/. These modules
can be used with webpack without transpiler - default "browser" entry point
points to ES5 version.
Webpack dists are also available under dist/ folder, but their usage should be limited
to sites without build process.
Warning: check AsyncSteps and AsyncEvent polyfill for older browsers.
The following globals are available:
The best examples are live projects:
Please note that the examples here expect interface definition files listed below. All sources are available under examples/ folder.
var AdvancedCCM = require( 'futoin-invoker/AdvancedCCM' );
var NodeExecutor = require( 'futoin-executor/NodeExecutor' );
var async_steps = require( 'futoin-asyncsteps' );
// Initialize CCM
var ccm = new AdvancedCCM( { specDirs : __dirname } );
// Initialize Node.js Executor implementation
var executor = new NodeExecutor(
ccm,
{
specDirs : __dirname,
httpAddr : 'localhost',
httpPort : 3000,
httpPath : '/api/'
}
);
executor.on( 'notExpected', function( err, error_info ){
console.log( 'Server: ' + err + ': ' + error_info );
} );
// Normally, you would want to define one in separate module
var service_impl = {
getProgress : function( as, reqinfo )
{
var p = reqinfo.params();
if ( reqinfo.params().resource === 'MyResource' )
{
as.success( { progress : 75 } )
}
else
{
as.error( 'InvalidResource' );
}
},
subscribeProgress : function( as, reqinfo )
{
var p = reqinfo.params();
if ( reqinfo.params().resource !== 'MyResource' )
{
as.error( 'InvalidResource' );
}
var channel = reqinfo.channel();
channel.register( as, 'org.example.receiver:1.0' );
as.add( function( as )
{
var iface = channel.iface( 'org.example.receiver:1.0' );
reqinfo.result().ok = true;
// Stupid simple scheduling of events to be sent
//---
var add_progress = function( progress, delay )
{
setTimeout( function(){
async_steps().add( function( as ){
iface.progressEvent( as, 'MyResource', progress );
} )
.execute();
}, delay );
};
for ( var i = 0; i <= 10; ++i )
{
add_progress( i * 10, i * 100 );
}
//---
} );
}
};
// Register Service implementation
async_steps()
.add(
function( as )
{
executor.register( as, 'org.example.service:1.0', service_impl );
},
function( as, err )
{
console.log( err + ': ' + as.state.error_info );
console.log( as.state.last_exception.stack );
}
)
.execute();
var async_steps = require( 'futoin-asyncsteps' );
var AdvancedCCM = require( 'futoin-invoker/AdvancedCCM' );
var ccm = new AdvancedCCM( { specDirs : [ __dirname ] } );
async_steps()
// Do it once for program's entire life time
.add(
function( as )
{
// Register interface and endpoint
ccm.register( as, 'myservice',
'org.example.service:1.0',
'http://localhost:3000/api/' );
},
function( as, err )
{
console.log( err + ': ' + as.state.error_info );
console.log( as.state.last_exception.stack );
}
)
// Regular service call
.add(
function( as )
{
var myservice = ccm.iface( 'myservice' );
// equal to myservice.call( as, 'getProgress', { progress: 'MyResource' } );
myservice.getProgress( as, 'MyResource' );
as.add( function( as, res ){
// Use result
console.log( 'Progress: ' + res.progress );
} );
},
function( as, err )
{
// Handle error
console.log( err + ': ' + as.state.error_info );
}
)
.execute();
var async_steps = require( 'futoin-asyncsteps' );
var AdvancedCCM = require( 'futoin-invoker/AdvancedCCM' );
var Executor = require( 'futoin-executor/Executor' );
var opts = { specDirs : __dirname };
var ccm = new AdvancedCCM( opts );
var client_executor = new Executor( ccm, opts );
async_steps()
// Do it once for program's entire life time
.add(
function( as )
{
// Register interface and endpoint
ccm.register(
as,
'myservice',
'org.example.service:1.0',
'ws://localhost:3000/api/',
null,
{
executor : client_executor
}
);
// Register client-side Executor Service
client_executor.register(
as,
'org.example.receiver:1.0',
{
progressEvent: function( as, reqinfo )
{
var progress = reqinfo.params().progress;
console.log( 'Progress: ' + progress );
if ( progress >= 100 )
{
ccm.close();
}
}
}
);
// Subscribe for events
as.add( function( as )
{
// Note: it is a sub-step as we need to wait for
// registration to complete
var myservice = ccm.iface( 'myservice' );
// equal to myservice.call( as, 'subscribeProgress',
// { progress: 'MyResource' } );
myservice.subscribeProgress( as, 'MyResource' );
} );
},
function( as, err )
{
console.log( err + ': ' + as.state.error_info );
console.log( as.state.last_exception.stack );
}
)
.execute();
Starting Example Server
Starting Example Client
Progress: 75
Starting Example Client with Callback
Progress: 0
Progress: 10
Progress: 20
Progress: 30
Progress: 40
Progress: 50
Progress: 60
Progress: 70
Progress: 80
Progress: 90
Progress: 100
Please see FTN3: FutoIn Interface Definition v1.x for all advanced features.
This one is only used to share Type definitions. It does not participate in inheritance
{
"iface" : "org.example.types",
"version" : "1.0",
"ftn3rev" : "1.1",
"types" : {
"Percent" : {
"type" : "integer",
"min" : 0,
"max" : 100
}
},
"desc" : "Shared interface to define common types"
}
Actual Server-side Service definition
{
"iface" : "org.example.service",
"version" : "1.0",
"ftn3rev" : "1.1",
"imports" : [
"org.example.types:1.0"
],
"funcs" : {
"getProgress" : {
"params" : {
"resource" : {
"type" : "string"
}
},
"result" : {
"progress" : {
"type" : "Percent"
}
},
"throws" : [
"InvalidResource"
]
},
"subscribeProgress" : {
"params" : {
"resource" : {
"type" : "string"
}
},
"result" : {
"ok" : {
"type" : "boolean"
}
},
"throws" : [
"InvalidResource"
]
}
},
"requires" : [
"AllowAnonymous"
],
"desc" : "Service-side Service"
}
Client-side Service for bi-directional transport channels, like WebSockets.
{
"iface" : "org.example.receiver",
"version" : "1.0",
"ftn3rev" : "1.1",
"imports" : [
"org.example.types:1.0"
],
"funcs" : {
"progressEvent" : {
"params" : {
"resource" : {
"type" : "string"
},
"progress" : {
"type" : "Percent"
}
},
"desc" : "Progress receiving event callback"
}
},
"requires" : [
"AllowAnonymous"
],
"desc" : "Client-side Service"
}
The concept is described in FutoIn specification: FTN6: Interface Executor Concept v1.x
BasicAuth is not official spec - it is a temporary solution until FTN8 Security Concept is finalized
BasicService is not official spec - it is a temporary solution until FTN8 Security Concept is finalized
ExecutorOptionsBrowser Executor with HTML5 Web Messaging as incoming transport.
It allows communication across open pages (frames/tabs/windows) inside client browser.
Channel Context normally accessible through RequestInfo object.
Derived Key interface for planned FTN8 Master key management.
A dummy so far.
An abstract core implementing pure FTN6 Executor logic.
This functionality is provided to provide historical not standard BasicAuth interface. Use of this approach is discouraged.
ExecutorOptionsExecutor implementation for Node.js/io.js with HTTP and WebSockets transport
Implementation of futoin.ping & futoin.anonping interface
Designed to be used as imported part of larger interfaces.
RequestInfo object as defined in FTN6
Generic security provider interface
Source Address representation
Class representing user information
window.FutoInExecutor - Browser-only reference to futoin-executor
window.futoin.Executor - Browser-only reference to futoin-executor
window.BrowserExecutor - Browser-only reference to futoin-executor.BrowserExecutor
Pseudo-class for documenting UserInfo detail fields as defined in FTN8 spec
BasicAuth is not official spec - it is a temporary solution until FTN8 Security Concept is finalized
BasicAuth interface registration helper
Kind: static method of BasicAuthFace
| Param | Type | Default | Description |
|---|---|---|---|
| as | AsyncSteps | step interface | |
| ccm | AdvancedCCM | CCM instance | |
| endpoint | string | endpoint URL | |
| [credentials] | * | | see CCM register() |
| [options] | object | {} | registration options |
| [options.version] | string | "1.0" | iface version |
BasicService is not official spec - it is a temporary solution until FTN8 Security Concept is finalized
Kind: global class
Register users statically right after registration
Kind: instance method of BasicAuthService
| Param | Type | Description |
|---|---|---|
| user | string | user name |
| secret | string | user secret (either password or raw key for HMAC) |
| details | object | user details the way as defined in FTN8 |
| [system_user] | boolean | is system user |
Get by name. Override, if needed.
Kind: instance method of BasicAuthService
Note: as result: {object} user object or null (through as)
| Param | Type | Description |
|---|---|---|
| as | AsyncSteps | steps interface |
| user | string | user name |
Get by ID. Override, if needed.
Kind: instance method of BasicAuthService
Note: as result: {object} user object or null (through as)
| Param | Type | Description |
|---|---|---|
| as | AsyncSteps | steps interfaces |
| local_id | number | local ID |
Register users statically right after registration
Kind: instance method of BasicAuthService
| Param | Type | Default | Description |
|---|---|---|---|
| user | string | user name | |
| secret | string | user secret (either password or raw key for HMAC) | |
| details | object | user details the way as defined in FTN8 | |
| [system_user] | boolean | false | is system user |
BasicAuthServiceBasicAuthService registration helper
Kind: static method of BasicAuthService
Returns: BasicAuthService - reference to implementation instance (to register users)
| Param | Type | Description |
|---|---|---|
| as | AsyncSteps | steps interface |
| executor | Executor | executor instance |
ExecutorOptionsKind: global class
Extends: ExecutorOptions
Pseudo-class for BrowserExecutor options documentation
Client timeout MS
Kind: static property of BrowserExecutorOptions
Default: 600
List of allowed page origins for incoming connections. It is MANDATORY for security reasons.
Example:
Kind: static property of BrowserExecutorOptions
Default: []
Browser Executor with HTML5 Web Messaging as incoming transport.
It allows communication across open pages (frames/tabs/windows) inside client browser.
| Param | Type | Description |
|---|---|---|
| ccm | AdvancedCCM | CCM ref |
| opts | BrowserExecutorOptions | executor options |
Channel Context normally accessible through RequestInfo object.
Kind: global class
stringBooleanNativeIface| Param | Type | Description |
|---|---|---|
| executor | Executor | reference to associated executor |
stringGet type of channel
Standard values: HTTP, WS, BROWSER, TCP, UDP, UNIX
Kind: instance abstract method of ChannelContext
Returns: string - arbitrary string, see FTN6
BooleanCheck if transport is stateful (e.g. WebSockets)
Kind: instance method of ChannelContext
Returns: Boolean - true, if context object is persistent across
requests in the same session
Set invoker abort handler.
Kind: instance method of ChannelContext
Note: It should be possible to call multiple times setting
multiple callbacks.
Note: The callback is set for lifetime of the channel - do not use it on every
request!
| Param | Type | Description |
|---|---|---|
| callable | function | callback |
| [user_data] | any | optional parameter to pass to callable |
Register Invoker interface on bi-directional channels to make calls from Server to Client.
Kind: instance method of ChannelContext
See: AdvancedCCM.register
| Param | Type | Description |
|---|---|---|
| as | AsyncSteps | steps interface |
| ifacever | string | standard iface:version notation |
| options | object | standard Invoker options |
NativeIfaceGet previously registered interface on bi-directional channel.
NOTE: unlike CCM, there is no point for local alias name as Invoker can have only a single ClientExecutor which can have only a single instance implementing specified iface:version.
Kind: instance method of ChannelContext
Returns: NativeIface - - native interface
See: AdvancedCCM.iface
| Param | Type | Description |
|---|---|---|
| ifacever | string | standard iface:version notation |
Derived Key interface for planned FTN8 Master key management.
A dummy so far.
Kind: global class
integerintegerBufferBuffer| Param | Type | Description |
|---|---|---|
| ccm | AdvancedCCM | reference to CCM |
| base_id | integer | master key ID |
| sequence_id | integer | sequence number of the derived key |
integerGet master key ID
Kind: instance method of DerivedKey
Returns: integer - Base ID
integerGet derived key sequence ID
Kind: instance method of DerivedKey
Returns: integer - Sequence ID
BufferEncrypt data with current derived key. Useful for very senstive information.
Kind: instance method of DerivedKey
Returns: Buffer - encrypted data
| Param | Type | Description |
|---|---|---|
| as | AsyncSteps | steps interface |
| data | string | Buffer | to encrypt |
BufferDecrypt data using current derived key
Kind: instance method of DerivedKey
Returns: Buffer - decrypted data
| Param | Type | Description |
|---|---|---|
| as | AsyncSteps | steps interface |
| data | Buffer | to decrypt |
Kind: global class
Pseudo-class for Executor options documentation
Search dirs for spec definition or spec instance directly. It can be single value or array of values. Each value is either path/URL (string) or iface spec instance (object).
Kind: static property of ExecutorOptions
Default: []
Production mode - disables some checks without compomising security
Kind: static property of ExecutorOptions
Default: false
Default request processing timeout
Kind: static property of ExecutorOptions
Default: 5000
Default request processing timeout for functions marked "heavy". See FTN3
Kind: static property of ExecutorOptions
Default: 60000
FTN8 security interface
Kind: static property of ExecutorOptions
Message sniffer callback( iface_info, msg, is_incomming ). Useful for audit logging.
Kind: static method of ExecutorOptions
Default: dummy
An abstract core implementing pure FTN6 Executor logic.
Kind: global class
AdvancedCCMstring| Param | Type | Description |
|---|---|---|
| ccm | AdvancedCCM | instance of AdvancedCCM |
| opts | objects | see ExecutorOptions |
AdvancedCCMGet reference to associated AdvancedCCM instance
Kind: instance method of Executor
Returns: AdvancedCCM - CCM ref
Register implementation of specific interface
Kind: instance method of Executor
| Param | Type | Description |
|---|---|---|
| as | AsyncSteps | steps interface |
| ifacever | string | standard iface:version notation of interface to be implemented. |
| impl | object | function | either iface implementation or func( impl, executor ) |
| specdirs | object | array | NOT STANDARD. Useful for direct passing of hardcoded spec definition. |
Entry point for Server-originated requests when acting as ClientExecutor
Kind: instance method of Executor
Emits: notExpected, request, response
| Param | Type | Description |
|---|---|---|
| info | object | raw Invoker interface info |
| ftnreq | object | FutoIn request object |
| send_executor_rsp | function | callback( ftnrsp ) |
Entry point for in-program originated requests. Process with maximum efficiency (not yet ;)
Kind: instance method of Executor
Emits: notExpected, request, response
Note: AS result: ftnrsp, content-type
| Param | Type | Description |
|---|---|---|
| as | AsyncSteps | steps interface |
| info | object | raw Invoker interface info |
| ftnreq | object | FutoIn request object |
| [upload_data] | object | upload stream, if any |
| [download_stream] | object | download stream, if any |
Standard entry point used by subclasses. Do full cycle of request processing, including all security checks
NOTE: as.state.reqinfo must point to valid instance of RequestInfo
Kind: instance method of Executor
Emits: notExpected, request, response
| Param | Type | Description |
|---|---|---|
| as | AsyncSteps | steps interface |
Shortcut to check access through #acl interface.
NOTE: as.state.reqinfo must point to valid instance of RequestInfo
Kind: instance method of Executor
| Param | Type | Description |
|---|---|---|
| as | AsyncSteps | steps interface |
| acd | string | access control descriptor |
NOT IMPLEMENTED, DO NOT USE. Just a compliance with the Executor interface from spec.
Kind: instance method of Executor
| Param | Type | Description |
|---|---|---|
| as | AsyncSteps | steps interface |
NOT IMPLEMENTED, DO NOT USE. Just a compliance with the Executor interface from spec.
Kind: instance method of Executor
| Param | Type | Description |
|---|---|---|
| as | AsyncSteps | steps interface |
Shutdown Executor and stop whole processing
Kind: instance method of Executor
Emits: close
| Param | Type | Default | Description |
|---|---|---|---|
| [close_cb] | callable | | callback to execute after Executor shutdown |
stringNot standard. Pack message object into JSON representation. If safe limit of 64K is exceeded then error is raised.
Kind: instance method of Executor
Returns: string - string representation of the message
Emits: notExpected
| Param | Type | Description |
|---|---|---|
| coder | MessageCoder | message coder instance |
| msg | object | message to encode into JSON |
May be fired in derived Executors to signal readiness ()
Kind: event emitted by Executor
Fired when request processing is started. ( reqinfo, rawreq )
Kind: event emitted by Executor
Fired when request processing is started. ( reqinfo, rawreq )
Kind: event emitted by Executor
Fired when not expected error occurs ( errmsg, error_info, last_exception, async_stack )
Kind: event emitted by Executor
Fired when Executor is shutting down. ()
Kind: event emitted by Executor
This functionality is provided to provide historical not standard BasicAuth interface. Use of this approach is discouraged.
C-tor
| Param | Type | Default | Description |
|---|---|---|---|
| as | AsyncSteps | AsyncSteps interface | |
| ccm | AdvancedCCM | CCM instance | |
| secprov | SecurityProvider | | optional secprov for chaining |
ExecutorOptionsKind: global class
Extends: ExecutorOptions
Pseudo-class for NodeExecutor options documentation
Provide a pre-configured HTTP server instance or use httpPort [& httpAddr] options
Kind: static property of NodeExecutorOptions
Default:
Bind address for internally created HTTP server
Kind: static property of NodeExecutorOptions
Default:
Bind port for internally created HTTP server
Kind: static property of NodeExecutorOptions
Default:
Path to server FutoIn request on.
NOTE: if httpServer is provided than all not related requests are silently ignored. Otherwise, immediate error is raised if request path does not match httpPath.
Kind: static property of NodeExecutorOptions
Default: /
Option to configure internally created server backlog
Kind: static property of NodeExecutorOptions
Default:
If true, if incoming transport as seen is 'SecureChannel', see FTN3. Useful with reverse proxy and local connections.
Kind: static property of NodeExecutorOptions
Default: false
If true, X-Real-IP and X-Forwarded-For will be used as Source Address, if present
Kind: static property of NodeExecutorOptions
Default: false
If true, then request limiter is enabled by default
Kind: static property of NodeExecutorOptions
Default: false
Interval to run limiter cleanup task for better cache performance and correct reflection of active memory usage.
Kind: static property of NodeExecutorOptions
Default: 60000
Interval to run connection cleanup task for WebSockets. If connection is idle for this period then ping is sent. If connection is idle for twice of that period then connection is killed.
Kind: static property of NodeExecutorOptions
Default: 60000
Auto-detected based posix.getrlimit('nofiles')
Kind: static property of NodeExecutorOptions
Default:
Startup configuration for NodeExecutor#limitConf(). Please mind it's per v4/v6 scope (prefix length).
Kind: static property of NodeExecutorOptions
Default: {"default":""}
Startup configuration for NodeExecutor#addressLimitMap()
Kind: static property of NodeExecutorOptions
Default: {}
Controls if SpecTools.secureObjectPrototype() is called upon startup.
Kind: static property of NodeExecutorOptions
Default: true
Executor implementation for Node.js/io.js with HTTP and WebSockets transport
Kind: global class
| Param | Type | Description |
|---|---|---|
| ccm | AdvancedCCM | CCM for internal requests |
| opts | NodeExecutorOptions | executor options |
IPSetAccess address-limit name ipset for efficient dynamic manipulation
Kind: instance property of NodeExecutor
Returns: IPSet - - ref to static address to limit mapping
BooleanEntry point to process HTTP request
Kind: instance method of NodeExecutor
Returns: Boolean - true on success
| Param | Type | Description |
|---|---|---|
| req | http.IncomingMessage | incoming HTTP request |
| rsp | http.ServerResponse | response object |
Entry point to process HTTP upgrade request with WebSocket
Kind: instance method of NodeExecutor
| Param | Type | Description |
|---|---|---|
| upgrade_req | http.IncomingMessage | original HTTP upgrade request |
| ws | WebSocket | WebSockets connection object |
Configure named limits to be used for client's request limiting.
Kind: instance method of NodeExecutor
| Param | Type | Description |
|---|---|---|
| name | string | name of limit configuration |
| options | object | see AsyncSteps Limiter class |
Configure static address to limit name map
Kind: instance method of NodeExecutor
| Param | Type | Description |
|---|---|---|
| map | object | limit-name => list of CIDR addresses pairs |
Implementation of futoin.ping & futoin.anonping interface
Designed to be used as imported part of larger interfaces.
PingServiceRegister futoin.ping interface with Executor
Kind: static method of PingService
Returns: PingService - instance by convention
| Param | Type | Description |
|---|---|---|
| as | AsyncSteps | steps interface |
| executor | Executor | executor instance |
Kind: global class
See: FTN6 spec
Pseudo-class for RequestInfo.info field enumeration
CN field coming from validated client's x509 certificate, if any
Kind: static property of RequestInfoConst
Default: X509_CN
Client provided public key, if any
Kind: static property of RequestInfoConst
Default: PUBKEY
Client address
Kind: static property of RequestInfoConst
Default: CLIENT_ADDR
See: SourceAddress
Boolean, indicates if transport channel is secure
Kind: static property of RequestInfoConst
Default: SECURE_CHANNEL
Implementation define timestamp of request start.
NOTE:it may not be related to absolute time. Please see performance-now NPM module.
Kind: static property of RequestInfoConst
Default: REQUEST_TIME_FLOAT
Authentication, but not authorization, security level.
Kind: static property of RequestInfoConst
See: RequestInfoConst.SL_*
User Info object
Kind: static property of RequestInfoConst
See: UserInfo
Raw FutoIn request object
Kind: static property of RequestInfoConst
Raw FutoIn response object
Kind: static property of RequestInfoConst
Associated Derived Key
Kind: static property of RequestInfoConst
See: DerivedKey
Indicates that input transport provided raw upload stream.
NOTE: service implementation should simply try to open RequestInfo.rawInput()
Kind: static property of RequestInfoConst
Indicates that Executor must provide raw response
NOTE: service implementation should simply try to open RequestInfo.rawOutput()
Kind: static property of RequestInfoConst
Associated transport channel context
Kind: static property of RequestInfoConst
See: ChannelContext
Security Level - Anonymous
Kind: static constant of RequestInfoConst
Default: Anonymous
See: RequestInfoConst.INFO_SECURITY_LEVEL
Security Level - Info
NOTE: it is level of user authentication, but not authorization. This one is equal to HTTP cookie-based authentication.
Kind: static constant of RequestInfoConst
Default: Info
See: RequestInfoConst.INFO_SECURITY_LEVEL
Security Level - SafeOps
NOTE: it is level of user authentication, but not authorization. This one is equal to HTTP Basic Auth.
Kind: static constant of RequestInfoConst
Default: SafeOps
See: RequestInfoConst.INFO_SECURITY_LEVEL
Security Level - PrivilegedOps
NOTE: it is level of user authentication, but not authorization. This one equals to multi-factor authentication and signed requests.
Kind: static constant of RequestInfoConst
Default: PrivilegedOps
See: RequestInfoConst.INFO_SECURITY_LEVEL
Security Level - ExceptionalOps
NOTE: it is level of user authentication, but not authorization. This one equals to multi-factor authentication for each action and signed requests.
Kind: static constant of RequestInfoConst
Default: ExceptionalOps
See: RequestInfoConst.INFO_SECURITY_LEVEL
Security Level - System
NOTE: it is level of user authentication, but not authorization. This one equals to internal system authorization. User never gets such security level.
Kind: static constant of RequestInfoConst
Default: System
See: RequestInfoConst.INFO_SECURITY_LEVEL
RequestInfo object as defined in FTN6
Kind: global class
objectobjectobjectobjectExecutorAdvancedCCMChannelContext| Param | Type | Description |
|---|---|---|
| executor | Executor | _ |
| rawreq | object | string | raw request |
objectGet reference to input params
Kind: instance method of RequestInfo
Returns: object - parameter holder
objectGet reference to output
Kind: instance method of RequestInfo
Returns: object - result variable holder
| Param | Type | Description |
|---|---|---|
| replace | * | replace result object |
objectGet reference to input stream
Kind: instance method of RequestInfo
Returns: object - raw input stream
Throws:
objectGet reference to output stream
Kind: instance method of RequestInfo
Returns: object - raw output stream
Throws:
ExecutorGet reference to associated Executor instance
Kind: instance method of RequestInfo
Returns: Executor - _
AdvancedCCMGet reference to associated Executor's CCM instance
Kind: instance method of RequestInfo
Returns: AdvancedCCM - _
ChannelContextGet reference to channel context
Kind: instance method of RequestInfo
Returns: ChannelContext - _
Set overall request processing timeout in microseconds.
NOTE: repeat calls override previous value
Kind: instance method of RequestInfo
| Param | Type | Description |
|---|---|---|
| time_ms | float | set automatic request timeout after specified value of microseconds. 0 - disables timeout |
Generic security provider interface
Kind: global class
Check request authentication.
Kind: instance method of SecurityProvider
| Param | Type | Description |
|---|---|---|
| as | AsyncSteps | AsyncSteps interface |
| reqinfo | RequestInfo | extended request info |
| reqmsg | object | request message as is |
| sec | array | reqmsg.sec field split by ':' |
booleanCheck if response signature is required and perform signing.
Kind: instance method of SecurityProvider
Returns: boolean - true, if signature is set
| Param | Type | Description |
|---|---|---|
| as | AsyncSteps | AsyncSteps interface |
| reqinfo | RequestInfo | extended request info |
| rspmsg | object | response message as is |
booleanCheck if request is signed as in MessageSignature constraint.
Kind: instance method of SecurityProvider
Returns: boolean - true, if signed
| Param | Type | Description |
|---|---|---|
| reqinfo | RequestInfo | extended request info |
Check access through Access Control concept
Kind: instance method of SecurityProvider
| Param | Type | Description |
|---|---|---|
| as | AsyncSteps | AsyncSteps interface |
| reqinfo | RequestInfo | extended request info |
| acd | string | array | access control descriptor |
A special helper to set authenticated user info
Kind: instance method of SecurityProvider
| Param | Type | Default | Description |
|---|---|---|---|
| as | AsyncSteps | AsyncSteps interface | |
| reqinfo | RequestInfo | extended request info | |
| seclvl | string | security level | |
| auth_info | object | authentication info | |
| auth_info.local_id | integer | string | Local User ID | |
| auth_info.global_id | string | Global User ID | |
| [auth_info.details] | object | | user details |
Normalize parameters passed through HTTP query. It's important to call this before MAC checking.
Kind: instance method of SecurityProvider
| Param | Type | Description |
|---|---|---|
| as | AsyncSteps | AsyncSteps interface |
| reqinfo | RequestInfo | extended request info |
Source Address representation
Kind: global class
| Param | Type | Description |
|---|---|---|
| type | string | Type of address |
| [host] | string | machine address, if applicable |
| port | integer | string | port or path, if applicable |
stringGet a stable string representation
Kind: instance method of SourceAddress
Returns: string - string representation
Class representing user information
Kind: global class
integerstringAsyncSteps| Param | Type | Description |
|---|---|---|
| ccm | AdvancedCCM | reference to CCM |
| local_id | integer | local unique ID |
| global_id | string | global unique ID |
| details | object | user info fields, see UserInfoConst |
integerGet local unique ID
Kind: instance method of UserInfo
Returns: integer - Local ID
stringGet local global ID
Kind: instance method of UserInfo
Returns: string - Global ID
AsyncStepsGet user info details
Kind: instance method of UserInfo
Returns: AsyncSteps - for easy chaining. {object} with details through as.success()
| Param | Type | Description |
|---|---|---|
| as | AsyncSteps | steps interface |
| [user_field_identifiers] | object | field list to get |
window.FutoInExecutor - Browser-only reference to futoin-executor
window.futoin.Executor - Browser-only reference to futoin-executor
Kind: global variable
AdvancedCCMstring| Param | Type | Description |
|---|---|---|
| ccm | AdvancedCCM | instance of AdvancedCCM |
| opts | objects | see ExecutorOptions |
AdvancedCCMGet reference to associated AdvancedCCM instance
Kind: instance method of Executor
Returns: AdvancedCCM - CCM ref
Register implementation of specific interface
Kind: instance method of Executor
| Param | Type | Description |
|---|---|---|
| as | AsyncSteps | steps interface |
| ifacever | string | standard iface:version notation of interface to be implemented. |
| impl | object | function | either iface implementation or func( impl, executor ) |
| specdirs | object | array | NOT STANDARD. Useful for direct passing of hardcoded spec definition. |
Entry point for Server-originated requests when acting as ClientExecutor
Kind: instance method of Executor
Emits: notExpected, request, response
| Param | Type | Description |
|---|---|---|
| info | object | raw Invoker interface info |
| ftnreq | object | FutoIn request object |
| send_executor_rsp | function | callback( ftnrsp ) |
Entry point for in-program originated requests. Process with maximum efficiency (not yet ;)
Kind: instance method of Executor
Emits: notExpected, request, response
Note: AS result: ftnrsp, content-type
| Param | Type | Description |
|---|---|---|
| as | AsyncSteps | steps interface |
| info | object | raw Invoker interface info |
| ftnreq | object | FutoIn request object |
| [upload_data] | object | upload stream, if any |
| [download_stream] | object | download stream, if any |
Standard entry point used by subclasses. Do full cycle of request processing, including all security checks
NOTE: as.state.reqinfo must point to valid instance of RequestInfo
Kind: instance method of Executor
Emits: notExpected, request, response
| Param | Type | Description |
|---|---|---|
| as | AsyncSteps | steps interface |
Shortcut to check access through #acl interface.
NOTE: as.state.reqinfo must point to valid instance of RequestInfo
Kind: instance method of Executor
| Param | Type | Description |
|---|---|---|
| as | AsyncSteps | steps interface |
| acd | string | access control descriptor |
NOT IMPLEMENTED, DO NOT USE. Just a compliance with the Executor interface from spec.
Kind: instance method of Executor
| Param | Type | Description |
|---|---|---|
| as | AsyncSteps | steps interface |
NOT IMPLEMENTED, DO NOT USE. Just a compliance with the Executor interface from spec.
Kind: instance method of Executor
| Param | Type | Description |
|---|---|---|
| as | AsyncSteps | steps interface |
Shutdown Executor and stop whole processing
Kind: instance method of Executor
Emits: close
| Param | Type | Default | Description |
|---|---|---|---|
| [close_cb] | callable | | callback to execute after Executor shutdown |
stringNot standard. Pack message object into JSON representation. If safe limit of 64K is exceeded then error is raised.
Kind: instance method of Executor
Returns: string - string representation of the message
Emits: notExpected
| Param | Type | Description |
|---|---|---|
| coder | MessageCoder | message coder instance |
| msg | object | message to encode into JSON |
May be fired in derived Executors to signal readiness ()
Kind: event emitted by Executor
Fired when request processing is started. ( reqinfo, rawreq )
Kind: event emitted by Executor
Fired when request processing is started. ( reqinfo, rawreq )
Kind: event emitted by Executor
Fired when not expected error occurs ( errmsg, error_info, last_exception, async_stack )
Kind: event emitted by Executor
Fired when Executor is shutting down. ()
Kind: event emitted by Executor
window.BrowserExecutor - Browser-only reference to futoin-executor.BrowserExecutor
| Param | Type | Description |
|---|---|---|
| ccm | AdvancedCCM | CCM ref |
| opts | BrowserExecutorOptions | executor options |
Pseudo-class for documenting UserInfo detail fields as defined in FTN8 spec
Kind: global constant
Login Name
Kind: static constant of UserInfoConst
Default: Login
Nick Name
Kind: static constant of UserInfoConst
Default: Nick
First Name
Kind: static constant of UserInfoConst
Default: FirstName
Full Name
Kind: static constant of UserInfoConst
Default: FullName
Date if birth in ISO "YYYY-MM-DD" format
Kind: static constant of UserInfoConst
Default: DateOfBirth
Date if birth in ISO "HH:mm:ss" format, can be truncated to minutes
Kind: static constant of UserInfoConst
Default: TimeOfBirth
E-mail for contacts
Kind: static constant of UserInfoConst
Default: ContactEmail
Phone for contacts
Kind: static constant of UserInfoConst
Default: ContactPhone
Home address
Kind: static constant of UserInfoConst
Default: HomeAddress
Work address
Kind: static constant of UserInfoConst
Default: WorkAddress
Citizenship
Kind: static constant of UserInfoConst
Default: Citizenship
Country-specific unique registration ID, e,g, SSN, PersonalCode, etc.
Kind: static constant of UserInfoConst
Default: GovernmentRegID
URL of avatar image
Kind: static constant of UserInfoConst
Default: AvatarURL
documented by jsdoc-to-markdown.
FAQs
FutoIn Service base with strict API definition for Node and Browser
The npm package futoin-executor receives a total of 77 weekly downloads. As such, futoin-executor popularity was classified as not popular.
We found that futoin-executor 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.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.