グループセキュリティ設定API
- プラン: Ultimate
- 提供形態: GitLab.com、GitLab Self-Managed、GitLab Dedicated
グループのセキュリティ設定に対するすべてのAPIコールは、認証される必要があります。
ユーザーがプライベートグループのメンバーでない場合、プライベートグループに対するリクエストは、404 Not Foundステータスコードを返します。
グループセキュリティ設定を更新
指定されたグループのグループ設定を更新します。
前提条件:
- グループのセキュリティマネージャー、メンテナー、またはオーナーのロールが必要です。
PUT /groups/:id/security_settings| 属性 | 型 | 必須 | 説明 |
|---|---|---|---|
id | 整数または文字列 | はい | グループのID、またはURLエンコードされたパス。 |
secret_push_protection_enabled | ブール値 | はい | グループ内のプロジェクトでシークレットプッシュ保護を有効にします。 |
projects_to_exclude | 整数の配列 | いいえ | シークレットプッシュ保護から除外するプロジェクトのID。 |
curl --request PUT \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/groups/7/security_settings?secret_push_protection_enabled=true&projects_to_exclude[]=1&projects_to_exclude[]=2"レスポンス例:
{
"secret_push_protection_enabled": true,
"errors": []
}