hawat.blueprints.pdnsr package

Description

This pluggable module provides access to PassiveDNS service operated by CESNET, a.l.e.. It is implemented upon custom mentat.services.pdnsr module.

Provided endpoints

/pdnsr/search

Endpoint providing search form for querying PassiveDNS service and formating result as HTML page.

  • Authentication: login required

  • Methods: GET

/api/pdnsr/search

Endpoint providing API search form for querying PassiveDNS service and formating result as JSON document.

  • Authentication: login required

  • Authorization: any role

  • Methods: GET, POST

/snippet/pdnsr/search

Endpoint providing API search form for querying PassiveDNS service and formating result as JSON document containing HTML snippets.

  • Authentication: login required

  • Authorization: any role

  • Methods: GET, POST

class hawat.blueprints.pdnsr.APISearchView[source]

Bases: hawat.base.AJAXMixin, hawat.blueprints.pdnsr.AbstractSearchView

View responsible for querying PassiveDNS service and presenting the results in the form of JSON document.

classmethod get_view_name()[source]

Implementation of hawat.base.BaseView.get_view_name().

methods = ['GET', 'POST']
class hawat.blueprints.pdnsr.AbstractSearchView[source]

Bases: hawat.base.RenderableView

Application view providing base search capabilities for PassiveDNS service.

The querying is implemented using mentat.services.pdnsr module.

authentication = True
authorization = [<Permission needs={Need(method='role', value='user'), Need(method='role', value='maintainer'), Need(method='role', value='admin'), Need(method='role', value='developer')} excludes=set()>]
dispatch_request()[source]

Mandatory interface required by the flask.views.View.dispatch_request(). Will be called by the Flask framework to service the request.

classmethod get_menu_title(**kwargs)[source]

Implementation of hawat.base.BaseView.get_menu_title().

classmethod get_view_title(**kwargs)[source]

Implementation of hawat.base.BaseView.get_view_title().

hawat.blueprints.pdnsr.BLUEPRINT_NAME = 'pdnsr'

Name of the blueprint as module global constant.

class hawat.blueprints.pdnsr.PDNSRBlueprint(name, import_name, **kwargs)[source]

Bases: hawat.base.HawatBlueprint

Hawat pluggable module - PassiveDNS service.

classmethod get_module_title()[source]

Implementation of hawat.base.HawatBlueprint.get_module_title().

register_app(app)[source]

Callback method. Will be called from hawat.base.HawatApp.register_blueprint() method and can be used to customize the Flask application object. Possible use cases:

  • application menu customization

Parameters

app (hawat.base.HawatApp) – Flask application to be customize.

class hawat.blueprints.pdnsr.SearchView[source]

Bases: hawat.base.HTMLMixin, hawat.blueprints.pdnsr.AbstractSearchView

View responsible for querying PassiveDNS service and presenting the results in the form of HTML page.

classmethod get_view_name()[source]

Implementation of hawat.base.BaseView.get_view_name().

methods = ['GET']
class hawat.blueprints.pdnsr.SnippetSearchView[source]

Bases: hawat.base.SnippetMixin, hawat.blueprints.pdnsr.AbstractSearchView

View responsible for querying PassiveDNS service and presenting the results in the form of JSON document containing ready to use HTML page snippets.

classmethod get_view_name()[source]

Implementation of hawat.base.BaseView.get_view_name().

methods = ['GET', 'POST']
process_response_context()[source]

Implementation of hawat.base.SnippetMixin.process_response_context().

renders = ['label', 'full']
snippets = ['hostnames']
hawat.blueprints.pdnsr.get_blueprint()[source]

Mandatory interface and factory function. This function must return a valid instance of hawat.base.HawatBlueprint or flask.Blueprint.