{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/tyk-gateway-open-source-v5-7/latest.json",
  "title": "Tyk gateway OSS config file schema",
  "description": "Schema that describes the config file of OSS tyk gateway.",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/TykTechnologies/tyk-schemas/refs/heads/main/JSON/draft-07/schema_tyk.oss.conf",
    "sourceSha256": "d5a628f9c6d7d216513f280bb303aa320055742f71ee2e20e48f8d276124525a",
    "fileMatch": [
      "tyk.conf"
    ]
  },
  "type": "object",
  "properties": {
    "listen_port": {
      "examples": [
        8080
      ],
      "type": "integer",
      "title": "The listen_port schema",
      "description": "An explanation about the purpose of this instance.",
      "default": 0
    },
    "log_level": {
      "examples": [
        "info",
        "debug"
      ],
      "type": "string",
      "title": "The log_level schema",
      "description": "Configuration field to control the gateway logging level.",
      "enum": [
        "error",
        "warn",
        "info",
        "debug"
      ],
      "default": "info"
    },
    "secret": {
      "examples": [
        "352d20ee67be67f6340b4c0605b044b7"
      ],
      "type": "string",
      "title": "The secret schema",
      "description": "Configuration field as API key for the Tyk Gateway API. It should be passed along as the `X-Tyk-Authorization header in any requests made.",
      "default": ""
    },
    "template_path": {
      "examples": [
        "/opt/tyk-gateway/templates"
      ],
      "type": "string",
      "title": "The template_path schema",
      "description": "An explanation about the purpose of this instance.",
      "default": ""
    },
    "tyk_js_path": {
      "examples": [
        "/opt/tyk-gateway/js/tyk.js"
      ],
      "type": "string",
      "title": "The tyk_js_path schema",
      "description": "An explanation about the purpose of this instance.",
      "default": ""
    },
    "middleware_path": {
      "examples": [
        "/opt/tyk-gateway/middleware"
      ],
      "type": "string",
      "title": "The middleware_path schema",
      "description": "An explanation about the purpose of this instance.",
      "default": ""
    },
    "use_db_app_configs": {
      "examples": [
        false
      ],
      "type": "boolean",
      "title": "Loading API configurations from DB",
      "description": "For licensed users this needs to be true. False means it's not using a DB to load the configurations.",
      "default": false
    },
    "app_path": {
      "examples": [
        "/opt/tyk-gateway/apps/"
      ],
      "type": "string",
      "title": "The app_path schema",
      "description": "An explanation about the purpose of this instance.",
      "default": ""
    },
    "storage": {
      "properties": {
        "type": {
          "examples": [
            "redis"
          ],
          "type": "string",
          "title": "The type schema",
          "description": "An explanation about the purpose of this instance.",
          "default": ""
        },
        "host": {
          "examples": [
            "tyk-redis"
          ],
          "type": "string",
          "title": "The host schema",
          "description": "An explanation about the purpose of this instance.",
          "default": ""
        },
        "port": {
          "examples": [
            6379
          ],
          "type": "integer",
          "title": "The port schema",
          "description": "An explanation about the purpose of this instance.",
          "default": 0
        },
        "username": {
          "examples": [
            "<change-me>"
          ],
          "type": "string",
          "title": "The username schema",
          "description": "An explanation about the purpose of this instance.",
          "default": ""
        },
        "password": {
          "examples": [
            "<change-me>"
          ],
          "type": "string",
          "title": "The password schema",
          "description": "An explanation about the purpose of this instance.",
          "default": ""
        },
        "database": {
          "examples": [
            0
          ],
          "type": "integer",
          "title": "The Redis database to be selected after connecting to the server",
          "description": "Only single-node and failover clients.",
          "default": 0
        },
        "optimisation_max_idle": {
          "examples": [
            2000
          ],
          "type": "integer",
          "title": "The optimisation_max_idle schema",
          "description": "An explanation about the purpose of this instance.",
          "default": 0
        },
        "optimisation_max_active": {
          "examples": [
            4000
          ],
          "type": "integer",
          "title": "The optimisation_max_active schema",
          "description": "An explanation about the purpose of this instance.",
          "default": 0
        }
      },
      "type": "object",
      "title": "The storage schema",
      "description": "An explanation about the purpose of this instance.",
      "default": {},
      "examples": [
        {
          "type": "redis",
          "host": "tyk-redis",
          "port": 6379,
          "username": "",
          "password": "",
          "database": 0,
          "optimisation_max_idle": 2000,
          "optimisation_max_active": 4000
        }
      ],
      "required": [
        "type",
        "host",
        "port"
      ],
      "additionalProperties": true
    },
    "enable_analytics": {
      "examples": [
        false
      ],
      "type": "boolean",
      "title": "The enable_analytics schema",
      "description": "An explanation about the purpose of this instance.",
      "default": false
    },
    "analytics_config": {
      "properties": {
        "type": {
          "examples": [],
          "type": "string",
          "title": "Used for analytis by hybrid gateway",
          "description": "For OSS gateway use an empty string.",
          "default": ""
        },
        "purge_interval": {
          "examples": [
            1
          ],
          "type": "integer",
          "title": "The interval length for purging analytics",
          "description": "Set the interval length on how often the tyk Gateway will purge analytics data. This value is in seconds and defaults to 10 seconds.",
          "default": 10
        },
        "ignored_ips": {
          "items": {},
          "type": "array",
          "title": "The ignored_ips schema",
          "description": "An explanation about the purpose of this instance.",
          "default": [],
          "examples": [
            []
          ],
          "additionalItems": true
        },
        "enable_detailed_recording": {
          "examples": [],
          "type": "boolean",
          "title": "Recording full request and response content",
          "description": "Set this value to `true` to have Tyk store the inbound request and outbound response data in HTTP Wire format as part of the Analytics data. Please note, this will greatly increase your analytics DB size and can cause performance degradation on analytics processing by the Dashboard. This setting can be overridden with an organisation flag, enabed at an API level, or on individual Key level.",
          "default": false
        }
      },
      "type": "object",
      "title": "Configurations for analytics",
      "description": "`analytics_config` contains setting for analytics captured by the gateway",
      "default": {
        "type": "",
        "purge_interval": 10,
        "enable_detailed_recording": false
      },
      "examples": [],
      "required": [
        "type"
      ],
      "additionalProperties": true
    },
    "health_check": {
      "properties": {
        "enable_health_checks": {
          "examples": [
            true
          ],
          "type": "boolean",
          "title": "The enable_health_checks schema",
          "description": "An explanation about the purpose of this instance.",
          "default": false
        },
        "health_check_value_timeouts": {
          "examples": [
            60
          ],
          "type": "integer",
          "title": "The timeout for health checks",
          "description": "health_check_value_timeouts is deprecated!",
          "default": 0
        }
      },
      "type": "object",
      "title": "The health_check schema - deprecated!!!",
      "description": "An explanation about the purpose of this instance.",
      "default": {
        "enable_health_checks": false
      },
      "examples": [],
      "required": [
        "enable_health_checks"
      ],
      "additionalProperties": true
    },
    "optimisations_use_async_session_write": {
      "examples": [
        false
      ],
      "type": "boolean",
      "title": "The optimisations_use_async_session_write schema",
      "description": "An explanation about the purpose of this instance.",
      "default": false
    },
    "enable_non_transactional_rate_limiter": {
      "examples": [
        true
      ],
      "type": "boolean",
      "title": "The enable_non_transactional_rate_limiter schema",
      "description": "An explanation about the purpose of this instance.",
      "default": false
    },
    "enable_sentinel_rate_limiter": {
      "examples": [
        false
      ],
      "type": "boolean",
      "title": "The enable_sentinel_rate_limiter schema",
      "description": "An explanation about the purpose of this instance.",
      "default": false
    },
    "enable_redis_rolling_limiter": {
      "examples": [
        false
      ],
      "type": "boolean",
      "title": "The enable_redis_rolling_limiter schema",
      "description": "An explanation about the purpose of this instance.",
      "default": false
    },
    "allow_master_keys": {
      "examples": [
        false
      ],
      "type": "boolean",
      "title": "The allow_master_keys schema",
      "description": "An explanation about the purpose of this instance.",
      "default": false
    },
    "policies": {
      "properties": {
        "policy_source": {
          "examples": [],
          "type": "string",
          "title": "Set the policies source",
          "description": "Set to `file` to load policies file from the file system. Set to `service` to use the Dashboard service.",
          "default": "file"
        },
        "policy_record_name": {
          "examples": [],
          "type": "string",
          "title": "Specifies the path of your JSON file containing the available policies",
          "description": "This option is required if `policies.policy_source` is set to `file`.",
          "default": "/opt/tyk-gateway/policies/policies.json"
        },
        "policy_path": {
          "examples": [],
          "type": "string",
          "title": "Specifies the path of the directory  containing the available policies",
          "description": "This option is required if `policies.policy_source` is set to `file`.",
          "default": "/opt/tyk-gateway/policies/"
        }
      },
      "type": "object",
      "title": "The policies schema",
      "description": "Tell the gateway where to pick the policies from.",
      "default": {
        "policy_source": "file",
        "policy_record_name": "/opt/tyk-gateway/policies/policies.json"
      },
      "examples": [
        {
          "policy_source": "file",
          "policy_record_name": "/opt/tyk-gateway/policies/policies.json"
        }
      ],
      "required": [
        "policy_source",
        "policy_record_name"
      ],
      "additionalProperties": true
    },
    "hash_keys": {
      "examples": [
        false
      ],
      "type": "boolean",
      "title": "Set the format of the auth token keys in Redis",
      "description": "True value will use the hashed value of the key as the key in Redis.",
      "default": true
    },
    "close_connections": {
      "examples": [],
      "type": "boolean",
      "title": "The close_connections schema",
      "description": "An explanation about the purpose of this instance.",
      "default": false
    },
    "http_server_options": {
      "properties": {
        "enable_websockets": {
          "examples": [
            true
          ],
          "type": "boolean",
          "title": "The enable_websockets schema",
          "description": "An explanation about the purpose of this instance.",
          "default": false
        }
      },
      "type": "object",
      "title": "The http_server_options schema",
      "description": "An explanation about the purpose of this instance.",
      "default": {},
      "examples": [
        {
          "enable_websockets": true
        }
      ],
      "required": [
        "enable_websockets"
      ],
      "additionalProperties": true
    },
    "allow_insecure_configs": {
      "examples": [
        true
      ],
      "type": "boolean",
      "title": "The allow_insecure_configs schema",
      "description": "An explanation about the purpose of this instance.",
      "default": false
    },
    "coprocess_options": {
      "properties": {
        "enable_coprocess": {
          "examples": [
            true
          ],
          "type": "boolean",
          "title": "The enable_coprocess schema",
          "description": "An explanation about the purpose of this instance.",
          "default": false
        },
        "coprocess_grpc_server": {
          "examples": [
            ""
          ],
          "type": "string",
          "title": "The coprocess_grpc_server schema",
          "description": "An explanation about the purpose of this instance.",
          "default": ""
        }
      },
      "type": "object",
      "title": "The coprocess_options schema",
      "description": "An explanation about the purpose of this instance.",
      "default": {},
      "examples": [
        {
          "enable_coprocess": true,
          "coprocess_grpc_server": ""
        }
      ],
      "required": [
        "enable_coprocess",
        "coprocess_grpc_server"
      ],
      "additionalProperties": true
    },
    "enable_bundle_downloader": {
      "examples": [
        true
      ],
      "type": "boolean",
      "title": "The enable_bundle_downloader schema",
      "description": "An explanation about the purpose of this instance.",
      "default": false
    },
    "bundle_base_url": {
      "examples": [],
      "type": "string",
      "title": "The bundle_base_url schema",
      "description": "An explanation about the purpose of this instance.",
      "default": ""
    },
    "global_session_lifetime": {
      "examples": [
        100
      ],
      "type": "integer",
      "title": "The global_session_lifetime schema",
      "description": "An explanation about the purpose of this instance.",
      "default": 0
    },
    "force_global_session_lifetime": {
      "examples": [],
      "type": "boolean",
      "title": "The force_global_session_lifetime schema",
      "description": "An explanation about the purpose of this instance.",
      "default": false
    },
    "max_idle_connections_per_host": {
      "examples": [
        500
      ],
      "type": "integer",
      "title": "The max_idle_connections_per_host schema",
      "description": "An explanation about the purpose of this instance.",
      "default": 0
    },
    "enable_jsvm": {
      "examples": [
        true
      ],
      "type": "boolean",
      "title": "The enable_jsvm schema",
      "description": "An explanation about the purpose of this instance.",
      "default": false
    },
    "enable_hashed_keys_listing": {
      "examples": [
        true
      ],
      "type": "boolean",
      "title": "The enable_hashed_keys_listing schema",
      "description": "An explanation about the purpose of this instance.",
      "default": false
    }
  },
  "examples": [
    {
      "_description": "Config example with JSVM enabled",
      "listen_port": 8080,
      "log_level": "info",
      "secret": "foo",
      "use_db_app_configs": false,
      "app_path": "/opt/tyk-gateway/apps/",
      "storage": {
        "type": "redis",
        "host": "tyk-redis",
        "port": 6379
      },
      "policies": {
        "policy_source": "file",
        "policy_record_name": "/opt/tyk-gateway/policies/policies.json"
      },
      "enable_analytics": false,
      "analytics_config": {
        "type": ""
      },
      "allow_insecure_configs": true,
      "hash_keys": true,
      "enable_hashed_keys_listing": true,
      "global_session_lifetime": 100,
      "enable_jsvm": true,
      "enable_bundle_downloader": true,
      "bundle_base_url": "",
      "tyk_js_path": "/opt/tyk-gateway/js/tyk.js",
      "middleware_path": "/opt/tyk-gateway/middleware"
    }
  ],
  "additionalProperties": true,
  "default": {
    "_description": "Bare minimum config",
    "listen_port": 8080,
    "log_level": "info",
    "secret": "foo",
    "use_db_app_configs": false,
    "app_path": "/opt/tyk-gateway/apps/",
    "storage": {
      "type": "redis",
      "host": "tyk-redis",
      "port": 6379
    },
    "policies": {
      "policy_source": "file",
      "policy_record_name": "/opt/tyk-gateway/policies/policies.json"
    },
    "enable_analytics": false,
    "analytics_config": {
      "type": ""
    }
  },
  "required": [
    "listen_port",
    "secret",
    "use_db_app_configs",
    "app_path",
    "storage",
    "policies"
  ]
}
