Restrict POST /v3/service_plans/:guid/visibility to only support appending orgs (and not changing visibility type)
Les mainteneurs répondent en général sous 2 jours
Une pull request liée a déjà été fusionnée.
- #4609 par @philippthun — fusionnée
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 45/100
Piste de recherche
Commencez par les points d’entrée POST /v3/service_plans/:guid/visibility et PATCH /v3/service_plans/:guid/visibility, en comparant la manière dont chacun gère les types de visibilité et les associations d’organisations. Le travail est terminé lorsque POST n’accepte que la visibilité d’organisation pour les plans utilisant déjà ce type, tandis que PATCH reste responsable de la modification du type de visibilité et que les requêtes POST non valides renvoient une erreur appropriée.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Ruby
- Étoiles
- 207
- Forks
- 373
- Merge moyen
- 3 j 10 h
- PR mergées (30 j)
- 71
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Fournit un Dockerfile ou un fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de cloudfoundry/cloud_controller_ng
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 72/100
cloudfoundry/cloud_controller_ng#5255 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
-
What field should represent "when was this application last refreshed (pushed or restaged)"?Ouverte
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
cloudfoundry/cloud_controller_ng#5347 · 2 commentaires ·
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
cloudfoundry/cloud_controller_ng#5313 ·
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 4/5 3-5 jours Accessibilité débutants 50/100
cloudfoundry/cloud_controller_ng#5285 ·
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 30/100
cloudfoundry/cloud_controller_ng#5246 ·
Les mainteneurs répondent en général sous 2 jours
Toutes les issues de cloudfoundry/cloud_controller_ng
Issues similaires
-
documentation
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
NatLabRockies/OpenStudio-HPXML#2284 ·
-
aikido security:critical
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
dequelabs/axe-core-gems#532 ·
-
print_table with indent and truncate lets lines run up to indent characters past the widthPeut-être pris @sebxt l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 67/100
phusion/passenger-docker#480 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
Les mainteneurs répondent en général sous 5 jours