---
schema_version: "1"
id: dae704ab05ee5e2b856ab3705d7874563f968cc5f04311ef81c448275f583708
title: Flex Gateway ポリシー開発キット (PDK) の前提条件
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/pdk/1.3/policies-pdk-prerequisites.md
canonical_url: https://docs.mulesoft.com/jp/pdk/1.3/policies-pdk-prerequisites
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 1ab2892298372b99651ba837e3deab94de1a563e73dd0327eca3d7925e1a6b5c
description: MuleSoft Documentation Site
release: "1.3"
latest: false
---
# Flex Gateway ポリシー開発キット (PDK) の前提条件

Flex Gateway ポリシー開発キット (PDK) の使用を開始する前に、以下の前提条件を確認します。

## [](#flex-gateway)Flex Gateway

PDK のチュートリアルでは、​[Flex Gateway がダウンロード済み](https://docs.mulesoft.com/gateway/latest/install)​で、製品に関する予備知識があることを前提としています。

Policies created with PDK might be compatible with Omni Gateway versions that aren’t compatible with PDK’s integration testing framework. The Omni Gateway version used for testing doesn’t affect the functionality of the policy when deployed to a different Omni Gateway version. See the following table to ensure your Omni Gateway’s compatibility:

<table class="tableblock frame-all grid-all fit-content spread">
<colgroup>
<col>
<col>
<col>
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Component</th>
<th class="tableblock halign-left valign-top">Minimum Omni Gateway Version</th>
<th class="tableblock halign-left valign-top">Maximum Omni Gateway Version</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Policies</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">1.6.1</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Latest</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Testing Framework</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">1.6.1</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Latest</p></td>
</tr>
</tbody>
</table>

## [](#rust-requirements)PDK を使用するための Rust の要件

1. Git
    
    ダウンロードとインストールの方法は、 [「Installing Git (Git のインストール)」](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)​を参照してください。
2. Rust プログラミング言語バージョン v1.74.0 ～ v1.83.0:
    
    1. Rust をインストールまたは更新するには、次の curl コマンドを実行します。
        
        ```ssh
        curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
        ```
        
        <table><tbody><tr><td class="icon"><i class="fa icon-note" title="Note"></i></td><td class="content">curl がインストールされていない場合は、 <a href="https://curl.se/download.html" target="_blank" rel="noopener">「Install curl (curl のインストール)」</a>​を参照してください。</td></tr></tbody></table>
    2. PDK で使用される ​`wasm32-wasi`​ コンパイルターゲットは Rust v1.84.0 で非推奨になるため、Rust を最新の互換性のある最新バージョンにダウングレードします。
        
        ```ssh
        rustup default 1.83.0
        ```
3. Rust WebAssembly システムインターフェース (WASI) クレート
    
    Rust WASI をインストールまたは更新するには、次のコマンドを実行します。
    
    ```ssh
    rustup target add wasm32-wasi
    ```
4. Cargo Generate
    
    Cargo Generate をインストールまたは更新するには、次のコマンドを実行します。
    
    ```ssh
    cargo install --locked cargo-generate@0.22.0
    ```

## [](#サポートされているオペレーティングシステム)サポートされているオペレーティングシステム

- macOS
- Ubuntu
    
    Ubuntu を使用するには、​[PDK を使用するための Rust の要件](#rust-requirements)​ をインストールした後で、以下のコマンドを使用して必要なパッケージをインストールします。
    
    ```ssh
    sudo apt install -y build-essential
    sudo apt install -y pkg-config
    sudo apt install -y libssl-dev
    ```
- Windows
    
    <table><tbody><tr><td class="icon"><i class="fa icon-important" title="Important"></i></td><td class="content">PDK では、カスタムポリシーの開発とテストでのみ Windows をサポートしています。ただし、Flex Gateway は本番環境では Windows をサポートしていません。</td></tr></tbody></table>
    
    PDK で提供されている ​`make`​ コマンドを実行するには、以下をインストールします。
    
    1. [Windows の PowerShell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.3)
    2. 次のいずれかの Make:
        
        - [Make for Windows](https://gnuwin32.sourceforge.net/packages/make.htm)
        - Chocolatey:
            
            ```ssh
            choco install make
            ```

## [](#cli)Anypoint CLI

PDK 用の Anypoint CLI を設定する手順は、次のとおりです。

1. [Anypoint CLI 4.x v1.4.4 以降をインストールします](https://docs.mulesoft.com/jp/anypoint-cli/latest/install)​。
    
    <table><tbody><tr><td class="icon"><i class="fa icon-note" title="Note"></i></td><td class="content">自分の Anypoint CLI 4.x バージョンを確認するには、​<a href="https://docs.mulesoft.com/jp/anypoint-cli/latest/install#verify-installation" class="xref page">「Verify the Core Package Version (コアパッケージバージョンを確認する)」</a>​を参照してください。</td></tr></tbody></table>
2. [接続アプリケーション](https://docs.mulesoft.com/jp/access-management/connected-apps-overview)​を使用して、​[Anypoint Platform CLI に対して認証します](https://docs.mulesoft.com/jp/anypoint-cli/latest/auth)​。
    
    接続アプリケーションで認証を行うには、アプリケーションのクライアント ID とクライアントシークレットを提供します。
    
    <table><tbody><tr><td class="icon"><i class="fa icon-note" title="Note"></i></td><td class="content">Anypoint Platform に対する認証では、​<code>[View Organization (組織の表示)]</code>​ および ​<code>[View Environment (環境の表示)]</code>​ スコープに加えて、<a href="https://docs.mulesoft.com/jp/pdk/1.3/policies-pdk-publish-policies" class="xref page">Exchange へのカスタムポリシーのアップロード</a>を完了するために、接続アプリケーションに ​<code>[Exchange Contributor (Exchange コントリビュータ)]</code>​ スコープを適用しておく必要があります。</td></tr></tbody></table>
3. Anypoint CLI PDK プラグインをインストールまたは更新するには、次のコマンドを実行します。
    
    ```ssh
    anypoint-cli-v4 plugins:install anypoint-cli-pdk-plugin
    ```

## [](#docker)Docker

Docker は、PDK で用意されている​[ローカルデバッグ環境](https://docs.mulesoft.com/jp/pdk/1.3/policies-pdk-debug-local)​と​[インテグレーションテストフレームワーク](https://docs.mulesoft.com/jp/pdk/1.3/policies-pdk-integration-tests)​を使用するために必要です。Docker がなくてもポリシーのビルドとパブリッシュは可能です。

Docker をインストールするには、 [「Install Docker (Docker のインストール)」](https://docs.docker.com/get-docker/)​を参照してください。

<table><tbody><tr><td class="icon"><i class="fa icon-important" title="Important"></i></td><td class="content">ポリシーの開発とテストのみが目的であれば、Windows の Docker で Flex Gateway をローカルモードで実行することもできます。ただし、Flex Gateway は本番環境では Windows をサポートしていません。</td></tr></tbody></table>

## [](#visual-studio-推奨-ide)Visual Studio (推奨 IDE)

PDK は、 [Rust in Visual Studio Code プラグイン](https://code.visualstudio.com/docs/languages/rust)​がインストールされていれば、 [Microsoft Visual Studio](https://code.visualstudio.com/)​ など、どの IDE やテキストエディターでも使用できます。

## [](#関連情報)関連情報

- [PDK のアップグレード](https://docs.mulesoft.com/jp/pdk/1.3/policies-pdk-upgrade-pdk)
- [ポリシー開発キットのアーキテクチャの概要](https://docs.mulesoft.com/jp/pdk/1.3/policies-pdk-architecture)
- [カスタムポリシーの開発](https://docs.mulesoft.com/jp/pdk/1.3/policies-pdk-develop-custom-policies)