API reference

This document is the API reference for OpenTAXII. It describes all classes, methods, functions, and attributes that are part of the public API.

Most of the terminology in the OpenTAXII API comes straight from the TAXII specification. See the TAXII documentation or TAXII2 documentation for more detailed explanations.

Configuration

opentaxii.config.merge(d1, d2)
class opentaxii.config.ServerConfig(optional_env_var='OPENTAXII_CONFIG', extra_configs=None)

Bases: dict

Class responsible for loading configuration files.

This class will load default configuration file (shipped with OpenTAXII) and apply user specified configuration file on top of default one.

Users can specify custom configuration file (YAML formatted) using enviromental variable. The variable should contain a full path to a custom configuration file.

Parameters
  • optional_env_var (str) – name of the enviromental variable

  • extra_configs (list) – list of additional config filenames

VALID_BASE_OPTIONS = ('domain', 'support_basic_auth', 'return_server_error_details', 'logging', 'auth_api', 'taxii1', 'taxii2')
VALID_TAXII_OPTIONS = ('persistence_api',)
VALID_TAXII1_OPTIONS = ('save_raw_inbox_messages', 'xml_parser_supports_huge_tree', 'count_blocks_in_poll_responses', 'unauthorized_status', 'hooks')
VALID_TAXII2_OPTIONS = ('contact', 'description', 'max_content_length', 'title', 'public_discovery', 'allow_custom_properties')
ALL_VALID_OPTIONS = ('domain', 'support_basic_auth', 'return_server_error_details', 'logging', 'auth_api', 'taxii1', 'taxii2', 'persistence_api', 'save_raw_inbox_messages', 'xml_parser_supports_huge_tree', 'count_blocks_in_poll_responses', 'unauthorized_status', 'hooks')

TAXII server layer

class opentaxii.server.TAXIIServer(config: opentaxii.config.ServerConfig)

Bases: object

TAXII Server class.

This is the main entrypoint for http requests. It keeps the Auth API manager instance and dispatches requests and error handling to TAXII1Server and TAXII2Server

AUTH_MANAGER_CLASS

alias of opentaxii.auth.manager.AuthManager

app: flask.app.Flask
config: opentaxii.config.ServerConfig
servers: opentaxii.server.ServerMapping
property real_servers
property current_server
init_app(app: flask.app.Flask)

Connect taxii1, taxii2 and auth to flask.

is_basic_auth_supported()

Check if basic auth is a supported feature.

get_endpoint(relative_path: str) Optional[Callable[[], flask.wrappers.Response]]

Get first endpoint matching relative_path.

handle_request(relative_path: str) flask.wrappers.Response

Dispatch request to appropriate taxii* server.

handle_internal_error(error)

Dispatch internal error handling to appropriate taxii* server.

handle_status_exception(error)

Dispatch status exception handling to appropriate taxii* server.

handle_http_exception(error)

Dispatch http exception handling to appropriate taxii* server.

handle_validation_exception(error)

Dispatch validation exception handling to appropriate taxii* server.

raise_unauthorized()

Dispatch unauthorized handling to appropriate taxii* server.

class opentaxii.server.TAXII1Server(config: dict)

Bases: opentaxii.server.BaseTAXIIServer

TAXII1 Server class.

This class keeps Presistence API manager instance for TAXII1 and creates TAXII1 Service instances on request.

Parameters

config (dict) – OpenTAXII1 server configuration

TYPE_TO_SERVICE = {'collection_management': <class 'opentaxii.taxii.services.collection_management.CollectionManagementService'>, 'discovery': <class 'opentaxii.taxii.services.discovery.DiscoveryService'>, 'inbox': <class 'opentaxii.taxii.services.inbox.InboxService'>, 'poll': <class 'opentaxii.taxii.services.poll.PollService'>}
PERSISTENCE_MANAGER_CLASS

alias of opentaxii.persistence.manager.Taxii1PersistenceManager

check_allowed_methods()
get_endpoint(relative_path: str) Optional[Callable[[], flask.wrappers.Response]]

Get first endpoint matching relative_path.

get_services(service_ids=None)

Get services registered with this TAXII server instance.

Parameters

service_ids (list) – list of service IDs (as strings)

Returns

list of services

Return type

list of opentaxii.taxii.services.abstract.TAXIIService

get_service(id)

Get service by ID.

Parameters

id (str) – service ID

Returns

service with specified ID or None

Return type

opentaxii.taxii.services.abstract.TAXIIService

get_services_for_collection(collection, service_type)

Get list of services with type service_type, attached to collection collection.

Parameters
Returns

list of services

Return type

list of opentaxii.taxii.services.abstract.TAXIIService # noqa

handle_request(endpoint: opentaxii.taxii.services.abstract.TAXIIService)

Handle request and return appropriate response.

Process TAXIIService with either _process_with_service() or _process_options_request().

handle_internal_error(error)

Handle internal error and return appropriate response.

handle_status_exception(error)

Handle status exception and return appropriate response.

raise_unauthorized()

Handle unauthorized access.

ENDPOINT_MAPPING: Tuple[re.Pattern, Callable[[], flask.wrappers.Response]]
app: flask.app.Flask
config: dict
class opentaxii.server.TAXII2Server(config: dict)

Bases: opentaxii.server.BaseTAXIIServer

TAXII2 server class.

Stub, implementation pending.

PERSISTENCE_MANAGER_CLASS

alias of opentaxii.persistence.manager.Taxii2PersistenceManager

handle_http_exception(error)

Return JSON instead of HTML for HTTP errors.

handle_validation_exception(error)

Handle validation exception and return appropriate response.

raise_unauthorized()

Handle unauthorized access.

get_endpoint(relative_path: str) Optional[Callable[[], flask.wrappers.Response]]

Get first endpoint matching relative_path.

check_authentication(endpoint: Callable[[], flask.wrappers.Response])

Check if account is authenticated, unless endpoint handles that itself.

check_content_length()
check_headers(endpoint: Callable[[], flask.wrappers.Response])
check_allowed_methods(endpoint: Callable[[], flask.wrappers.Response])
handle_request(endpoint: Callable[[], flask.wrappers.Response])
discovery_handler()
api_root_handler(api_root_id)
job_handler(api_root_id, job_id)
collections_handler(api_root_id)
collection_handler(api_root_id, collection_id_or_alias)
manifest_handler(api_root_id, collection_id_or_alias)
objects_handler(api_root_id, collection_id_or_alias)
objects_get_handler(api_root_id, collection_id_or_alias)
objects_post_handler(api_root_id, collection_id_or_alias)
object_handler(api_root_id, collection_id_or_alias, object_id)
object_get_handler(api_root_id, collection_id_or_alias, object_id)
object_delete_handler(api_root_id, collection_id_or_alias, object_id)
versions_handler(api_root_id, collection_id_or_alias, object_id)
ENDPOINT_MAPPING: Tuple[re.Pattern, Callable[[], flask.wrappers.Response]]
app: flask.app.Flask
config: dict
class opentaxii.entities.Account(id, username, permissions, is_admin=False, **details)

Bases: object

Represents Account entity.

This class holds user-specific information and is used for authorization.

Parameters
  • id (str) – account id

  • details (dict) – additional details of an account

can_read(collection_name)
can_modify(collection_name)

HTTP layer

opentaxii.middleware.create_app(server)

Create Flask application and attach TAXII server instance server to it.

Parameters

server (opentaxii.server.TAXIIServer) – TAXII server instance

Returns

Flask app

Version agnostic TAXII1 entities

class opentaxii.taxii.entities.ServiceEntity(type, properties, id=None)

Bases: opentaxii.common.entities.Entity

TAXII Service entity.

Parameters
  • type (str) – service type, supported values are listed as keys in opentaxii.server.TAXIIServer.TYPE_TO_SERVICE

  • properties (dict) – a dictionary with service-specific properties

  • id (str) – service ID

class opentaxii.taxii.entities.ContentBindingEntity(binding, subtypes=None)

Bases: opentaxii.common.entities.Entity

TAXII Content Binding entity.

Parameters
  • binding (str) – content binding ID

  • subtypes (list) – list of subtype ids

opentaxii.taxii.entities.deserialize_content_bindings(supported_content)
class opentaxii.taxii.entities.CollectionEntity(name, id=None, description=None, type='DATA_FEED', volume=None, accept_all_content=False, supported_content=None, available=True)

Bases: opentaxii.common.entities.Entity

TAXII Collection entity.

Parameters
  • id (str) – collection id

  • name (str) – collection name

  • description (str) – description for the collection

  • type (TYPE_FEED or TYPE_SET) – collection type

  • accept_all_content (bool) – if collection accepts all content types

  • supported_content (list) – list of the supported content bindings as a list of ContentBindingEntity instances

  • available (bool) – if collection is available

TYPE_FEED = 'DATA_FEED'
TYPE_SET = 'DATA_SET'
is_content_supported(content_binding)
get_matching_bindings(requested_bindings)
class opentaxii.taxii.entities.ContentBlockEntity(content, timestamp_label, content_binding=None, id=None, message=None, inbox_message_id=None)

Bases: opentaxii.common.entities.Entity

TAXII Content Block entity.

Parameters
  • id (str) – content block ID

  • content (str) – payload

  • timestamp_label (datetime) – content block timestamp

  • content_binding (ContentBindingEntity) – content binding

  • message (str) – message attached to the content block

  • inbox_message_id (str) – internal ID of the inbox message entity

class opentaxii.taxii.entities.InboxMessageEntity(message_id, original_message, content_block_count, service_id, id=None, result_id=None, destination_collections=None, record_count=None, partial_count=False, subscription_collection_name=None, subscription_id=None, exclusive_begin_timestamp_label=None, inclusive_end_timestamp_label=None)

Bases: opentaxii.common.entities.Entity

TAXII Inbox Message Entity

Parameters
  • message_id (str) – TAXII message ID

  • original_message (str) – XML serialized original TAXII message

  • content_block_count (int) – how many content blocks this message contains

  • service_id (str) – ID of the Inbox Service that received the message

  • id (str) – internal ID of the inbox message entity

  • result_id (str) – ID of the Result Set part of which this message delivers

  • destination_collections (list) – a list of destination collections, as a list of strings

  • record_count (int) – how many items left in the Result Set this message is part of

  • partial_count (bool) – if the record count is partial

  • subscription_id (str) – ID of a subscription

  • subscription_collection_name (str) – collection name of the subscription

  • exclusive_begin_timestamp_label (datetime) – subscription’s exclusive begin timestamp label

  • inclusive_begin_timestamp_label (datetime) – subscription’s inclusive begin timestamp label

class opentaxii.taxii.entities.ResultSetEntity(id, collection_id, content_bindings=None, timeframe=None)

Bases: opentaxii.common.entities.Entity

TAXII Result Set entity.

Parameters
  • id (str) – ID of a Result Set

  • collection_id (str) – ID of a collection

  • content_bindings (list) – list of ContentBindingEntity instances

  • timeframe (tuple) – a timeframe of the Result Set in a form of (begin, end)

class opentaxii.taxii.entities.SubscriptionParameters(response_type='FULL', content_bindings=None)

Bases: opentaxii.common.entities.Entity

TAXII Subscription Parameters entity.

Note: query formats specification is not supported

Parameters
FULL = 'FULL'
COUNT_ONLY = 'COUNT_ONLY'
class opentaxii.taxii.entities.PollRequestParametersEntity(response_type='FULL', content_bindings=None)

Bases: opentaxii.taxii.entities.SubscriptionParameters

TAXII Poll Request Parameters entity.

Note: allow_asynch and delivery_parameters fields are not supported

Parameters
  • response_type (str) – response type, supported values are FULL and COUNT_ONLY

  • content_bindings (list) – list of ContentBindingEntity instances

class opentaxii.taxii.entities.SubscriptionEntity(service_id, collection_id, subscription_id=None, status='ACTIVE', poll_request_params=None)

Bases: opentaxii.common.entities.Entity

TAXII Subscription entity.

Parameters
  • service_id (str) – ID of a service

  • collection_id (str) – ID of a collection

  • subscription_id (str) – ID of a subscription

  • status (str) – subscription status, supported values are: ACTIVE, PAUSED, UNSUBSCRIBED

  • poll_request_params (PollRequestParametersEntity) – Poll Request Parameters entity

ACTIVE = 'ACTIVE'
PAUSED = 'PAUSED'
UNSUBSCRIBED = 'UNSUBSCRIBED'

TAXII services

class opentaxii.taxii.services.abstract.TAXIIService(id, server, address, description=None, path=None, protocol_bindings=None, available=True, authentication_required=False)

Bases: object

Generic TAXII Service class.

This class implements common methods for all TAXII services.

Parameters
  • id (str) – service ID

  • address (str) – service address as absolute URL

  • description (str) – service description

  • protocol_bindings (list) – list of supported protocol bindings as a list of strings

  • available (bool) – if the service is available

  • authentication_required (bool) – if authentication required

  • path (str) – relative path if service is configured in the server

supported_message_bindings = ['urn:taxii.mitre.org:message:xml:1.0', 'urn:taxii.mitre.org:message:xml:1.1']
id = None
server = None
description = 'Default TAXII service description'
supported_protocol_bindings = ()
available = True
authentication_required = False
generate_id()
process(headers, message)
get_message_handler(message)
to_service_instances(version)
get_absolute_address(binding)
class opentaxii.taxii.services.discovery.DiscoveryService(services=None, **kwargs)

Bases: opentaxii.taxii.services.abstract.TAXIIService

service_type = 'DISCOVERY'
handlers = {'Discovery_Request': <class 'opentaxii.taxii.services.handlers.discovery_request_handlers.DiscoveryRequestHandler'>}
advertised_services = []
set_advertised_services(services)
class opentaxii.taxii.services.inbox.InboxService(accept_all_content=False, destination_collection_required=False, supported_content=None, **kwargs)

Bases: opentaxii.taxii.services.abstract.TAXIIService

service_type = 'INBOX'
handlers = {'Inbox_Message': <class 'opentaxii.taxii.services.handlers.inbox_message_handlers.InboxMessageHandler'>}
accept_all_content = False
supported_content = []
destination_collection_required = False
is_content_supported(content_binding, version=None)
get_destination_collections()
validate_destination_collection_names(name_list, in_response_to)
to_service_instances(version)
get_supported_content(version)
class opentaxii.taxii.services.poll.PollService(subscription_required=False, max_result_size=- 1, max_result_count=- 1, **kwargs)

Bases: opentaxii.taxii.services.abstract.TAXIIService

handlers = {'Poll_Fulfillment': <class 'opentaxii.taxii.services.handlers.poll_fulfilment_request_handlers.PollFulfilmentRequestHandler'>, 'Poll_Request': <class 'opentaxii.taxii.services.handlers.poll_request_handlers.PollRequestHandler'>}
service_type = 'POLL'
wait_time = 300
can_push = False
subscription_required = False
max_result_size = None
max_result_count = None
get_collection(name)
get_offset_limit(part_number)
get_content_blocks_count(collection, timeframe=None, content_bindings=None)
get_content_blocks(collection, timeframe=None, content_bindings=None, part_number=1)
create_result_set(collection, content_bindings=None, timeframe=None)
get_result_set(result_set_id)
get_subscription(subscription_id)
class opentaxii.taxii.services.collection_management.CollectionManagementService(subscription_supported=True, subscription_message=None, **kwargs)

Bases: opentaxii.taxii.services.abstract.TAXIIService

subscription_handlers = {'Subscription_Management_Request': <class 'opentaxii.taxii.services.handlers.subscription_request_handlers.SubscriptionRequestHandler'>}
service_type = 'COLLECTION_MANAGEMENT'
subscription_message = 'Default subscription message'
subscription_supported = True
handlers = {'Collection_Information_Request': <class 'opentaxii.taxii.services.handlers.collection_information_request_handlers.CollectionInformationRequestHandler'>, 'Feed_Information_Request': <class 'opentaxii.taxii.services.handlers.collection_information_request_handlers.CollectionInformationRequestHandler'>}
property advertised_collections
get_collection(name)
get_push_methods(collection)
get_polling_services(collection)
get_subscription_services(collection)
create_subscription(subscription)
get_subscription(subscription_id)
get_subscriptions()
update_subscription(subscription)
get_receiving_inbox_services(collection)

TAXII2 entities

Taxii2 entities.

class opentaxii.taxii2.entities.ApiRoot(id: str, default: bool, title: str, description: str, is_public: bool)

Bases: opentaxii.common.entities.Entity

TAXII2 API Root entity.

Parameters
  • id (str) – id of this API root

  • default (bool) – indicator of default api root, should only be True once

  • title (str) – human readable plain text name used to identify this API Root

  • description (str) – human readable plain text description for this API Root

  • is_public (bool) – whether this is a publicly readable API root

class opentaxii.taxii2.entities.Collection(id: str, api_root_id: str, title: str, description: str, alias: str, is_public: bool, is_public_write: bool)

Bases: opentaxii.common.entities.Entity

TAXII2 Collection entity.

Parameters
  • id (str) – id of this collection

  • api_root_id (str) – id of the ApiRoot this collection belongs to

  • title (str) – human readable plain text name used to identify this collection

  • description (str) – human readable plain text description for this collection

  • alias (str) – human readable collection name that can be used on systems to alias a collection id

  • is_public (bool) – whether this is a publicly readable collection

  • is_public_write (bool) – whether this is a publicly writable collection

can_read(account: Optional[opentaxii.entities.Account])

Determine if account is allowed to read from this collection.

can_write(account: Optional[opentaxii.entities.Account])

Determine if account is allowed to write to this collection.

class opentaxii.taxii2.entities.STIXObject(id: str, collection_id: str, type: str, spec_version: str, date_added: datetime.datetime, version: datetime.datetime, serialized_data: dict)

Bases: opentaxii.common.entities.Entity

TAXII2 STIXObject entity.

Parameters
  • id (str) – id of this stix object

  • collection_id (str) – id of the Collection this stix object belongs to

  • type (str) – type of this stix object

  • spec_version (str) – stix version this object matches

  • date_added (datetime) – the date and time this object was added

  • version (datetime) – the version of this object

  • serialized_data (dict) – the payload of this object

class opentaxii.taxii2.entities.ManifestRecord(id: str, date_added: datetime.datetime, version: datetime.datetime, spec_version: str)

Bases: opentaxii.common.entities.Entity

TAXII2 ManifestRecord entity.

This is a cut-down version of STIXObject, for efficiency.

Parameters
  • id (str) – id of this stix object

  • date_added (datetime) – the date and time this object was added

  • version (datetime) – the version of this object

  • spec_version (str) – stix version this object matches

class opentaxii.taxii2.entities.VersionRecord(date_added: datetime.datetime, version: datetime.datetime)

Bases: opentaxii.common.entities.Entity

TAXII2 VersionRecord entity.

This is a cut-down version of STIXObject, for efficiency.

Parameters
  • date_added (datetime) – the date and time this object was added

  • version (datetime) – the version of this object

class opentaxii.taxii2.entities.JobDetail(id: str, job_id: str, stix_id: str, version: datetime.datetime, message: str, status: str)

Bases: opentaxii.common.entities.Entity

TAXII2 JobDetail entity, part of “status resource” in taxii2 docs.

Parameters
  • id (str) – id of this job detail

  • job_id (str) – id of the job this detail belongs to

  • stix_id (str) – id of the STIXObject this detail tracks

  • version (datetime) – the version of this object

  • message (str) – message indicating more information about the object being created, its pending state, or why the object failed to be created.

  • status (str) – status of this job

as_taxii2_dict()

Turn this object into a taxii2 dict.

class opentaxii.taxii2.entities.JobDetails(success, failure, pending)

Bases: NamedTuple

success: List[opentaxii.taxii2.entities.JobDetail]

Alias for field number 0

failure: List[opentaxii.taxii2.entities.JobDetail]

Alias for field number 1

pending: List[opentaxii.taxii2.entities.JobDetail]

Alias for field number 2

class opentaxii.taxii2.entities.Job(id: str, api_root_id: str, status: str, request_timestamp: datetime.datetime, completed_timestamp: Optional[datetime.datetime] = None, total_count: int = 0, success_count: int = 0, failure_count: int = 0, pending_count: int = 0, details: Optional[opentaxii.taxii2.entities.JobDetails] = None)

Bases: opentaxii.common.entities.Entity

TAXII2 Job entity, called a “status resource” in taxii2 docs.

Parameters
  • id (str) – id of this job

  • api_root_id (str) – id of the ApiRoot this collection belongs to

  • status (str) – status of this job

  • request_timestamp (datetime) – the datetime of the request that this status resource is monitoring

  • completed_timestamp (datetime) – the datetime of the completion of this job (used for cleanup)

  • total_count (int) – the total number of stix objects in this job

  • success_count (int) – the number of successful stix objects in this job

  • failure_count (int) – the number of failed stix objects in this job

  • pending_count (int) – the number of pending stix objects in this job

  • details (dict) – the details per status of this job

as_taxii2_dict()

Turn this object into a taxii2 dict.

TAXII2 validation

Taxii2 validation functions.

opentaxii.taxii2.validation.validate_envelope(json_data: str, allow_custom: bool = False) None

Validate if json_data is a valid taxii2 envelope.

Parameters
  • json_data (str) – the data to check

  • allow_custom (bool) – if true, allow non-standard stix types

class opentaxii.taxii2.validation.Taxii2DateTime(format: str | None = None, **kwargs)

Bases: marshmallow.fields.DateTime

Taxii2 formatting compliant datetime field.

DEFAULT_FORMAT = '%Y-%m-%dT%H:%M:%S.%fZ'
class opentaxii.taxii2.validation.Taxii2Next(*, load_default: typing.Any = <marshmallow.missing>, missing: typing.Any = <marshmallow.missing>, dump_default: typing.Any = <marshmallow.missing>, default: typing.Any = <marshmallow.missing>, data_key: str | None = None, attribute: str | None = None, validate: None | (typing.Callable[[typing.Any], typing.Any] | typing.Iterable[typing.Callable[[typing.Any], typing.Any]]) = None, required: bool = False, allow_none: bool | None = None, load_only: bool = False, dump_only: bool = False, error_messages: dict[str, str] | None = None, metadata: typing.Mapping[str, typing.Any] | None = None, **additional_metadata)

Bases: marshmallow.fields.Field

Implemenatation of the taxii2 next query param.

class opentaxii.taxii2.validation.Taxii2Filter(*, load_default: typing.Any = <marshmallow.missing>, missing: typing.Any = <marshmallow.missing>, dump_default: typing.Any = <marshmallow.missing>, default: typing.Any = <marshmallow.missing>, data_key: str | None = None, attribute: str | None = None, validate: None | (typing.Callable[[typing.Any], typing.Any] | typing.Iterable[typing.Callable[[typing.Any], typing.Any]]) = None, required: bool = False, allow_none: bool | None = None, load_only: bool = False, dump_only: bool = False, error_messages: dict[str, str] | None = None, metadata: typing.Mapping[str, typing.Any] | None = None, **additional_metadata)

Bases: marshmallow.fields.Field

General taxii2 filter implementation.

class opentaxii.taxii2.validation.Taxii2VersionFilter(*, load_default: typing.Any = <marshmallow.missing>, missing: typing.Any = <marshmallow.missing>, dump_default: typing.Any = <marshmallow.missing>, default: typing.Any = <marshmallow.missing>, data_key: str | None = None, attribute: str | None = None, validate: None | (typing.Callable[[typing.Any], typing.Any] | typing.Iterable[typing.Callable[[typing.Any], typing.Any]]) = None, required: bool = False, allow_none: bool | None = None, load_only: bool = False, dump_only: bool = False, error_messages: dict[str, str] | None = None, metadata: typing.Mapping[str, typing.Any] | None = None, **additional_metadata)

Bases: opentaxii.taxii2.validation.Taxii2Filter

Taxii2 compliant version filter.

class opentaxii.taxii2.validation.PersistenceApiMxin(persistence_api: opentaxii.persistence.api.OpenTAXII2PersistenceAPI, *args, **kwargs)

Bases: object

Store persistence api on schema instance, to reference in Taxii2Next

class opentaxii.taxii2.validation.VersionFilterParamsSchema(persistence_api: opentaxii.persistence.api.OpenTAXII2PersistenceAPI, *args, **kwargs)

Bases: opentaxii.taxii2.validation.PersistenceApiMxin, marshmallow.schema.Schema

Schema for the versions endpoint filters.

opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>
class opentaxii.taxii2.validation.ObjectFilterParamsSchema(persistence_api: opentaxii.persistence.api.OpenTAXII2PersistenceAPI, *args, **kwargs)

Bases: opentaxii.taxii2.validation.PersistenceApiMxin, marshmallow.schema.Schema

Schema for the object endpoint filters.

opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>
class opentaxii.taxii2.validation.ListFilterParamsSchema(persistence_api: opentaxii.persistence.api.OpenTAXII2PersistenceAPI, *args, **kwargs)

Bases: opentaxii.taxii2.validation.PersistenceApiMxin, marshmallow.schema.Schema

Schema for the object list endpoint filters.

opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>
class opentaxii.taxii2.validation.DeleteFilterParamsSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)

Bases: marshmallow.schema.Schema

Schema for the object delete endpoint filters.

opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>
opentaxii.taxii2.validation.validate_object_filter_params(filter_params: werkzeug.datastructures.ImmutableMultiDict, persistence_api: opentaxii.persistence.api.OpenTAXII2PersistenceAPI) dict

Validate and load filter params for the object endpoint.

opentaxii.taxii2.validation.validate_list_filter_params(filter_params: werkzeug.datastructures.ImmutableMultiDict, persistence_api: opentaxii.persistence.api.OpenTAXII2PersistenceAPI) dict

Validate and load filter params for the list endpoint.

opentaxii.taxii2.validation.validate_versions_filter_params(filter_params: werkzeug.datastructures.ImmutableMultiDict, persistence_api: opentaxii.persistence.api.OpenTAXII2PersistenceAPI) dict

Validate and load filter params for the versions endpoint.

opentaxii.taxii2.validation.validate_delete_filter_params(filter_params: werkzeug.datastructures.ImmutableMultiDict) dict

Validate and load filter params for the delete endpoint.