検索

6.5. API を使用したリポジトリーのアクセス設定の調整

download PDF

API を使用してリポジトリーのユーザーアカウントまたはロボットアカウントのアクセス設定を調整するには、次の手順に従います。

前提条件

  • ユーザーアカウントまたはロボットアカウントを作成した。
  • OAuth アクセストークンを作成 した。
  • config.yaml ファイルで BROWSER_API_CALLS_XHR_ONLY: false を設定した。

手順

  1. ユーザーの権限を変更するには、次の PUT /api/v1/repository/{repository}/permissions/user/{username} コマンドを入力します。

    $ curl -X PUT \
      -H "Authorization: Bearer <bearer_token>" \
      -H "Content-Type: application/json" \
      -d '{"role": "admin"}' \
      https://<quay-server.example.com>/api/v1/repository/<namespace>/<repository>/permissions/user/<username>

    出力例

    {"role": "admin", "name": "quayadmin+test", "is_robot": true, "avatar": {"name": "quayadmin+test", "hash": "ca9afae0a9d3ca322fc8a7a866e8476dd6c98de543decd186ae090e420a88feb", "color": "#8c564b", "kind": "robot"}}

  2. 現在の権限を削除するには、DELETE /api/v1/repository/{repository}/permissions/user/{username} コマンドを入力します。

    $ curl -X DELETE \
      -H "Authorization: Bearer <bearer_token>" \
      -H "Accept: application/json" \
      https://<quay-server.example.com>/api/v1/repository/<namespace>/<repository>/permissions/user/<username>

    このコマンドは CLI に出力を返しません。GET /api/v1/repository/{repository}/permissions/user/ コマンドを入力すると、権限が削除されたことを確認できます。

    $ curl -X GET \
      -H "Authorization: Bearer <bearer_token>" \
      -H "Accept: application/json" \
      https://<quay-server.example.com>/api/v1/repository/<namespace>/<repository>/permissions/user/<username>/

    出力例

    {"message":"User does not have permission for repo."}

Red Hat logoGithubRedditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

© 2024 Red Hat, Inc.