Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Restrict POST /v3/service_plans/:guid/visibility to only support appending orgs (and not changing visibility type)

オープン
#4,606 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

関連するプルリクエストがすでにマージされています。

  • #4609 @philippthun による — マージ済み

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
ruby
領域
api

調査の方向性

POST /v3/service_plans/:guid/visibility と PATCH /v3/service_plans/:guid/visibility のエントリーポイントから始め、それぞれが可視性の種類と組織の関連付けをどのように処理しているかを比較します。POST がその種類をすでに使用しているプランに対してのみ組織可視性を受け付け、PATCH が引き続き可視性の種類の変更を担当し、無効な POST リクエストが適切なエラーを返すようになれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Summary

The current implementation of POST /v3/service_plans/:guid/visibility is somewhat inconsistent with REST semantics and allows operations beyond simply appending organizations. Specifically, it can also change the visibility type (e.g., to public or admin), which overlaps with the semantics of PATCH /v3/service_plans/:guid/visibility.

Problem

From a REST perspective:

  • POST should be used to add new resources or associations (in this case, adding orgs to an existing visibility list).
  • PATCH should be used to modify existing state (e.g., changing the visibility type to public or admin).

Currently, POST behaves more like a PATCH, as it allows changing the visibility type, not just appending orgs. This blurs the intended semantics and increases the risk of accidental type changes when clients are only trying to add organizations.

Proposed Change

I propose tightening the semantics of POST /v3/service_plans/:guid/visibility:

  • Allow POST only when type = organization.
  • Ensure the target plan already has visibility type organization. If the plan’s visibility type is not organization, the request should fail with an appropriate error (e.g., 422 Unprocessable Entity).

This ensures that:

  • POST is used solely for appending organizations to organization-scoped plans.
  • PATCH remains the correct method for changing the visibility type.
Compatibility / Migration

This change could break existing clients that currently use POST to modify visibility type. However, those clients can simply switch to using PATCH, which already supports the same behavior. This aligns both endpoints with clearer REST semantics going forward.

主要言語
Ruby
スター
207
フォーク
374
平均マージ
2日 19時間
マージ済み PR(30日)
68

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

cloudfoundry/cloud_controller_ng のほかの issue

cloudfoundry/cloud_controller_ng の issue をすべて見る

似ている issue

Ruby の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。