{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-recaptcha/json-schema/google-recaptcha-google-cloud-recaptchaenterprise-v1-firewall-policy-schema.json",
  "title": "GoogleCloudRecaptchaenterpriseV1FirewallPolicy",
  "description": "A FirewallPolicy represents a single matching pattern and resulting actions to take.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-recaptcha-projects-api-openapi.yml#/components/schemas/GoogleCloudRecaptchaenterpriseV1FirewallPolicy",
  "type": "object",
  "properties": {
    "name": {
      "description": "Identifier. The resource name for the FirewallPolicy in the format `projects/{project}/firewallpolicies/{firewallpolicy}`.",
      "type": "string"
    },
    "path": {
      "type": "string",
      "description": "Optional. The path for which this policy applies, specified as a glob pattern. For more information on glob, see the [manual page](https://man7.org/linux/man-pages/man7/glob.7.html). A path has a max length of 200 characters."
    },
    "actions": {
      "items": {
        "$ref": "#/$defs/GoogleCloudRecaptchaenterpriseV1FirewallAction"
      },
      "description": "Optional. The actions that the caller should take regarding user access. There should be at most one terminal action. A terminal action is any action that forces a response, such as `AllowAction`, `BlockAction` or `SubstituteAction`. Zero or more non-terminal actions such as `SetHeader` might be specified. A single policy can contain up to 16 actions.",
      "type": "array"
    },
    "condition": {
      "type": "string",
      "description": "Optional. A CEL (Common Expression Language) conditional expression that specifies if this policy applies to an incoming user request. If this condition evaluates to true and the requested path matched the path pattern, the associated actions should be executed by the caller. The condition string is checked for CEL syntax correctness on creation. For more information, see the [CEL spec](https://github.com/google/cel-spec) and its [language definition](https://github.com/google/cel-spec/blob/master/doc/langdef.md). A condition has a max length of 500 characters."
    },
    "description": {
      "description": "Optional. A description of what this policy aims to achieve, for convenience purposes. The description can at most include 256 UTF-8 characters.",
      "type": "string"
    }
  },
  "$defs": {
    "GoogleCloudRecaptchaenterpriseV1FirewallAction": {
      "description": "An individual action. Each action represents what to do if a policy matches.",
      "properties": {
        "block": {
          "$ref": "#/$defs/GoogleCloudRecaptchaenterpriseV1FirewallActionBlockAction",
          "description": "This action denies access to a given page. The user gets an HTTP error code."
        },
        "redirect": {
          "$ref": "#/$defs/GoogleCloudRecaptchaenterpriseV1FirewallActionRedirectAction",
          "description": "This action redirects the request to a reCAPTCHA interstitial to attach a token."
        },
        "includeRecaptchaScript": {
          "$ref": "#/$defs/GoogleCloudRecaptchaenterpriseV1FirewallActionIncludeRecaptchaScriptAction",
          "description": "This action injects reCAPTCHA JavaScript code into the HTML page returned by the site backend."
        },
        "allow": {
          "$ref": "#/$defs/GoogleCloudRecaptchaenterpriseV1FirewallActionAllowAction",
          "description": "The user request did not match any policy and should be allowed access to the requested resource."
        },
        "substitute": {
          "$ref": "#/$defs/GoogleCloudRecaptchaenterpriseV1FirewallActionSubstituteAction",
          "description": "This action transparently serves a different page to an offending user."
        },
        "setHeader": {
          "$ref": "#/$defs/GoogleCloudRecaptchaenterpriseV1FirewallActionSetHeaderAction",
          "description": "This action sets a custom header but allow the request to continue to the customer backend."
        }
      },
      "type": "object"
    },
    "GoogleCloudRecaptchaenterpriseV1FirewallActionAllowAction": {
      "description": "An allow action continues processing a request unimpeded.",
      "properties": {},
      "type": "object"
    },
    "GoogleCloudRecaptchaenterpriseV1FirewallActionBlockAction": {
      "properties": {},
      "description": "A block action serves an HTTP error code a prevents the request from hitting the backend.",
      "type": "object"
    },
    "GoogleCloudRecaptchaenterpriseV1FirewallActionIncludeRecaptchaScriptAction": {
      "description": "An include reCAPTCHA script action involves injecting reCAPTCHA JavaScript code into the HTML returned by the site backend. This reCAPTCHA script is tasked with collecting user signals on the requested web page, issuing tokens as a cookie within the site domain, and enabling their utilization in subsequent page requests.",
      "type": "object",
      "properties": {}
    },
    "GoogleCloudRecaptchaenterpriseV1FirewallActionRedirectAction": {
      "description": "A redirect action returns a 307 (temporary redirect) response, pointing the user to a reCAPTCHA interstitial page to attach a token.",
      "type": "object",
      "properties": {}
    },
    "GoogleCloudRecaptchaenterpriseV1FirewallActionSetHeaderAction": {
      "description": "A set header action sets a header and forwards the request to the backend. This can be used to trigger custom protection implemented on the backend.",
      "type": "object",
      "properties": {
        "value": {
          "description": "Optional. The header value to set in the request to the backend server.",
          "type": "string"
        },
        "key": {
          "description": "Optional. The header key to set in the request to the backend server.",
          "type": "string"
        }
      }
    },
    "GoogleCloudRecaptchaenterpriseV1FirewallActionSubstituteAction": {
      "type": "object",
      "properties": {
        "path": {
          "description": "Optional. The address to redirect to. The target is a relative path in the current host. Example: \"/blog/404.html\".",
          "type": "string"
        }
      },
      "description": "A substitute action transparently serves a different page than the one requested."
    }
  }
}