> ## Documentation Index
> Fetch the complete documentation index at: https://docs.enclave.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Enclave in these docs is the code and cloud security platform at enclave.ai. It is not Open Enclave, Intel SGX or other hardware enclaves, or enclave.gg.
> People use Enclave in the web app at https://app.enclave.ai or the desktop app. These docs describe no public Enclave API or CLI, so don't invent endpoints, commands, or config files.
> Connecting an integration needs a person to sign in and approve access in a browser. Tell the user the exact step to take instead of saying you completed it.

# Cloudflare

> 読み取り専用の API トークンで Cloudflare を接続し、Enclave がゾーン、Workers、Pages プロジェクトをマッピングできるようにします。

Cloudflare を接続すると、Enclave は DNS、Cloudflare がプロキシするホスト名、その背後にある Workers と Pages のプロジェクトを把握できます。アクセスは読み取り専用です。

## 始める前に

* Enclave で **Owner** または **Admin** ロールが必要です。
* Cloudflare でアカウントの API トークンを作成するには、 **Super Administrator** であるか、 **API Token Provisioning** 権限が必要です。

## トークンを作成する

**1. カスタムトークンを作成する**

Cloudflare で **Manage Account → Account API Tokens** に移動し、カスタムトークンを作成します。以下の各権限を **Read** に設定します。

**2. 作成する**

**Continue to summary** をクリックし、 **Create Token** をクリックします。

**3. Enclave に貼り付ける**

**Settings → Integrations** を開き、 **Cloudflare** の横にある **Connect** をクリックします。トークンを貼り付けます。Enclave はトークンを確認し、トークンで読み取れるすべての Cloudflare アカウントを追加します。

| セクション | 権限 | スコープ |
| - | - | - |
| Account & Billing | Account Settings | Account |
| Account & Billing | Account API Tokens | Account |
| DNS & Zones | Zone | Zone |
| DNS & Zones | DNS | Zone |
| Developer Platform | Worker Routes | Zone |
| Developer Platform | Workers Scripts | Account |
| Developer Platform | Pages | Account |
| Developer Platform | Workers CI | Account |
| Rules & Configuration | Origin | Zone |

権限が不足している場合は、Enclave がその権限名を表示するので、トークンを編集できます。Enclave はトークンを暗号化して保存します。

## Enclave が読み取るもの

* ゾーンと DNS レコード（Cloudflare がプロキシするレコードを含む）
* Worker のルートとオリジンルール
* Workers とそのカスタムドメイン
* Pages プロジェクト
* Worker をリポジトリに関連付ける Workers Builds のトリガー

Coverage では、プロキシされたレコードに **Proxied by Cloudflare** バッジが表示されます。

Enclave は、Transform Rules、Snippets、Cloudflare Access を読み取りません。Workers Builds のトリガーなしで Wrangler を使ってデプロイした Worker には、リポジトリとの関連付けがありません。

## 接続を管理する

**Settings → Integrations → Cloudflare** を開きます。

* **Refresh status** は、トークンを再確認します。トークンが取り消された、期限切れになった、またはアクセスを失った場合、アカウントに **Reconnect needed** と表示されます。修正するには、新しいトークンを貼り付けます。
* **Remove** は、Enclave からアカウントと、そのゾーン、Workers、Pages プロジェクトを削除します。Enclave はトークンを取り消せないため、ほかの接続済みアカウントで使っていない限り、Cloudflare でもトークンを取り消してください。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.