Skip to content

Users cannot share into a space where an existing service instance name would clash - #994

Merged
elenasharma merged 16 commits into
cloudfoundry:masterfrom
cloudfoundry-incubator:pr-service-instance-sharing-prevent-sharing-if-will-cause-name-clash
Nov 16, 2017
Merged

Users cannot share into a space where an existing service instance name would clash#994
elenasharma merged 16 commits into
cloudfoundry:masterfrom
cloudfoundry-incubator:pr-service-instance-sharing-prevent-sharing-if-will-cause-name-clash

Conversation

@ablease

@ablease ablease commented Nov 14, 2017

Copy link
Copy Markdown

As an app dev (sharer), if I try to share a service instance into a space where a service instance exists with the same name, the share fails. #152853193

NOTE: This PR builds on top of #993, which should be merged first. The actual changes on top of #993 can be viewed in this diff.

What

This PR closes an edge case where a user could share r1 into another space where a service instance called r1 independently exists.

Changes

  • A 400 error will be returned with the message "A service instance called already exists in "
  • Minor refactoring to service instance share action

Why

The CLI will reconcile service names into GUIDs for the API call, so we need to prevent the case where multiple service instances with the same name exist across sharing spaces. If two spaces never interact via a service instance sharing relationship, they are still free to use the same names for their service instances.

PR

  • I have viewed signed and have submitted the Contributor License Agreement
  • I have made this pull request to the master branch
  • I have run all the unit tests using bundle exec rake
  • I have run CF Acceptance Tests on bosh lite

Thanks, sapi

@cfdreddbot

Copy link
Copy Markdown

Hey ablease!

Thanks for submitting this pull request! I'm here to inform the recipients of the pull request that you and the commit authors have already signed the CLA.

@cf-gitbot

Copy link
Copy Markdown

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/152853525

The labels on this github issue will be updated when the story is started.

Derik Evangelista and others added 16 commits November 16, 2017 16:38
* The broker can return a shareable field as part of the service metadata
response to /v2/catalog.

[#152540454]

Signed-off-by: Sam Gunaratne <sgunaratne@pivotal.io>
… instance

* This behaviour already existed, this commit just adds additional tests

[#150973376]

Signed-off-by: Denise Yu <dyu@pivotal.io>
* Only developers who have write access to the service instance
can perform an update.

[#150973390]

Signed-off-by: Derik Evangelista <devangelista@pivotal.io>
or unshare

[#151441010]

Signed-off-by: Denise Yu <dyu@pivotal.io>
* The intended behavior is that users who have
access to a shared service instance, but not developer access to the
originating space of the instance may not create service keys from the
instance.
* This behavior was already correct. This commit simply adds tests to
lock down the behavior.

[#152592943]

Signed-off-by: Jen Spinney <jennifer.spinney@suse.com>
* The intended behavior is that users who have access to a shared service instance, but not developer access to the
originating space of the instance may not list service keys for the instance.
* This behavior was already correct. This commit simply adds tests to lock down the behavior.

[#151950132]

Signed-off-by: Denise Yu <dyu@pivotal.io>
* The intended behavior is that users who have access to a shared service instance, but not developer access to the originating space of the instance may not delete service key associated with the instance.
* This behavior was already correct. This commit simply adds tests to lock down the behavior.

[#152721273]

Signed-off-by: Jen Spinney <jennifer.spinney@suse.com>
* The intended behavior is that users who have access to a shared service instance, but not developer access to the originating space of the instance may not GET specific service keys for the instance.
* This behavior was already correct. This commit simply adds tests to lock down the behavior.

[#152721273]

Signed-off-by: Denise Yu <dyu@pivotal.io>
* Add explicit check in ServiceInstanceShare.create
* Add new API error type

[#151997784]

Signed-off-by: Denise Yu <dyu@pivotal.io>
* Add explicit check in ServiceInstanceShare.create
* Add new API error type

[#152036417]

Signed-off-by: Denise Yu <dyu@pivotal.io>
* Raise 422 when source space is included in list of target spaces

[#152109683]

Signed-off-by: Denise Yu <dyu@pivotal.io>
…me space

[#152593218]

Signed-off-by: Denise Yu <dyu@pivotal.io>
[#150801605]

Signed-off-by: Denise Yu <dyu@pivotal.io>
@elenasharma

Copy link
Copy Markdown
Contributor

Hi @ablease - we accidentally merged this PR. Could you please open a new PR with the same changes?

@deniseyu
deniseyu deleted the pr-service-instance-sharing-prevent-sharing-if-will-cause-name-clash branch November 28, 2017 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants