Skip to main content

Django plugin for Zato

Project description

django-zato-plugin

A client library for invoking Zato services from Django applications.

Zato is an integration platform that orchestrates and automates your to APIs, databases, queues, and other systems.

Learn more here: https://zato.io

With this plugin, Django delegates integration work to Zato - your views call Zato services, Zato handles the rest. Less code in Django, all integrations in one place.

Installation

pip install django-zato-plugin

Configuration

Add to your Django settings:

ZATO_URL = 'http://localhost:17010/django'
ZATO_USERNAME = 'django'
ZATO_PASSWORD = 'password' # Use your Zato password, e.g. from the Zato_Password env. variable

API

The client exposes one method:

response = client.invoke(service, data=None)

  • service - name of the Zato service to invoke (string)
  • data - request data to send (dict or None)

Returns the response from the Zato service as a dict.

Usage

Let's say you have a frontend with a cybersecurity automation UI and you want to invoke a couple of backend services using JSON.

Here's how it would look like:

# views.py
from django.http import JsonResponse
from django_zato import client

def block_ip(request):

    # Extract the request ..
    ip_address = request.POST['ip_address']
    reason = request.POST['reason']

    # .. block on firewall and get the response ..
    firewall_response = client.invoke('firewall.block-ip', {'ip_address': ip_address})
    rule_id = firewall_response['rule_id']

    # .. log incident in SIEM ..
    siem_response = client.invoke('siem.log-incident', {
        'ip_address': ip_address,
        'reason': reason,
        'action': 'blocked',
        'firewall_rule_id': rule_id,
    })

    # .. Extract the response from SIEM ..
    incident_id = siem_response['incident_id']

    # .. and return the response to the frontend.
    return JsonResponse({
        'status': 'ok',
        'firewall_rule_id': rule_id,
        'siem_incident_id': incident_id,
    })

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_zato_plugin-4.1.4.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_zato_plugin-4.1.4-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file django_zato_plugin-4.1.4.tar.gz.

File metadata

  • Download URL: django_zato_plugin-4.1.4.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.7

File hashes

Hashes for django_zato_plugin-4.1.4.tar.gz
Algorithm Hash digest
SHA256 212e76c4c6cf4ca6aa172b07e796a5a94a8cf181dccd63456864e4d4bc926002
MD5 b2e113d597fe44056047dea3294c70de
BLAKE2b-256 18b8bbc513eef9355faddf8a25743e76a41ea3f24836a674f9add452caea0c9c

See more details on using hashes here.

File details

Details for the file django_zato_plugin-4.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for django_zato_plugin-4.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 17757629f9f9ab0c6b016fa94bdfc347691b1c8e813123e386ffbc421a0de574
MD5 34b99dceace87785a2b8f433585daeff
BLAKE2b-256 62e1a5720a5b77a8eb817a5a3853163ba42b8db15cf42d05c4be0ba0ae6d703c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page