Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(sharing): add graph endpoints to accept or decline a share #7885

Merged
merged 18 commits into from Feb 28, 2024

Conversation

fschade
Copy link
Contributor

@fschade fschade commented Dec 5, 2023

Description

With an objective to enhance our existing apis, this PR extends our Graph Service by introducing new endpoints for accepting and declining shares.

These features are not new additions in terms of functionality, as they were previously available in our legacy OCS API.

Open Tasks:

  • Add business logic and endpoint for accepting shares
  • Add business logic and endpoint for declining shares
  • Write unit tests

Related Issue

Motivation and Context

these Graph endpoints are designed to take over in the future, thereby paving a smooth transition

How Has This Been Tested?

  • ci
  • local installation (single binary)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Copy link

update-docs bot commented Dec 5, 2023

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

Copy link

sonarcloud bot commented Dec 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

68.4% 68.4% Coverage
0.0% 0.0% Duplication

@rhafer
Copy link
Contributor

rhafer commented Feb 20, 2024

Moving this to draft once more as this needs adjustments for matching the changed sharedWithMe response from #8467

@rhafer rhafer marked this pull request as draft February 20, 2024 14:19
@rhafer rhafer force-pushed the graph-beta-share-accept-decline branch 2 times, most recently from 4f2f142 to 5d9c15a Compare February 21, 2024 15:45
@rhafer rhafer marked this pull request as ready for review February 21, 2024 16:38
@rhafer rhafer force-pushed the graph-beta-share-accept-decline branch from 5d9c15a to f389119 Compare February 22, 2024 11:35
Copy link
Collaborator

@kobergj kobergj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usual comments. Rest looks good 👍

changelog/unreleased/sharing-ng-mount.md Show resolved Hide resolved
services/graph/pkg/service/v0/api_drives_drive_item.go Outdated Show resolved Hide resolved
services/graph/pkg/service/v0/service.go Show resolved Hide resolved
services/graph/pkg/service/v0/service.go Show resolved Hide resolved
services/graph/pkg/service/v0/utils.go Outdated Show resolved Hide resolved
services/graph/pkg/service/v0/utils.go Outdated Show resolved Hide resolved
fschade and others added 12 commits February 28, 2024 16:39
…terface

After some back an forth we agreed on keeping the routes defined
in a central place for now.
In theory creating the driveItem to accepting a shared resource
can be done via '/v1beta1/drives/{drive-id}/item/{item-id}/children'
but there is also the simplified variant via
'/v1beta1/drives/{drive-id}/root/children' (aligned with the example
in the spec). For now we'll just implement the latter because accepting
a share will always be done via root of the sharejail drive.
When accepting a share via 'POST /v1beta1/drives/{driveId}/root/children'
return the newly created driveItem. This driveItem wraps the accepted
remoteItem representing the shared resource (similar to the
'sharedWithMe' response.

This also refactors some of the helpers for user lookup and CS3 share to
driveItem conversion so they can be more easily shared.
Only accept requests against the shareJail driveID
errors.Join(errs...) ignores nil errors and returns nil if there are not errors.
@rhafer rhafer force-pushed the graph-beta-share-accept-decline branch from f389119 to 954998a Compare February 28, 2024 15:39
Copy link

sonarcloud bot commented Feb 28, 2024

@rhafer rhafer merged commit 0d366a3 into owncloud:master Feb 28, 2024
4 checks passed
@rhafer rhafer mentioned this pull request Feb 28, 2024
@micbar micbar mentioned this pull request Mar 13, 2024
71 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants