Restrict POST /v3/service_plans/:guid/visibility to only support appending orgs (and not changing visibility type)
メンテナーはふだん 2 日以内に返信
関連するプルリクエストがすでにマージされています。
- #4609 @philippthun による — マージ済み
評価
調査の方向性
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
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cloudfoundry/cloud_controller_ng のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
cloudfoundry/cloud_controller_ng#5255 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
cloudfoundry/cloud_controller_ng#5347 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
cloudfoundry/cloud_controller_ng#5313 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 50/100
cloudfoundry/cloud_controller_ng#5285 ·
メンテナーはふだん 2 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
cloudfoundry/cloud_controller_ng#5246 ·
メンテナーはふだん 2 日以内に返信
cloudfoundry/cloud_controller_ng の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Homebrew/homebrew-cask#293134 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
notch8/iiif_print#430 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
ActionText::Content#to_markdown: <br> in a table cell and empty <tr> produce malformed Markdown tables対応中かも @azmi2409 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信