Skip to content

NMS-ACM: Design Bring Your Own Policy #3

Description

@shawnhankim

As a Solution Engineer,

I have a customer who is using NGINX Plus w/ NJS to enrich flexible API traffic management between external Microservices and internal Upstream service as the following process. When it gets a JWT from a client, it will reach out to a number of other Microservices to pull information. Then, it adds information to the JST to send on to an Upstream service. I would like to stay the custom NJS on NGINX Plus, and it can be managed by NMS-ACM.

As a Product Manager,

I want to provide the features of Bring Your Own Custom Policy(BYOCP) where scriptExtensions can be included in NMS-ACM and NGINX Plus.

Acceptance Criteria:

  • Design API Schema
  • Design Data Model
  • Design NGINX Configuration

Misc.:

  • UX/UI: Not required here.
  • Draft of API schema
    "policies": {
      "custom-policy": [
        {
          "functionName": "rest-to-soap-transformer",
          "metadata": {
            "appliedOn": "inbound",
            "labels": [
              "default"
            ]
          },
          "action": {
            "rejectCode": 505,
            "config": [
              {
                "scriptExtensions": [
                  {
                    "primaryJSRefernce": "mainJSreferenceFile.js",
                    "requestParams": [
                      {
                        "ingressPayloadReference": "fileRef.json",
                        "backendPayloadReference": "fileRef.wsdl",
                        "subRequestEndpoint": "",
                        "certificates": [
                          
                        ]
                      }
                    ]
                  },
                  {
                    "dependencies": [
                      "jsreferenceFile1.js",
                      "jsreferenceFile1.js"
                    ]
                  }
                ]
              }
            ]
          }
        }
      ]
    }
    • The above approach is to encourage customers to Build Your Own Custom Policy using NJS.
    • For custom-policy, its required to define functionName and scriptExtensions to reference NJS scripts.
    • Inside the scriptExtensions, we would have primaryJSReference and dependencies complex objects.
    • This is to help customers to dependent javascript(Node.JS) for the primary NJS.
    • As part of primaryJSReference, optional requestParams array object can be set.
    • This is to help customer to externalize any file references or other data needed inside the NJS.
    • It would be customer responsibility to use the same request parameter inside the NJS so that NMS-ACM can appropriately build the NJS with appropriate values to execute the NJS.
    • As any other policy, this can be applied on inbound or backend or outbound.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions