Public code-level APIs

This page describes OpenTAXII’s public code-level APIs.

Overview

OpenTAXII ships with code-level APIs that can be extended by users. Built-in implementations use SQL database as a backend (everything that SQLAlchemy supports).

Additionaly, OpenTAXII supports anychronous notifications and users can attach custom listeners to the specific events.

Custom API implementations

It is possible to attach custom API implementations to OpenTAXII.

Custom API class should inherit base class (opentaxii.persistence.api.OpenTAXIIPersistenceAPI for Persistence API and opentaxii.auth.api.OpenTAXIIAuthAPI for Authentication API) and implement all defined methods.

Class constructor can accept any parameters. These parameters (as well as API class full name) have to be set in OpenTAXII configuration file. See example configuration for exact syntax. OpenTAXII will load the class from the PYTHONPATH and create API instance during server’s start up procedure.

OpenTAXII APIs are documented below.

Custom signal listeners

Users can attach custom listeners for the events OpenTAXII emits. See Signals to find a list of supported signals.

To attach custom signals, specify full module name as a value for hooks field in OpenTAXII configuration file. Note that the module needs to be in OpenTAXII’s PYTHONPATH.

Example of the implementation is provided in OpenTAXII GitHub repo - examples/hooks.py.

Persistence API

Persistence API takes care of all CRUD operations with entities and wraps backend storage layer.

See Configuration page for the details about how to attach custom implementation of Persistence API.

Authentication API

Authentication API represents an authority for authentication-related queries.

See Configuration page for the details about how to attach custom implementation of Authentication API.

Signals

Signals provide the ability for the user’s code to receive asynchronous notification for predefined signals.

See Custom signal listeners chapter for the details about how to attach listeners for the signals.