Skip to content

Add /v2/service_instances/:guid/shared_from - #976

Merged
matt-royal merged 12 commits into
cloudfoundry:masterfrom
cloudfoundry-incubator:pr-service-instance-sharing-shared-from-url
Nov 13, 2017
Merged

Add /v2/service_instances/:guid/shared_from#976
matt-royal merged 12 commits into
cloudfoundry:masterfrom
cloudfoundry-incubator:pr-service-instance-sharing-shared-from-url

Conversation

@deniseyu

@deniseyu deniseyu commented Nov 8, 2017

Copy link
Copy Markdown
Contributor

As an app dev (receiver), I can see sharing information regarding service instances that have been shared with me (shared_from). #150973038

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

What

This PR adds /v2/service_instances/:guid/shared_from. This is required by the CLI in order to display the originating space and org of a shared service instance when a user would otherwise not have permission to view those names.

Changes:

  • All service_instance response bodies have shared_from_url
  • /v2/service_instances/:guid/shared_from endpoint returns space name and org name of service
    instance, if that service instance has been shared
  • If not shared, this endpoint returns 204 No Content

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)

Alex Blease and others added 12 commits November 7, 2017 13:58
[#152035378]
Signed-off-by: Jen Spinney <jennifer.spinney@suse.com>
[#152035378]

Signed-off-by: Alex Blease <ablease@pivotal.io>
/v2/spaces/:guid/services endpoint now includes service instances that
have been shared into the given space.

[#152035378]

Signed-off-by: Jen Spinney <jennifer.spinney@suse.com>
* The only visible change is that the global auditor role now receives
"true" for read when calling /v2/service_instances/:guid/permissions.
This tells the service broker that the user is allowed to view the
service instance dashboard. They already have read access to the service
instance, so we don't anticipate that this is a problem.

[#152035378]

Signed-off-by: Derik Evangelista <devangelista@pivotal.io>
… spaces

* Also cleaned up some of the null checking in service_instance_acess
and added tests for access permissions on shared service instances.

[#152035378]

Signed-off-by: Jen Spinney <jennifer.spinney@suse.com>
[#152035378]

Signed-off-by: Jen Spinney <jennifer.spinney@suse.com>
[#152631507]

Signed-off-by: Denise Yu <dyu@pivotal.io>
* List all service instances that a user has permission to see

[#152073155]

Signed-off-by: Jen Spinney <jennifer.spinney@suse.com>
[#152073155]

Signed-off-by: Alex Blease <ablease@pivotal.io>
This change allows developers who have been granted access to a
service instance through service instance sharing, to query that service
instance via /v3/service_instances.

[#152344116]

Signed-off-by: Alex Blease <ablease@pivotal.io>
[#152344116]

Signed-off-by: Jen Spinney <jennifer.spinney@suse.com>
* All service_instances have shared_from_url
* shared_from endpoint returns space name and org name of service
instance, if that service instance has been shared
* If not shared, this endpoint returns 204 No Content

[#150973038]

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

Copy link
Copy Markdown

Hey deniseyu!

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

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

@jenspinney

jenspinney commented Nov 8, 2017

Copy link
Copy Markdown
Contributor

A note on the codeclimate failure: It's complaining that the shared_from_information method is too "cognitively complex". It could be that we are simply cognition masters, but the function does not appear difficult to understand. We'd suggest dismissing the warning.

@matt-royal
matt-royal merged commit e882d87 into cloudfoundry:master Nov 13, 2017
@deniseyu
deniseyu deleted the pr-service-instance-sharing-shared-from-url 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.

6 participants