Skip to content

Plugins for microgateway, oauth, analytics, spike arrest, etc...

License

Notifications You must be signed in to change notification settings

apigee/microgateway-plugins

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Aug 18, 2023
ccfc1ed · Aug 18, 2023
Nov 12, 2020
Jan 21, 2021
Jan 21, 2021
Jul 6, 2023
Aug 16, 2023
Aug 16, 2023
Mar 3, 2016
Jan 22, 2020
Mar 3, 2016
Jun 28, 2019
Sep 9, 2021
Aug 13, 2019
Jan 20, 2022
Aug 16, 2023
Jan 21, 2021
Jun 28, 2019
Jun 28, 2019
Jan 21, 2021
Aug 16, 2023
Aug 19, 2020
Sep 9, 2021
Aug 16, 2023
Aug 16, 2023
Jun 28, 2019
Sep 23, 2020
Jan 22, 2020
Jun 18, 2019
Mar 3, 2016
Mar 3, 2016
Jan 20, 2022
Jun 28, 2019
Aug 16, 2023
Jun 18, 2019
Aug 9, 2019
Jun 18, 2019
Jun 28, 2019
Mar 31, 2016
Sep 9, 2021
Sep 9, 2021
Aug 18, 2023
Aug 18, 2023

Repository files navigation

Plugins

Overview

This repo contains plugins for the microgateway-core project.

These plugins can be loaded into the microgateway calling the load plugin method

Building a plugin

must contain an init method which returns an object literal with all of the handlers

{
  init:function(config,logger,stats){
    return {
    onrequest:function(req,res,[options],next){
    },
    ...
    }
  }
}

init method must return an object with handler methods for each event

the available handlers are

  • on_request
  • ondata_request
  • onend_request
  • on_response
  • ondata_response
  • onend_response
  • onclose_response
  • onerror_response

The handler signature will look like :

function(sourceRequest,sourceResponse,[options],next){}
  • sourceRequest: the request from the northbound server;

  • sourceResponse the response to the northbound server;

  • options: are the full scope of fields you might need to operate on.

    	const options = {
        targetResponse: options.targetResponse,
        targetRequest: options.targetRequest,
        sourceRequest: options.sourceRequest,
        sourceResponse: options.sourceResponse,
        data: data
      };
  • you must call next with an error if you errored out like

next([err])