Skip to content

Add tests to lock down interaction between service keys and service instance sharing - #987

Merged
elenasharma merged 11 commits into
cloudfoundry:masterfrom
cloudfoundry-incubator:pr-service-instance-sharing-add-tests-service-keys
Nov 16, 2017
Merged

Add tests to lock down interaction between service keys and service instance sharing#987
elenasharma merged 11 commits into
cloudfoundry:masterfrom
cloudfoundry-incubator:pr-service-instance-sharing-add-tests-service-keys

Conversation

@jenspinney

Copy link
Copy Markdown
Contributor

Story Links

As an app dev, I cannot create a service key for a service instance that I do not have access to (i.e. has been shared with me). #152592943

As an app dev, I cannot list service keys for a service instance that I do not have access to (i.e. has been shared with me). #151950132

As an app dev, I cannot view a specific service key or delete a service key for a service instance that I do not have access to (i.e. has been shared with me).
#152721273

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

What

This PR adds tests at the controller unit test level to lock down forbidden iteractions between users who have access to a service instance because it was shared with them and service keys.

Users who gain access to a service instance via service instance sharing (but do not have write permission on the space where the service instance was created) may not:

  • Create service keys from the service instance
  • List service keys from the service instance
  • Delete service keys associated with the instance
  • Query specific service keys by guid (created from the instance).

This behavior was already correct. This PR simply adds tests so that the permissions don't accidentally loosen in the future.

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 (@jenspinney and @deniseyu)

@cfdreddbot

Copy link
Copy Markdown

Hey jenspinney!

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/152723172

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

Derik Evangelista and others added 11 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>
@deniseyu
deniseyu force-pushed the pr-service-instance-sharing-add-tests-service-keys branch from 8aa4b51 to 72ef6b7 Compare November 16, 2017 16:45
@elenasharma
elenasharma merged commit 2efb6c0 into cloudfoundry:master Nov 16, 2017
@deniseyu
deniseyu deleted the pr-service-instance-sharing-add-tests-service-keys branch November 28, 2017 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants