Microgateway: Plugins per proxy

Former Community Member
Not applicable
2 5 1,515

Abstract

With microgateway you can now execute plugins for individual proxies.

Details

The microgateway configuration file allow the developer/user to enable plugins. Here is a sample:

  plugins:
    sequence:
      - oauth
      - quota

These plugins will apply to all API Proxies exposed by the microgateway instance.

We now have a mechanism to apply plugins to individual API Proxies. Here is an example:

edgemicro:
  port: 8000
  max_connections: 1000
  max_connections_hard: 5000
  max_times: 300
  config_change_poll_interval: 600
  proxies:
    - edgemicro_foo:
        plugins:
          - spikearrest:
              timeUnit: minute
              allow: 10
    - edgemicro_httpbin:
        plugins:
          - oauth:
              allowNoAuthorization: false
              allowInvalidAuthorization: false
              keep-authorization-header: true
              allowAPIKeyOnly: true
              verify_api_key_url: 'xxx/verifyApiKey'
  logging:
    level: error
    dir: /var/tmp
    stats_log_interval: 60
    rotate_interval: 24
  plugins:
    sequence:
      - json2xml

We've introduced a new element called 'proxies' inside the 'edgemicro' stanza. In this stanza, you can specify the proxies you want other plugins to execute. In this example, the edgemicro_foo proxy will execute the spikearrest plugin and the edgemicro_httpbin proxy will execute the oauth plugin.

You'll also observe we can still run plugins at the microgateway instance level (i.e., applied to all proxies). In this example, json2xml is applicable to all proxies (including edgemicro_foo and edgemicro_httpbin).

How do I install or test this feature?

npm install -g edgemicro@alpha

NOTE: This feature is currently in alpha. This should install 2.6.1-alpha.

Can each the same plugin have different config for each proxy?

Sure. spikerrest for example can have a different setting for each proxy. Just add the configuration at the proxy level.

Comments
rkuckian
New Member

When this feature will be available to use?

ericschult
New Member

I too would like to know when 2.6 is planned to be released.

Not applicable

@Srinandan Sridhar Do we have any update on this feature? I tried using it via 2.6.1 alpha version, encountered few issues like cannot able to use custom plugins per proxy, multiple plugins.

ericschult
New Member

Bumping this thread. Might this be near to a released/supported status?

Former Community Member
Not applicable

We analyzed the approach to deliver this feature (of selecting which plugins apply to which proxy). We concluded that we cannot deliver this feature in the current Microgateway architecture.

If your use case is to selectively add API gateway policies to microservices, please take a look at the Apigee adapter for Istio. With the Istio adapter, you can application gateway policies per microservice.

Version history
Last update:
‎09-01-2017 11:29 AM
Updated by:
Former Community Member