Kong · Schema

KeyAuthPluginConfig

API GatewayAI GatewayAI ConnectivityAgent GatewayEvent GatewayMCP RegistryService MeshLLMKafkaKonnectOpen Source

Properties

Name Type Description
config object
name object
protocols array A list of the request protocols that will trigger this plugin. The default value, as well as the possible values allowed on this field, may change depending on the plugin type. For example, plugins th
route object If set, the plugin will only activate when receiving requests via the specified route. Leave unset for the plugin to activate regardless of the route being used.
service object If set, the plugin will only activate when receiving requests via one of the routes belonging to the specified Service. Leave unset for the plugin to activate regardless of the Service being matched.
View JSON Schema on GitHub

JSON Schema

kong-keyauthpluginconfig-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/KeyAuthPluginConfig",
  "title": "KeyAuthPluginConfig",
  "x-speakeasy-entity": "PluginKeyAuth",
  "properties": {
    "config": {
      "type": "object",
      "properties": {
        "anonymous": {
          "description": "An optional string (consumer UUID or username) value to use as an \u201canonymous\u201d consumer if authentication fails. If empty (default null), the request will fail with an authentication failure `4xx`.",
          "type": "string"
        },
        "hide_credentials": {
          "description": "An optional boolean value telling the plugin to show or hide the credential from the upstream service. If `true`, the plugin strips the credential from the request.",
          "type": "boolean",
          "default": true
        },
        "identity_realms": {
          "description": "A configuration of Konnect Identity Realms that indicate where to source a consumer from.",
          "type": "array",
          "items": {
            "properties": {
              "id": {
                "description": "A string representing a UUID (universally unique identifier).",
                "type": "string"
              },
              "region": {
                "type": "string"
              },
              "scope": {
                "type": "string",
                "enum": [
                  "cp",
                  "realm"
                ]
              }
            },
            "type": "object"
          }
        },
        "key_in_body": {
          "description": "If enabled, the plugin reads the request body. Supported MIME types: `application/www-form-urlencoded`, `application/json`, and `multipart/form-data`.",
          "type": "boolean",
          "default": false
        },
        "key_in_header": {
          "description": "If enabled (default), the plugin reads the request header and tries to find the key in it.",
          "type": "boolean",
          "default": true
        },
        "key_in_query": {
          "description": "If enabled (default), the plugin reads the query parameter in the request and tries to find the key in it.",
          "type": "boolean",
          "default": true
        },
        "key_names": {
          "description": "Describes an array of parameter names where the plugin will look for a key. The key names may only contain [a-z], [A-Z], [0-9], [_] underscore, and [-] hyphen.",
          "type": "array",
          "items": {
            "description": "A string representing an HTTP header name.",
            "type": "string"
          },
          "default": [
            "apikey"
          ]
        },
        "realm": {
          "description": "When authentication fails the plugin sends `WWW-Authenticate` header with `realm` attribute value.",
          "type": "string"
        },
        "run_on_preflight": {
          "description": "A boolean value that indicates whether the plugin should run (and try to authenticate) on `OPTIONS` preflight requests. If set to `false`, then `OPTIONS` requests are always allowed.",
          "type": "boolean",
          "default": true
        }
      }
    },
    "name": {
      "const": "key-auth"
    },
    "protocols": {
      "description": "A list of the request protocols that will trigger this plugin. The default value, as well as the possible values allowed on this field, may change depending on the plugin type. For example, plugins that only work in stream mode will only support tcp and tls.",
      "type": "array",
      "items": {
        "enum": [
          "grpc",
          "grpcs",
          "http",
          "https",
          "ws",
          "wss"
        ],
        "type": "string"
      },
      "format": "set",
      "default": [
        "grpc",
        "grpcs",
        "http",
        "https",
        "ws",
        "wss"
      ]
    },
    "route": {
      "description": "If set, the plugin will only activate when receiving requests via the specified route. Leave unset for the plugin to activate regardless of the route being used.",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string"
        }
      }
    },
    "service": {
      "description": "If set, the plugin will only activate when receiving requests via one of the routes belonging to the specified Service. Leave unset for the plugin to activate regardless of the Service being matched.",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string"
        }
      }
    }
  }
}