Sharing XML policies with multiple node apps

Not applicable

Hi, I'm trying to deploy a swagger developed node app to Apigee Edge but I want to deploy it with some common apigee xml policies such as oauth, json threat protection, spike arrest, etc. How do deploy all of this?

We'd like to be able to share a collection of common xml policies with other node apps. Basically we want to be able to use swagger to write a node app, then deploy that app to Apigee Edge but include the common xml policies in the Edge deployment. We don't want to use volos.

The directory structure at the top level is

ProxyName

-apiproxy (contains policies, proxies, targets)

-node (contains api, controllers, services)

-test (contains bdd, tests)

0 1 179
1 REPLY 1

sarthak
Participant V

Michael:

I can think about a couple of different ways to do this:

Proxy Chaining

1. you can create two different proxies. One proxy which has all the general policies like authentication/threat protection etc. Call that a global proxy.

2. Then you can have a number of node proxies.

3. The global proxy will front end all the calls and then will forward it to the node proxy.

So your flow will look something like this:

1763-proxy-chaining.png

Each Proxy is tied to a Virtual Host . If you do not want any api to be exposed directly to the external world without going through the Global Proxy then you can just have the Virtual Host on the Catalogs or Products proxy not to be mapped to any external DNS name.

Only the Virtual Host at the Global Proxy level will be mapped to an external facing DNS name.

This is a very widely accepted Apigee deployment pattern and we call this "Proxy Chaining". And because of the wide adoption of this pattern we are releasing a feature to optimize this design pattern.

Maven Plugin

Another possible way to do this may be to use the maven proxy dependency plugin: https://github.com/apigee/proxy-dependency-maven-plugin

Let me know what you think