Kong · Schema

SessionPluginConfig

API GatewayAI GatewayAI ConnectivityAgent GatewayEvent GatewayMCP RegistryService MeshLLMKafkaKonnectOpen Source

Properties

Name Type Description
config object
name object
protocols array A set of strings representing protocols.
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-sessionpluginconfig-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/SessionPluginConfig",
  "title": "SessionPluginConfig",
  "x-speakeasy-entity": "PluginSession",
  "properties": {
    "config": {
      "type": "object",
      "properties": {
        "absolute_timeout": {
          "description": "The session cookie absolute timeout, in seconds. Specifies how long the session can be used until it is no longer valid.",
          "type": "number",
          "default": 86400
        },
        "audience": {
          "description": "The session audience, which is the intended target application. For example `\"my-application\"`.",
          "type": "string",
          "default": "default"
        },
        "bind": {
          "description": "Bind the session to data acquired from the HTTP request or connection.",
          "type": "array",
          "items": {
            "enum": [
              "ip",
              "scheme",
              "user-agent"
            ],
            "type": "string"
          }
        },
        "cookie_domain": {
          "description": "The domain with which the cookie is intended to be exchanged.",
          "type": "string"
        },
        "cookie_http_only": {
          "description": "Applies the `HttpOnly` tag so that the cookie is sent only to a server.",
          "type": "boolean",
          "default": true
        },
        "cookie_name": {
          "description": "The name of the cookie.",
          "type": "string",
          "default": "session"
        },
        "cookie_path": {
          "description": "The resource in the host where the cookie is available.",
          "type": "string",
          "default": "/"
        },
        "cookie_same_site": {
          "description": "Determines whether and how a cookie may be sent with cross-site requests.",
          "type": "string",
          "default": "Strict",
          "enum": [
            "Default",
            "Lax",
            "None",
            "Strict"
          ]
        },
        "cookie_secure": {
          "description": "Applies the Secure directive so that the cookie may be sent to the server only with an encrypted request over the HTTPS protocol.",
          "type": "boolean",
          "default": true
        },
        "hash_subject": {
          "description": "Whether to hash or not the subject when store_metadata is enabled.",
          "type": "boolean",
          "default": false
        },
        "idling_timeout": {
          "description": "The session cookie idle time, in seconds.",
          "type": "number",
          "default": 900
        },
        "logout_methods": {
          "description": "A set of HTTP methods that the plugin will respond to.",
          "type": "array",
          "items": {
            "enum": [
              "DELETE",
              "GET",
              "POST"
            ],
            "type": "string"
          },
          "default": [
            "DELETE",
            "POST"
          ]
        },
        "logout_post_arg": {
          "description": "The POST argument passed to logout requests. Do not change this property.",
          "type": "string",
          "default": "session_logout"
        },
        "logout_query_arg": {
          "description": "The query argument passed to logout requests.",
          "type": "string",
          "default": "session_logout"
        },
        "read_body_for_logout": {
          "type": "boolean",
          "default": false
        },
        "remember": {
          "description": "Enables or disables persistent sessions.",
          "type": "boolean",
          "default": false
        },
        "remember_absolute_timeout": {
          "description": "The persistent session absolute timeout limit, in seconds.",
          "type": "number",
          "default": 2592000
        },
        "remember_cookie_name": {
          "description": "Persistent session cookie name. Use with the `remember` configuration parameter.",
          "type": "string",
          "default": "remember"
        },
        "remember_rolling_timeout": {
          "description": "The persistent session rolling timeout window, in seconds.",
          "type": "number",
          "default": 604800
        },
        "request_headers": {
          "description": "List of information to include, as headers, in the response to the downstream.",
          "type": "array",
          "items": {
            "enum": [
              "absolute-timeout",
              "audience",
              "id",
              "idling-timeout",
              "rolling-timeout",
              "subject",
              "timeout"
            ],
            "type": "string"
          }
        },
        "response_headers": {
          "description": "List of information to include, as headers, in the response to the downstream.",
          "type": "array",
          "items": {
            "enum": [
              "absolute-timeout",
              "audience",
              "id",
              "idling-timeout",
              "rolling-timeout",
              "subject",
              "timeout"
            ],
            "type": "string"
          }
        },
        "rolling_timeout": {
          "description": "The session cookie rolling timeout, in seconds. Specifies how long the session can be used until it needs to be renewed.",
          "type": "number",
          "default": 3600
        },
        "secret": {
          "description": "The secret that is used in keyed HMAC generation.",
          "type": "string",
          "x-encrypted": true,
          "x-referenceable": true
        },
        "stale_ttl": {
          "description": "The duration, in seconds, after which an old cookie is discarded, starting from the moment when the session becomes outdated and is replaced by a new one.",
          "type": "number",
          "default": 10
        },
        "storage": {
          "description": "Determines where the session data is stored. `kong`: Stores encrypted session data into Kong's current database strategy; the cookie will not contain any session data. `cookie`: Stores encrypted session data within the cookie itself.",
          "type": "string",
          "default": "cookie",
          "enum": [
            "cookie",
            "kong"
          ]
        },
        "store_metadata": {
          "description": "Whether to also store metadata of sessions, such as collecting data of sessions for a specific audience belonging to a specific subject.",
          "type": "boolean",
          "default": false
        }
      }
    },
    "name": {
      "const": "session"
    },
    "protocols": {
      "description": "A set of strings representing protocols.",
      "type": "array",
      "items": {
        "description": "A string representing a protocol, such as HTTP or HTTPS.",
        "enum": [
          "grpc",
          "grpcs",
          "http",
          "https",
          "tcp",
          "tls",
          "tls_passthrough",
          "udp",
          "ws",
          "wss"
        ],
        "type": "string"
      },
      "format": "set",
      "default": [
        "grpc",
        "grpcs",
        "http",
        "https"
      ]
    },
    "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"
        }
      }
    }
  }
}