articulate / biplane

A configuration-based management and automation tool for Kong
MIT License
40 stars 5 forks source link

plugins dump #20

Open mrafieee opened 7 years ago

mrafieee commented 7 years ago

I have a plugin which is applied to all endpoints but in my dump file it does not show up, do we have a high level plugins section like what we have currently for apis and consumers?

plukevdh commented 7 years ago

Plugins are strange in that the are nested under the APIs that they apply to. i.e. you add plugins to an API endpoint. So they are always supposed to be nested against their respective API definitions.

Example:

---
apis:
  - name: my_endpoint
    attributes:
      request_path: /my_cool_service
      strip_request_path: true
      upstream_url: http://coolservice.dev.articulate.com/service_endpoint
    plugins:
      - name: acl
        attributes:
          config:
            whitelist: google-auth
      - name: jwt
        attributes:
          config:
            key_claim_name: aud
            uri_param_names: jwt
            claims_to_verify: exp
            secret_is_base64: false
      - name: cors
        attributes:
          config:
            credentials: false
            preflight_continue: false
            origin: *
      - name: response-transformer
        attributes:
          config:
            add:
              headers: X-Content-Type-Options:nosniff

You can see the plugins are listed in the plugins: secton under the my_endpoint api definition.

Which version of Kong are you using this against?