본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

세션 플러그인 구성 참조

원문 보기 위키 갱신

세션 플러그인 구성 참조 (Session Plugin Configuration Reference)

이 문서는 Kong의 Session 플러그인에서 설정할 수 있는 구성 옵션을 스키마 형태로 정리한 참조 자료예요. 쿠키 이름, 도메인, SameSite 같은 쿠키 속성부터 절대 타임아웃과 유휴 타임아웃 같은 세션 만료 설정까지 각 필드의 기본값과 의미를 한눈에 확인할 수 있어요. 세션을 IP나 사용자 에이전트에 바인딩하는 방법이나 로그아웃 처리에 사용할 HTTP 메서드 설정도 함께 다루고 있어요

출처: 문서

본문

{
  "properties": {
    "config": {
      "properties": {
        "absolute_timeout": {
          "default": 86400,
          "description": "The session cookie absolute timeout, in seconds. Specifies how long the session can be used until it is no longer valid.",
          "type": "number"
        },
        "audience": {
          "default": "default",
          "description": "The session audience, which is the intended target application. For example `\"my-application\"`.",
          "type": "string"
        },
        "bind": {
          "description": "Bind the session to data acquired from the HTTP request or connection.",
          "items": {
            "enum": [
              "ip",
              "scheme",
              "user-agent"
            ],
            "type": "string"
          },
          "type": "array"
        },
        "cookie_domain": {
          "description": "The domain with which the cookie is intended to be exchanged.",
          "type": "string"
        },
        "cookie_http_only": {
          "default": true,
          "description": "Applies the `HttpOnly` tag so that the cookie is sent only to a server.",
          "type": "boolean"
        },
        "cookie_name": {
          "default": "session",
          "description": "The name of the cookie.",
          "type": "string"
        },
        "cookie_path": {
          "default": "/",
          "description": "The resource in the host where the cookie is available.",
          "type": "string"
        },
        "cookie_same_site": {
          "default": "Strict",
          "description": "Determines whether and how a cookie may be sent with cross-site requests.",
          "enum": [
            "Default",
            "Lax",
            "None",
            "Strict"
          ],
          "type": "string"
        },
        "cookie_secure": {
          "default": true,
          "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"
        },
        "hash_subject": {
          "default": false,
          "description": "Whether to hash or not the subject when store_metadata is enabled.",
          "type": "boolean"
        },
        "idling_timeout": {
          "default": 900,
          "description": "The session cookie idle time, in seconds.",
          "type": "number"
        },
        "logout_methods": {
          "default": [
            "DELETE",
            "POST"
          ],
          "description": "A set of HTTP methods that the plugin will respond to.",
          "items": {
            "enum": [
              "DELETE",
              "GET",
              "POST"
            ],
            "type": "string"
          },
          "type": "array"
        },
        "logout_post_arg": {
          "default": "session_logout",
          "description": "The POST argument passed to logout requests. Do not change this property.",
          "type": "string"
        },
        "logout_query_arg": {
          "default": "session_logout",
          "description": "The query argument passed to logout requests.",
          "type": "string"
        },
        "read_body_for_logout": {
          "default": false,
          "type": "boolean"
        },
        "remember": {
          "default": false,
          "description": "Enables or disables persistent sessions.",
          "type": "boolean"
        },
        "remember_absolute_timeout": {
          "default": 2592000,
          "description": "The persistent session absolute timeout limit, in seconds.",
          "type": "number"
        },
        "remember_cookie_name": {
          "default": "remember",
          "description": "Persistent session cookie name. Use with the `remember` configuration parameter.",
          "type": "string"
        },
        "remember_rolling_timeout": {
          "default": 604800,
          "description": "The persistent session rolling timeout window, in seconds.",
          "type": "number"
        },
        "request_headers": {
          "description": "List of information to include, as headers, in the response to the downstream.",
          "items": {
            "enum": [
              "absolute-timeout",
              "audience",
              "id",
              "idling-timeout",
              "rolling-timeout",
              "subject",
              "timeout"
            ],
            "type": "string"
          },
          "type": "array"
        },
        "response_headers": {
          "description": "List of information to include, as headers, in the response to the downstream.",
          "items": {
            "enum": [
              "absolute-timeout",
              "audience",
              "id",
              "idling-timeout",
              "rolling-timeout",
              "subject",
              "timeout"
            ],
            "type": "string"
          },
          "type": "array"
        },
        "rolling_timeout": {
          "default": 3600,
          "description": "The session cookie rolling timeout, in seconds. Specifies how long the session can be used until it needs to be renewed.",
          "type": "number"
        },
        "secret": {
          "description": "The secret that is used in keyed HMAC generation. \nThis field is [referenceable](/gateway/entities/vault/#how-do-i-reference-secrets-stored-in-a-vault). \nThis field is [encrypted](/gateway/keyring/).",
          "type": "string",
          "x-encrypted": true,
          "x-referenceable": true
        },
        "stale_ttl": {
          "default": 10,
          "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"
        },
        "storage": {
          "default": "cookie",
          "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.",
          "enum": [
            "cookie",
            "kong"
          ],
          "type": "string"
        },
        "store_metadata": {
          "default": false,
          "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"
        }
      },
      "type": "object"
    },
    "expressions": {
      "additionalProperties": true,
      "type": "object"
    },
    "protocols": {
      "default": [
        "grpc",
        "grpcs",
        "http",
        "https"
      ],
      "description": "A set of strings representing protocols.",
      "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"
      },
      "type": "array"
    },
    "route": {
      "additionalProperties": false,
      "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.",
      "properties": {
        "id": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "service": {
      "additionalProperties": false,
      "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.",
      "properties": {
        "id": {
          "type": "string"
        }
      },
      "type": "object"
    }
  }
}

관련 리소스

더 알아보기 (Learn more)