> For the complete documentation index, see [llms.txt](https://help.aikido.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.aikido.dev/docs/docs-ja/autofix-to/connect-private-packages/google-artifact-registry-private-packages.md).

# Google Artifact Registry - プライベートパッケージ

Google Artifact Registry に保存されたプライベートパッケージは、AutoFix によって以下から取得できます **Poetry、UV、NPM、PNPM、Yarn、Bun、Go の AutoFix**。Google Artifact Registry への認証は、以下を通じて行えます [Workload Identity Federation](#using-workload-identity-federation) または [サービスアカウント](#using-a-service-account).

## Workload Identity Federation を使用する

Workload Identity Federation を使用すると、Aikido と認証情報を共有することなく、Aikido の読み取りロールに Google Artifact Registry へのアクセス権を付与できます。これは **推奨される方法です** Google Artifact Registry でホストされるプライベートパッケージを設定するための。

### Google Cloud Console でのセットアップ

#### ステップ 1: Workload Identity Pool と AWS Provider を作成する

1. Google Cloud Console を開き、 [**IAM & Admin** > **Workload Identity Federation**](https://console.cloud.google.com/iam-admin/workload-identity-pools)**.**
2. クリックします **+ はじめに** （または **+ Pool を作成** （すでに Pool を設定している場合）。
3. **Pool に名前を付けます:** 入力してください `aikido-identity-pool` を名前として入力し、 **続行**.
4. **Pool に Provider を追加します:**
   * 選択します **AWS** から *プロバイダを選択* ドロップダウンリスト
   * 次を入力します **Provider 名:** `aws-provider`
   * Aikido の **AWS アカウント ID:** `881830977366`
   * クリックします **続行**.
5. **Provider の属性を構成します:**
   * 次の項目の下で **属性マッピング**では、Google は自動的に `google.subject` を `aws.arn`をマッピングします。これは既定のままにするか、特定の属性抽出を行いたい場合は変更してください。
   * クリックします **Save** を行うと、Pool と Provider が作成されます。

#### ステップ 2: フェデレーションされた ID の JSON をダウンロードする

1. へ移動 [aikido-identity-pool](http://console.cloud.google.com/iam-admin/workload-identity-pools/pool/aikido-identity-pool) 詳細
2. クリックします **+ アクセスを許可**
3. フェデレーション ID を使用してアクセスを許可を使う
4. クリックします `設定をダウンロード` して設定 JSON を取得します

#### ステップ 3: Artifact Registry でアクセスを許可する

1. 次へ移動します： [Artifact Registry](https://console.cloud.google.com/artifacts)
2. Aikido にアクセスを許可したいリポジトリを選択します
3. クリックします **権限** を上部メニューで選択します（これはリポジトリを選択した場合にのみ表示されます）
4. クリックします **プリンシパルを追加**
5. 次の **新しいプリンシパル** テキストボックスに次のプリンシパルを入力し、 `<project-id>` を 12 桁のプロジェクト ID に置き換えます:

```
principalSet://iam.googleapis.com/projects/<project-id>/locations/global/workloadIdentityPools/aikido-identity-pool/attribute.aws_role/arn:aws:sts::881830977366:assumed-role/autofix-codeartifact-readonly-role
```

6. **割り当て** その `Artifact Registry Reader` ロール
7. クリックします **Save**

### **Aikido UI でのセットアップ**

Google Artifact Registry は現在、Poetry、UV、NPM、PNPM、Yarn、Bun、Go の AutoFix のみをサポートしています。GCP 認証情報は、プライベートパッケージ設定内の Google Artifact Registry セクションで設定できます。

GCP コンソールでの手順が完了したら、以下の手順に従って AutoFix がプライベートレジストリで認証できるように設定できます:

1. へ移動 [AutoFix > 設定](https://app.aikido.dev/issues/fix/settings) Aikido UI のページ
2. をクリックします **+ レジストリを接続**を選ぶと、設定モーダルが表示されます

   <figure><img src="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2FV6ryaoVn4XikrP8Nf2rw%2Fimage.png?alt=media&amp;token=002a64aa-4b15-4ef7-8b2c-ebc57273e2f7" alt=""><figcaption></figcaption></figure>
3. Google Artifact Registry を選択:\
   ![](https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2FlqcwCs1BWmmMKocsCZz2%2Fimage.png?alt=media\&token=5c076f60-d923-460b-bcb5-4fbe90d924a6)
4. 保存した **JSON 設定** を上のステップ 3 の **GCP 認証情報** 欄に貼り付け
5. クリックします **Save** て設定を保存します。

## サービス アカウントを使用する

### Google Cloud Console でのセットアップ

#### ステップ 1: サービス アカウントを作成する

まず、Google Cloud プロジェクトにサービス アカウントを作成します:

1. Google Cloud Console に移動します。
2. 次へ移動します: [**IAM & Admin** > **サービス アカウント**](https://console.cloud.google.com/iam-admin/serviceaccounts).
3. クリックします **サービス アカウントを作成**.
4. 次の内容を入力します **サービス アカウント名** たとえば `Aikido Artifact Registry Reader` に移動し、 **作成して続行**.
5. サービス アカウントに次の権限を付与します **Artifact Registry Reader** ロールが割り当てられている必要があります。
6. クリックします **続行** と **完了**.

#### ステップ 2: サービス アカウントのキーを作成する <a href="#id-2-create-a-key-for-the-service-account" id="id-2-create-a-key-for-the-service-account"></a>

1. On the **サービス アカウント** ページで、先ほど作成したサービス アカウントを見つけます。
2. 右側の 3 つの点をクリックし、 **キーを管理**.
3. クリックします **キーを追加** > **新しいキーを作成**.
4. 選択 **JSON** に移動し、 **作成**.
5. 保存します **JSON キーファイル** を安全な場所に。

### **Aikido UI でのセットアップ**

Google Artifact Registry は現在、Poetry、UV、NPM、PNPM、Yarn、Bun、Go の AutoFix のみをサポートしています。GCP 認証情報は、プライベートパッケージ設定内の Google Artifact Registry セクションで設定できます。

GCP コンソールでの手順が完了したら、以下の手順に従って AutoFix がプライベートレジストリで認証できるように設定できます:

1. へ移動 [AutoFix > 設定](https://app.aikido.dev/issues/fix/settings) Aikido UI のページ
2. をクリックします **+ レジストリを接続**を選ぶと、設定モーダルが表示されます

   <figure><img src="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2FV6ryaoVn4XikrP8Nf2rw%2Fimage.png?alt=media&amp;token=002a64aa-4b15-4ef7-8b2c-ebc57273e2f7" alt=""><figcaption></figcaption></figure>
3. Google Artifact Registry を選択:\
   ![](https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2FlqcwCs1BWmmMKocsCZz2%2Fimage.png?alt=media\&token=5c076f60-d923-460b-bcb5-4fbe90d924a6)
4. 保存した **サービス アカウント キー** を上のステップ 2 の **GCP 認証情報** 欄に貼り付け
5. クリックします **Save** て設定を保存します。

### Go の追加設定

Go のモジュールパスでは、どのレジストリがモジュールをホストしているかが分からないため、Go には **2 つの環境変数**.

AutoFix → 設定 → レジストリに接続 → で設定してください [環境変数を設定](/docs/docs-ja/autofix-to/connect-private-packages/custom-config-private-packages.md):

* `GOPROXY`：まずはあなたの Artifact Registry の Go リポジトリを、次に公開 Go プロキシを指定します。例： `https://<location>-go.pkg.dev/<project-id>/<repository>,https://proxy.golang.org,direct`
* `GONOSUMDB`：プライベートモジュールのモジュールパスです。これにより Go はそれらを公開チェックサムデータベースと照合しません。例： `github.com/<your-org>/*`

<figure><img src="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2FY1NxUcwJW9VXXDxoujp7%2Fimage.png?alt=media&amp;token=0878701e-caa6-49ce-9f89-e76bc8d17099" alt=""><figcaption></figcaption></figure>

AutoFix は GCP 認証情報を使用して、すべての `go.pkg.dev` ホストに認証します `GOPROXY`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.aikido.dev/docs/docs-ja/autofix-to/connect-private-packages/google-artifact-registry-private-packages.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
