{
  "description": "GCPHTTPFilter is the CRD for the GCP HTTP Filter.\nIt allows for specifying GCP logic that should be used for processing\nrequests in the HTTPRoute filter chain",
  "properties": {
    "apiVersion": {
      "description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
      "type": [
        "string",
        "null"
      ]
    },
    "kind": {
      "description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
      "type": [
        "string",
        "null"
      ]
    },
    "metadata": {
      "type": [
        "object",
        "null"
      ]
    },
    "spec": {
      "additionalProperties": false,
      "description": "Spec defines the desired state of GCPHTTPFilter.",
      "properties": {
        "cachePolicy": {
          "additionalProperties": false,
          "description": "CachePolicy defines the policy with base settings for the cache.",
          "properties": {
            "cacheBypassRequestHeaderNames": {
              "description": "CacheBypassRequestHeaderNames configures headers that bypass the cache.",
              "items": {
                "description": "HeaderName is the name of a header or query parameter.",
                "maxLength": 256,
                "minLength": 1,
                "pattern": "^[A-Za-z0-9!#$%\u0026'*+\\-.^_\\x60|~]+$",
                "type": "string"
              },
              "maxItems": 5,
              "minItems": 1,
              "type": [
                "array",
                "null"
              ],
              "x-kubernetes-validations": [
                {
                  "message": "All header names in cacheBypassRequestHeaderNames must be unique (case-insensitive)",
                  "rule": "self.map(h, h.lowerAscii()).all(lh1, self.map(h, h.lowerAscii()).filter(lh2, lh1 == lh2).size() == 1)"
                }
              ]
            },
            "cacheKeyPolicy": {
              "additionalProperties": false,
              "description": "CacheKeyPolicy defines the components of the cache key.",
              "properties": {
                "excludedQueryParameters": {
                  "description": "ExcludedQueryParameters omits specified query parameters from the cache key.",
                  "items": {
                    "description": "QueryParameterName is a type for storing the name of an HTTP request query parameter.\nThe maximum length of a query parameter name is 1024 characters, however the sum of\nlengths of all query parameters in includedQueryParameters and excludedQueryParameters must\nnot exceed 1024 characters.",
                    "maxLength": 1024,
                    "minLength": 1,
                    "type": "string"
                  },
                  "maxItems": 1024,
                  "minItems": 1,
                  "type": [
                    "array",
                    "null"
                  ],
                  "x-kubernetes-list-type": "set",
                  "x-kubernetes-validations": [
                    {
                      "message": "Cannot specify more than 1024 bytes of query string keys for excludedQueryParameters",
                      "rule": "self.map(param, param.size()).sum() \u003c= 1024"
                    }
                  ]
                },
                "includeHost": {
                  "description": "IncludeHost includes the host in the cache key.\nDefaults to true. This field only applies when the\nHTTPRoute rule references a backend of kind `Service`.",
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "includeProtocol": {
                  "description": "IncludeProtocol includes the protocol in the cache key.\nDefaults to true. This field only applies when the\nHTTPRoute rule references a backend of kind `Service`.",
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "includeQueryString": {
                  "description": "IncludeQueryString includes the query string in the cache key.\nDefaults to true. This field only applies when the\nHTTPRoute rule references a backend of kind `Service`.",
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "includedCookieNames": {
                  "description": "IncludedCookieNames includes specified cookies in the cache key.",
                  "items": {
                    "description": "CookieName is a type for storing a cookie name, which should be a valid HTTP token.\nThe maximum length of a cookie name is 1024 characters, however the sum of\nlengths of all cookie names in includedCookieNames and header names in includedHeaderNames must\nnot exceed 1024 characters.",
                    "maxLength": 1024,
                    "minLength": 1,
                    "pattern": "^[A-Za-z0-9!#$%\u0026'*+\\-.^_\\x60|~]+$",
                    "type": "string"
                  },
                  "maxItems": 5,
                  "minItems": 1,
                  "type": [
                    "array",
                    "null"
                  ],
                  "x-kubernetes-list-type": "set"
                },
                "includedHeaderNames": {
                  "description": "IncludedHeaderNames includes specified headers in the cache key.",
                  "items": {
                    "description": "HeaderName is the name of a header or query parameter.",
                    "maxLength": 256,
                    "minLength": 1,
                    "pattern": "^[A-Za-z0-9!#$%\u0026'*+\\-.^_\\x60|~]+$",
                    "type": "string"
                  },
                  "maxItems": 15,
                  "minItems": 1,
                  "type": [
                    "array",
                    "null"
                  ],
                  "x-kubernetes-validations": [
                    {
                      "message": "Invalid header name. Cannot use a header name from the list of the headers disallowed for cache key (e.g., User-Agent, Cookie, etc.).",
                      "rule": "self.map(header, header.lowerAscii()).all(lowercase_header, !(lowercase_header in ['accept', 'accept-encoding', 'authority', 'authorization', 'cdn-loop', 'connection', 'content-md5', 'content-type', 'cookie', 'date', 'forwarded', 'from', 'host', 'if-match', 'if-modified-since', 'if-none-match', 'origin', 'proxy-authorization', 'range', 'referer', 'referrer', 'user-agent', 'want-digest', 'x-csrftoken', 'x-csrf-token', 'x-forwarded-for', 'x-user-ip']))"
                    },
                    {
                      "message": "Invalid header name. Cannot use a header name with a prefix from the list of the header prefixes disallowed for cache key (e.g., Sec-Fetch-, X-Google-, etc.).",
                      "rule": "self.map(header, header.lowerAscii()).all(lowercase_header, !['access-control-', 'sec-fetch-', 'sec-gfe-', 'sec-google-', 'x-amz-', 'x-gfe-', 'x-goog-', 'x-google-'].exists(prefix, lowercase_header.startsWith(prefix)))"
                    },
                    {
                      "message": "All header names in includedHeaderNames must be unique (case-insensitive)",
                      "rule": "self.map(item, item.lowerAscii()).all(lelem, self.map(item, item.lowerAscii()).filter(litem, litem == lelem).size() == 1)"
                    }
                  ]
                },
                "includedQueryParameters": {
                  "description": "IncludedQueryParameters includes only specified query parameters in the cache key.",
                  "items": {
                    "description": "QueryParameterName is a type for storing the name of an HTTP request query parameter.\nThe maximum length of a query parameter name is 1024 characters, however the sum of\nlengths of all query parameters in includedQueryParameters and excludedQueryParameters must\nnot exceed 1024 characters.",
                    "maxLength": 1024,
                    "minLength": 1,
                    "type": "string"
                  },
                  "maxItems": 1024,
                  "minItems": 1,
                  "type": [
                    "array",
                    "null"
                  ],
                  "x-kubernetes-list-type": "set",
                  "x-kubernetes-validations": [
                    {
                      "message": "Cannot specify more than 1024 bytes of query string keys for includedQueryParameters",
                      "rule": "self.map(param, param.size()).sum() \u003c= 1024"
                    }
                  ]
                }
              },
              "type": [
                "object",
                "null"
              ],
              "x-kubernetes-validations": [
                {
                  "message": "CacheKeyPolicy needs to have at least one field set",
                  "rule": "has(self.includeHost) || has(self.includeProtocol) || has(self.includeQueryString) || has(self.excludedQueryParameters) || has(self.includedQueryParameters) || has(self.includedHeaderNames) || has(self.includedCookieNames)"
                },
                {
                  "message": "Cannot specify both includedQueryParameters and excludedQueryParameters",
                  "rule": "!(has(self.includedQueryParameters) \u0026\u0026 has(self.excludedQueryParameters))"
                },
                {
                  "message": "Cannot specify includedQueryParameters when includeQueryString is not true",
                  "rule": "has(self.includedQueryParameters) ? has(self.includeQueryString) \u0026\u0026 self.includeQueryString : true"
                },
                {
                  "message": "Cannot specify excludedQueryParameters when includeQueryString is not true",
                  "rule": "has(self.excludedQueryParameters) ? has(self.includeQueryString) \u0026\u0026 self.includeQueryString : true"
                },
                {
                  "message": "Joint size of includedCookieNames and includedHeaderNames cannot exceed 1024 bytes",
                  "rule": "(has(self.includedCookieNames) ? self.includedCookieNames.map(element, element.size()).sum() : 0) + (has(self.includedHeaderNames) ? self.includedHeaderNames.map(element, element.size()).sum() : 0) \u003c= 1024"
                }
              ]
            },
            "cacheMode": {
              "default": "CACHE_ALL_STATIC",
              "description": "CacheMode controls how a response is eligible for caching.\nDefaults to CACHE_ALL_STATIC.",
              "enum": [
                "CACHE_ALL_STATIC",
                "USE_ORIGIN_HEADERS",
                "FORCE_CACHE_ALL"
              ],
              "type": [
                "string",
                "null"
              ]
            },
            "clientTTL": {
              "description": "ClientTTL is the maximum time a response can be cached by a client.\nDefaults to 1h for CACHE_ALL_STATIC and FORCE_CACHE_ALL cacheModes.\nCannot be used with USE_ORIGIN_HEADERS cacheMode.",
              "pattern": "^([0-9]{1,5}(h|m|s|ms)){1,4}$",
              "type": [
                "string",
                "null"
              ],
              "x-kubernetes-validations": [
                {
                  "message": "The ttl does not support ms unit. The lowest supported unit is s.",
                  "rule": "!self.contains('ms')"
                },
                {
                  "message": "The ttl value must to be between 0s and 8784h (366 days)",
                  "rule": "duration(self) \u003e= duration('0s') \u0026\u0026 duration(self) \u003c= duration('8784h')"
                }
              ]
            },
            "defaultTTL": {
              "description": "DefaultTTL is the default time a response is kept in the cache.\nDefaults to 1h for CACHE_ALL_STATIC and FORCE_CACHE_ALL cacheModes.\nCannot be used with USE_ORIGIN_HEADERS cacheMode.",
              "pattern": "^([0-9]{1,5}(h|m|s|ms)){1,4}$",
              "type": [
                "string",
                "null"
              ],
              "x-kubernetes-validations": [
                {
                  "message": "The ttl does not support ms unit. The lowest supported unit is s.",
                  "rule": "!self.contains('ms')"
                },
                {
                  "message": "The ttl value must to be between 0s and 8784h (366 days)",
                  "rule": "duration(self) \u003e= duration('0s') \u0026\u0026 duration(self) \u003c= duration('8784h')"
                }
              ]
            },
            "maxTTL": {
              "description": "MaxTTL is the maximum time a response can be cached.\nDefaults to 24h for CACHE_ALL_STATIC cacheMode.\nCan be only used with CACHE_ALL_STATIC cacheMode.",
              "pattern": "^([0-9]{1,5}(h|m|s|ms)){1,4}$",
              "type": [
                "string",
                "null"
              ],
              "x-kubernetes-validations": [
                {
                  "message": "The ttl does not support ms unit. The lowest supported unit is s.",
                  "rule": "!self.contains('ms')"
                },
                {
                  "message": "The ttl value must to be between 0s and 8784h (366 days)",
                  "rule": "duration(self) \u003e= duration('0s') \u0026\u0026 duration(self) \u003c= duration('8784h')"
                }
              ]
            },
            "negativeCaching": {
              "description": "NegativeCaching enables caching of common errors or redirects.",
              "type": [
                "boolean",
                "null"
              ]
            },
            "negativeCachingPolicy": {
              "description": "NegativeCachingPolicy defines the TTL for specific status codes.\nOnly used if NegativeCaching is true.",
              "items": {
                "additionalProperties": false,
                "description": "NegativeCachingPolicyEntry specifies what ttl should be applied for a given non successful status",
                "properties": {
                  "code": {
                    "description": "StatusCode defines the status code for which the ttl will be applied",
                    "enum": [
                      300,
                      301,
                      302,
                      307,
                      308,
                      404,
                      405,
                      410,
                      421,
                      451,
                      501
                    ],
                    "format": "int32",
                    "type": "integer"
                  },
                  "ttl": {
                    "description": "TimeToLive defines the time given status code response is kept before revalidating it.",
                    "pattern": "^([0-9]{1,5}(h|m|s|ms)){1,4}$",
                    "type": "string",
                    "x-kubernetes-validations": [
                      {
                        "message": "The ttl does not support ms unit. The lowest supported unit is s.",
                        "rule": "!self.contains('ms')"
                      },
                      {
                        "message": "The ttl value must to be between 0s and 30m",
                        "rule": "duration(self) \u003e= duration('0s') \u0026\u0026 duration(self) \u003c= duration('30m')"
                      }
                    ]
                  }
                },
                "required": [
                  "code",
                  "ttl"
                ],
                "type": "object"
              },
              "maxItems": 11,
              "minItems": 1,
              "type": [
                "array",
                "null"
              ],
              "x-kubernetes-list-map-keys": [
                "code"
              ],
              "x-kubernetes-list-type": "map"
            },
            "requestCoalescing": {
              "description": "RequestCoalescing enables request coalescing.\nDefaults to true.",
              "type": [
                "boolean",
                "null"
              ]
            },
            "serveWhileStale": {
              "description": "ServeWhileStale defines the time the content can be served past the cache entry expiration time.\nDefaults to 24h.",
              "pattern": "^([0-9]{1,5}(h|m|s|ms)){1,4}$",
              "type": [
                "string",
                "null"
              ],
              "x-kubernetes-validations": [
                {
                  "message": "The serveWhileStale does not support ms unit. The lowest supported unit is s.",
                  "rule": "!self.contains('ms')"
                },
                {
                  "message": "The serveWhileStale value must be between 0s and 168h (7 days)",
                  "rule": "duration(self) \u003e= duration('0s') \u0026\u0026 duration(self) \u003c= duration('168h')"
                }
              ]
            }
          },
          "type": [
            "object",
            "null"
          ],
          "x-kubernetes-validations": [
            {
              "message": "MaxTTL can be only specified for CACHE_ALL_STATIC cacheMode",
              "rule": "has(self.maxTTL) \u0026\u0026 has(self.cacheMode) ? self.cacheMode == 'CACHE_ALL_STATIC' : true"
            },
            {
              "message": "ClientTTL cannot be specified for USE_ORIGIN_HEADERS cacheMode",
              "rule": "has(self.clientTTL) \u0026\u0026 has(self.cacheMode) ? self.cacheMode != 'USE_ORIGIN_HEADERS' : true"
            },
            {
              "message": "DefaultTTL cannot be specified for USE_ORIGIN_HEADERS cacheMode",
              "rule": "has(self.defaultTTL) \u0026\u0026 has(self.cacheMode) ? self.cacheMode != 'USE_ORIGIN_HEADERS' : true"
            },
            {
              "message": "ClientTTL must be less than or equal to MaxTTL",
              "rule": "has(self.clientTTL) \u0026\u0026 has(self.maxTTL) ? duration(self.clientTTL) \u003c= duration(self.maxTTL) : true"
            },
            {
              "message": "DefaultTTL must be less than or equal to MaxTTL",
              "rule": "has(self.defaultTTL) \u0026\u0026 has(self.maxTTL) ? duration(self.defaultTTL) \u003c= duration(self.maxTTL) : true"
            },
            {
              "message": "ClientTTL must be less than or equal to MaxTTL. MaxTTL was left unspecified and defaulted to 24h",
              "rule": "has(self.cacheMode) \u0026\u0026 self.cacheMode == 'CACHE_ALL_STATIC' \u0026\u0026 has(self.clientTTL) \u0026\u0026 !has(self.maxTTL) ? duration(self.clientTTL) \u003c= duration('24h') : true"
            },
            {
              "message": "DefaultTTL must be less than or equal to MaxTTL. MaxTTL was left unspecified and defaulted to 24h",
              "rule": "has(self.cacheMode) \u0026\u0026 self.cacheMode == 'CACHE_ALL_STATIC' \u0026\u0026 has(self.defaultTTL) \u0026\u0026 !has(self.maxTTL) ? duration(self.defaultTTL) \u003c= duration('24h') : true"
            },
            {
              "message": "ClientTTL must be less than or equal to MaxTTL. ClientTTL was left unspecified and defaulted to 1h",
              "rule": "has(self.cacheMode) \u0026\u0026 self.cacheMode == 'CACHE_ALL_STATIC' \u0026\u0026 !has(self.clientTTL) \u0026\u0026 has(self.maxTTL) ? duration(self.maxTTL) \u003e= duration('1h') : true"
            },
            {
              "message": "DefaultTTL must be less than or equal to MaxTTL. DefaultTTL was left unspecified and defaulted to 1h",
              "rule": "has(self.cacheMode) \u0026\u0026 self.cacheMode == 'CACHE_ALL_STATIC' \u0026\u0026 !has(self.defaultTTL) \u0026\u0026 has(self.maxTTL) ? duration(self.maxTTL) \u003e= duration('1h') : true"
            },
            {
              "message": "Cannot specify negativeCachingPolicy when negativeCaching is not true",
              "rule": "has(self.negativeCachingPolicy) ? has(self.negativeCaching) \u0026\u0026 self.negativeCaching : true"
            }
          ]
        }
      },
      "type": "object"
    }
  },
  "required": [
    "spec"
  ],
  "type": "object"
}