Coder Social home page Coder Social logo

ngeleedst / pimcore-webhooks Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sintraconsulting/pimcore-webhooks

0.0 0.0 0.0 17.46 MB

Pimcore Bundle that enbable pimcore to expose webook for communication to third parties

Shell 2.47% PHP 97.53%

pimcore-webhooks's Introduction

WebHookBundle Plugin

Compile and Tests CodeFactor

This extention provide an easy way to send dataobjects to an external sites via json, whenever a pimcore event occurs on a specified class. This bundle installs the webHook class through which it is possible to define, from the UI, which dataObjects to listen for sending data to an external website, whenever a pimcore event occurs on the specified dataobject.

How to Install WebHookBundle

1. download and install the bundle from composer

For installig WebHookBundle, the first step is to open your terminal and type:

docker-compose exec php bash
composer require sintra/pimcore-webhooks:dev-main

After you have installed the Toolbox Bundle via composer, open pimcore backend and go to Tools => Extension:

  • Click the green + Button in Enable / Disable row
  • Click the green + Button in Install/Uninstall row

2. Configure the bundle

Now that the bundle is installed you can start creating your webhooks!. Follows the next stesp.

  1. create a folder called Webhooks. Although this is not mandatory and you can name it as you want.
  2. create a webhook object in it:
  • In setting panel you can specify the name of the classes to monitor, the events to listen to, and the URL of the site to send the json object
  • In the security panel, you can set an api-key to provie to the specified URS, an a pair of public/private key to generate a signature

The following video shows how this can be done in seconds. Now you are ready to use the Webhok bundle!

Webook configuration

Availbale options

You can specify:

  • The class to monitor
  • The URL to send data to
  • The event to listen

The aviable event are:

  • preAdd
  • postAdd
  • postAddFailure
  • preUpdate
  • postUpdate
  • postUpdateFailure
  • deleteInfo
  • preDelete
  • postDelete
  • postDeleteFailure
  • postCopy
  • postCsvItemExport

Once the event occurs, the json represtantion of you data is sent to the specified url. In the header it is specified which event was launched.

Each event will trigger a request like this:

  • headers
    • x-listen-event: contain the name of the event launched
    • x-apikey: contain a random generated key for autentication porpouse
    • x-signature: contain the data signature created with OPENSSL_ALGO_SHA1; public key is store in website settings
  • body contains two main parts:
    • dataObject: json representation of your dataObject
    • argumentrs: exception code and message throws if a failure occurs

Security settings

To ensure the authenticity and security of the information transmitted, in the header there are a randomly generated api-key, and a signature generated through a pair of keys (public / private), stored in the Pimcore website setting. These are created automatically when the bundle is installed, but you can use your own.

To run the tests you don't need to create any webhooks or classes, these will be created automatically, you just have to initialize the testURL attribute with a valid url.

pimcore-webhooks's People

Contributors

marcomisiani avatar zeppaman avatar christophluehr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.