Fautore API: osaAppReg
Applications are end points between which data is transferred. Both sending and receiving applications must be registered with the POD OCE. The osaAppReg function is the means by which an application registers with an OCE.
Table of contents
Overview
An application must be approved by an authorized administrator before it can be used.
Registration Structure
The application registration data structure is constructed of encoded JSON passed within the "Adjunct":"Data" portion of the master OSA message being used to pass the data to the OCE.
Function: osaAppReg
Source:
All data is provided by registering application. Alternatively, Fautore screens could be developed at a future time for the manual registration of an application.
Example:
This is a decoded JSON data structure extracted from the "Adjunct":"Data" portion of the master OSDS.
$json = '{ "Func": "osaAppReg", "AppName": "fauEmail", "AppId" : "SMTP:HammersFamousEmailApp", "Maintainer": "Technoloy Advocates" "CompatibilityDate": "2014-06-22", "Description": "Email utility to treat a mail server as a contributing team member", "UserName": "Crazed1", "ocePush": 1, "AppPull": 0, "AppLoc": "/home/member/fautore/apps/fauEmail/fauEmail.pl", "AppSetup": "/home/member/fautore/apps/fauEmail/fauEmail_su.pl", "Multiuser": 1, "Computer": "Thor.cichosz.org", "Port": 26, "AppUser": "Marvin", "AppPass": "R0bot", "Interval": 300, "AppVals": [ {"TechName": "catalog", "DispName": "Catalog", "DataType": "Str", "Length": 42, "Value": "Spring"}, {"TechName": "persKey", "DispName": "Personal Key", "DataType": "Str", "Length": 69, "Value": "ajhdfyuqw487qqweiaisfg6480403er"} ], }';
Field Definitions
Below are the field definitions by section.
Main
Top level field definitions
SubField | Type | Disp | Description |
---|---|---|---|
AppName | string | req | Descriptive application name, spaces allowed |
AppId | string | opt | Application developer supplied key for use in supporting like-application default routing. The first value in this field acts as a categorical designator so that the qMsg will default delivery to any application of the same category. A second, colon separated value specifies the application to which the data should go. The second value can be thought of as the "preferred" application to receive the qMesg data. No field however; can override OCE member instructions for delivery. |
Maintainer | string | req | Indicator of person or company responsible for maintaining the app |
CompatibilityDate | date | req | Earliest date with which the current app version is compatible |
Description | string | req | Info to aid enablement decision by app manager |
UserName | string | req | User name of registering member, must verify |
ocePush | boolean | req | Flag (0,1) indicating if the OCE pushes data to the Application |
AppPull | boolean | req | Flag (0,1) indicating if Application pulls data from OCE |
AppSetup | string | opt | This may contain a url or a system path given by the application where a GUI exists for the entry of configuration/operational data particular to that app. Any reference in this field must be within the POD. Any reference outside the POD will trigger a PODEXT error and be ignored. |
AppRun | string | opt | This may contain a system path to stop/start/restart the app. If present when the OCE starts or stops etc the app. Thus the app is sync'd to the OCE Note: this field is optional and only is triggered if an app is approved. |
DefVals | hash | opt | Hash of values considered defaults for interfacing with the application. |
AppVals | array | opt | Array of additional application specific values. |
DefVals
Hash of values considered defaults for interfacing with the application. These are all considered optional because none may be required by some applications. An application that is "pull only" on outbound from the OCE and "push only into the OCE need not have any of these values.
SubField | Type | Disp | Description |
---|---|---|---|
AppName | string | req | Descriptive application name, spaces allowed |
Computer | string | opt | Host name or IP address of application host |
Port | int | opt | Application port number on application host computer |
AppUser | string | opt | Application user name on remote computer |
AppPass | string | opt | Application user password on remote computer |
Interval | int | opt | Polling interval at which application interaction should occur |
AppVals
An array of hashes storing custom application defined values for use by the OCE when interacting with the application. Application values are broken into two classes. Each hash element name (referred to as <TechName> in the above "Request Example") is the technical name representing the data and would presumably reference a database field or some other data storage meaningful to the application.
- cfg
- The configuration class of application values define values that should be passed with every message. These could be things like encryption keys or some other identifying information to help the application be certain it is working with the OCE it is expecting as a form of reverse secondary authentication. Other possibilities could be values for where additional data could be picked up or any other endless number of possibilities.
- data
- The data class of application values defines data values that can be defined from within the OCE rules for use by the receiving application in data messages. Uses for this capability could, for example, be to inform the receiving application which of several functionalities it supports should process the incoming data. A content management system with a weBLog, Gallery and Forum could use this class of information to define what features should receive the data.
SubField | Type | Length | Disp | Description |
---|---|---|---|---|
Class | string | 4 | req | Defines whether this is a configuration item or data definition element |
DataType | string | 16 | req | Data type stored in the dynamic application variable |
DispName | string | 64 | req | Field name in dynamically created forms |
Value | string | 128 | opt | Value for application specific field |
Length | int | 4b | req | Length of dynamic application field |
The response returned is a 2 field JSON structure:
- Positive numbers indicate success
- Negative numbers indicate rejection
- NULL = Request failure, programmatic error
Mesg:
- Descriptive text explaining the MsgId
Upon Success:
- MsgId = 1
- Mesg = Fautore id for the application reference
Upon Rejection:
- MsgId = negative reason code (table of codes TBD)
- Mesg = Text of message describing reason for rejection (i.e. Application already registered for user.)
Upon Failure:
- NULL
Data Mapping
Data accepted by the osaAppReg function stores it's data as indicated in the below table.
Note:
- The RegApps table must be populated before the Apps table
- The RegApps:AppId generated for the application is reused in the Apps table
JSON | Table | Field | Comments |
---|---|---|---|
AppName | RegApps | AppName | Straight copy from JSON to table. |
Description | RegApps | Description | Straight copy from JSON to table. |
UserName | RegApps | UserName | Verified against "User" table before insertion. |
AppPush | RegApps | AppPush | Straight copy from JSON to table. |
FauPull | RegApps | FauPull | Straight copy from JSON to table. |
DefVals | - | - | Pointer to default values for the application. These values are supplied to Tribe Members as defaults when they enroll in application use. |
Computer | Apps | Computer | The hostname or IP address of the computer hosting the application. This value must be verified as being within the FOD. |
Port | Apps | Port | The port on the host computer by which the application is accessed. |
AppUser | Apps | AppUser | Login id used to access the application. |
AppPass | Apps | AppPass | Password associated with AppUser. This is a problem point. we need a way to store this information securely, yet still be able to pass it back to the application later n a form it understads. |
Interval | Apps | Interval | Number of seconds between iterations of accessing the application. |
- | Apps | User_UID | This value is not passed from the application. This is always "default" to indicate this is the default value set for the application. There should always be 1 and only 1 of these records associate with any application. |
- | Apps | RegApps_AppId | The unique application id assigned when data was stored to the RegApp table. |
Workflows
Registration is the process of making an application available to Fautore. A registered application is not useable until after it has been configured and activited by a Application ManagerAn application manager is any tribe member with the "Manage Apps" privelege..
- Application queries Fautore well known port in the IANA "User Ports" range with a registration request.
- Fautore returns Dynamic port address of Registration Service
- Application sends registration criteria to Registration Service
- Registration service verifies provided TUID exists
- Registration service verifies provided password matches for the TUID
- Registration service Verifies provided TUID has privileges to register application
- Registration service creates Unique Fautore ID (UFID) for application
- Registration service creates a record for the application in the "Apps" table
- Unique Fautore Identifier (UFID)
- Tribe User Id of registering user
- AppPush value
- FauPull value
- Registration date
- Default for "Computer" if provided (IP/Hostname)
- Default for "Port" if provided
- Default for "appUser" if provided
- Default for "appPass" if provided
- Default for "Interval" if provided
- Registration service creates a new record in the "AppSpecs" table for each set of application specific field values provided.
Once an application is registered with the Tribe it must be configured to function correctly with values specifying how to interact with the remote data source. After configuration is complete the application is then activated (With the click of a checkbox).
- Application ManagerAn application manager is any tribe member with the "Manage Apps" privilege. logs into the Tribe.
- Application Manager brings up the "Application Management" screen.
- Application Management screen presents a list of registered applications and their "Active" status.
- Application name is a link to an "Application Detailed Information" screen.
- Application Manager clicks link for newly added application.
- Fautore builds "Application Detailed Information" screen
- Standard fields stored by the tribe are selected from the "Apps" table for the application.
- Application specific data descriptors are selected from "AppSpecs"
- Any values associated with the application data descriptors are selected from the "AppSpecData" table.
- The page is built using the "Apps" data as default for the standard form fields, the "AppSpecs" data to construct the form fields for the application specific data and the data pulled from "AppSpecsData" as the default values for the application specific fields.
- Application Manager fills in any missing data and saves the form.
- The Application Manager is returned to the "Application Management" screen
- Application Manager clicks the "Active" checkbox to activate the application for tribe use
- Fautore verifies the parameters of the application access systems only within the Fautore Operational Domain (FOD).
- If the "Computer" value for the application is a FQDN the domain name portion must match that of the Tribe FQDN or be "localhost"
- If the "Computer" value for the application is an IP address it must fall within the Ethernet IP broadcast mapping for the local LAN.
- The application is marked as "active" with a successful FOD verification or an appropriate error is present otherwise.
This section is provided for context only. Exact steps for mapping applications to tribe members and activities are yet to be determined.
- Coterie Chief selects from active list of applications to enable them for use in their individual Coterie.
- Any Tribe member with sufficient privilege for creating instructions accesses the "Instruction Definition" screen.
- The "Data Source" section of the screen present fields listing Tribe/Coterie Members, Applications, "RegEx" filter defs for "Summary Content" and "Detail Content," and a "Data Type" pull down that would list values such as "Text," "Images," "Sound" and "Video."
- The "Data Destination" section of the screen present fields listing Tribe/Coterie Members, Applications, "RegEx" filter defs for "Summary Content" and "Detail Content," and a "Data Type" pull down that would list values such as "Text," "Images," "Sound" and "Video."
- Tribe Member selects an application from the source dropdown
- Tribe member selects any additional criteria to narrow down the source trigger.
- Tribe member selects an application from the destinations dropdown.
- Tribe member select data types to send
- Tribe member save rule
- Any data placed into the staging area matching the terms of the "source" portion of the rule will be sent to the destination application.