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

Federation 2.0 #9345

Merged
merged 39 commits into from Jul 3, 2018

Conversation

Projects
None yet
4 participants
@schiessle
Copy link
Member

commented Apr 30, 2018

  • Make Federated Sharing OCM compatible (with some small additions/modifications)

  • Allow the implementation of federated calendar and contact sharing

  • basic infrastructure

  • receive shares over new API

  • send shares over new API

  • receive notifications over new API

    • permissions change
    • ask for re-share
    • share accepted
    • share declined
    • owner unshare
    • undo reshare
  • send notifications over new API

    • permissions change
    • ask for re-share
    • share accepted
    • share declined
    • owner unshare
    • undo reshare
@codecov

This comment has been minimized.

Copy link

commented May 8, 2018

Codecov Report

Merging #9345 into master will decrease coverage by 45.46%.
The diff coverage is 0%.

@@             Coverage Diff              @@
##             master   #9345       +/-   ##
============================================
- Coverage      51.8%   6.33%   -45.47%     
- Complexity    26222   26393      +171     
============================================
  Files          1673    1690       +17     
  Lines         96928   97627      +699     
  Branches       1290    1290               
============================================
- Hits          50209    6184    -44025     
- Misses        46719   91443    +44724
Impacted Files Coverage Δ Complexity Δ
...dfilesharing/composer/composer/autoload_static.php 0% <ø> (ø) 1 <0> (ø) ⬇️
lib/private/Server.php 1.56% <0%> (-80.43%) 286 <6> (+6)
...s/federatedfilesharing/lib/AppInfo/Application.php 0% <0%> (-63.64%) 6 <1> (+1)
apps/files_sharing/lib/Hooks.php 0% <0%> (-47.37%) 4 <0> (ø)
apps/files_sharing/lib/AppInfo/Application.php 0% <0%> (-48.92%) 15 <0> (ø)
...on_api/lib/Controller/RequestHandlerController.php 0% <0%> (ø) 33 <33> (?)
lib/private/Federation/CloudFederationFactory.php 0% <0%> (ø) 2 <2> (?)
...lesharing/lib/ocm/CloudFederationProviderFiles.php 0% <0%> (ø) 74 <74> (?)
...s/cloud_federation_api/lib/AppInfo/Application.php 0% <0%> (ø) 1 <1> (?)
core/routes.php 0% <0%> (ø) 0 <0> (ø) ⬇️
... and 961 more

@schiessle schiessle force-pushed the federation20 branch 5 times, most recently from 20ccb81 to cbfd266 May 8, 2018

@schiessle schiessle force-pushed the federation20 branch 2 times, most recently from 5e06045 to 0e76f93 May 29, 2018

@schiessle schiessle force-pushed the federation20 branch 9 times, most recently from a0c0cc9 to a4e71fd Jun 7, 2018

@schiessle schiessle requested review from rullzer, icewind1991 and blizzz Jun 12, 2018

@schiessle schiessle added this to the Nextcloud 14 milestone Jun 12, 2018

parent::__construct('cloud_federation_api');
$container = $this->getContainer();
$container->registerCapability(Capabilities::class);

This comment has been minimized.

Copy link
@icewind1991

icewind1991 Jun 14, 2018

Member

I would prefer if this was moved to a separate register method instead of having the constructor have side effects

This comment has been minimized.

Copy link
@schiessle

schiessle Jun 25, 2018

Author Member

most apps I checked, e.g. notifications and activity register the capabilities in the constructor. What side-effects are you referring too? I don't see a real different if I call it manually each time I instantiate the application or if it is done automatically in the constructor.

public function addShare($shareWith, $name, $description, $providerId, $owner, $ownerDisplayName, $sharedBy, $sharedByDisplayName, $protocol, $shareType, $resourceType) {
// check if all required parameters are set
if ($shareWith === null ||

This comment has been minimized.

Copy link
@icewind1991

icewind1991 Jun 14, 2018

Member

use strict type hints instead?

This comment has been minimized.

Copy link
@schiessle

schiessle Jun 25, 2018

Author Member

not really an option here, because I want to be able to control the exception in case of a missing parameter.

throw new BadRequestException(['permission']);
}
error_log("new permissions: " . $ncPermissions);

This comment has been minimized.

Copy link
@icewind1991

icewind1991 Jun 14, 2018

Member

left over debug

This comment has been minimized.

Copy link
@schiessle

schiessle Jun 25, 2018

Author Member

removed

schiessle added some commits Jun 7, 2018

replace \OCP\Federation\Exception\ShareNotFoundException with the gen…
…eric \OCP\Share\Exception\ShareNotFound exception

Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
some minor fixes and clode cleanup
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
add ocm-provider to the list of expected files
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
remove unused method
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
update tests
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
fix notification tests
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
fix external manager tests
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
implement config check
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
make sure that remote url gets stored with a trailing '/'
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
send the display name back after a federated share was received
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
let the actual federated share provider check if incoming/outgoing sh…
…ares are enabled for the specific resource type

Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
cleanup variable naming, it is actually a resource type
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
add support for different share types
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
look for correct OCM permissions
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>

@schiessle schiessle force-pushed the federation20 branch 2 times, most recently from 18606a3 to da256da Jul 2, 2018

schiessle added some commits Jun 29, 2018

always enable cloud federation api
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
fix return type from send share
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
remove unused code
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
cache results from ocm end-point discovery
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>

@schiessle schiessle force-pushed the federation20 branch from da256da to 7ff74ae Jul 2, 2018

@schiessle

This comment has been minimized.

Copy link
Member Author

commented Jul 3, 2018

I think the failing tests can be ignored, they fail randomly and I don't see how they are connected to this PR. Looking for your final 👍 😉

@rullzer

rullzer approved these changes Jul 3, 2018

Copy link
Member

left a comment

Huge and scarry. But seems to work. Lets do this.

@MorrisJobke MorrisJobke merged commit 7025f16 into master Jul 3, 2018

1 of 2 checks passed

continuous-integration/drone/pr the build failed
Details
Scrutinizer 15 new issues, 154 updated code elements
Details

@MorrisJobke MorrisJobke deleted the federation20 branch Jul 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.