Skip to content

Auto accept incoming federated shares from trusted servers - #33980

Merged
PVince81 merged 1 commit into
masterfrom
implement-27653-2
Jan 21, 2019
Merged

PVince81 merged 1 commit into
masterfrom
implement-27653-2

Conversation

@VicDeo

@VicDeo VicDeo commented Dec 27, 2018 •

Copy link
Copy Markdown
Contributor

Description

All incoming shares from remote servers are accepted automatically when:

  • federation app autoAddServers config option is set to '0' (default)
    occ config:app:set federation auto_accept_trusted --value '0'
  • federatedfilesharing app auto_accept_trusted config option is set to 'yes'
    occ config:app:set federatedfilesharing auto_accept_trusted --value 'yes'
  • remote server is listed as trusted in the federation app

Related Issue

Closes #27653 https://github.com/owncloud/enterprise/issues/3051

How Has This Been Tested?

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

Checklist:

Open tasks:

  • add UI
  • Backport (if applicable set "backport-request" label and remove when the backport was done)

@codecov

codecov Bot commented Dec 27, 2018 •

Copy link
Copy Markdown

Codecov Report

Merging #33980 into master will decrease coverage by <.01%.
The diff coverage is 56.75%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #33980      +/-   ##
============================================
- Coverage     64.76%   64.75%   -0.01%     
- Complexity    18355    18359       +4     
============================================
  Files          1198     1198              
  Lines         69487    69522      +35     
  Branches       1281     1281              
============================================
+ Hits          45002    45022      +20     
- Misses        24112    24127      +15     
  Partials        373      373
Flag Coverage Δ Complexity Δ
#javascript 53.09% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 66.11% <56.75%> (-0.01%) 18359 <5> (+4)
Impacted Files Coverage Δ Complexity Δ
apps/federation/lib/AppInfo/Application.php 25.37% <0%> (-2.97%) 15 <1> (+1)
apps/federatedfilesharing/lib/AdminPanel.php 100% <100%> (ø) 4 <1> (ø) ⬇️
...s/federatedfilesharing/lib/AppInfo/Application.php 48.85% <100%> (+0.39%) 16 <0> (ø) ⬇️
.../federatedfilesharing/templates/settings-admin.php 85.71% <50%> (-14.29%) 0 <0> (ø)
...ederatedfilesharing/lib/FederatedShareProvider.php 60.53% <63.63%> (+0.29%) 84 <3> (+3) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3479274...6c10d01. Read the comment docs.

@owncloud owncloud deleted a comment from codecov Bot Dec 27, 2018
@VicDeo
VicDeo force-pushed the implement-27653-2 branch 3 times, most recently from 335d56d to 1e77210 Compare December 28, 2018 15:15
@VicDeo
VicDeo force-pushed the implement-27653-2 branch 7 times, most recently from a18e40d to 1ff1dd0 Compare January 9, 2019 10:12
@VicDeo
VicDeo requested a review from PVince81 January 9, 2019 10:43
@VicDeo

VicDeo commented Jan 9, 2019

Copy link
Copy Markdown
Contributor Author

@PVince81 according to #27653 (comment) I somehow need to depend on the federation app anyway
I mean UI settings.

@PVince81

Copy link
Copy Markdown
Contributor

code and approach looks fine.

@VicDeo add acceptance tests to validate the behavior ?

@VicDeo
VicDeo force-pushed the implement-27653-2 branch 6 times, most recently from 62a4742 to bb7bb32 Compare January 21, 2019 13:06
@VicDeo

VicDeo commented Jan 21, 2019

Copy link
Copy Markdown
Contributor Author

@VicDeo acceptance test added

Then file "lorem (2).txt" should not be listed on the webUI
And file "lorem (2).txt" should not be listed in the shared-with-you page on the webUI

Scenario: automatically accept a federation share when it is allowed by the config

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

also add a negative case "do not automatically accept" to confirm that it works correctly ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

negative case is checked indirectly. user "user1" from server "LOCAL" has accepted the last pending share will fail this way in case the share was accepted automatically:

Scenario: unshare a federation share from "share-with-you" page                                         # /drone/src/tests/acceptance/features/webUISharingExternal/federationSharing.feature:190
    Given user "user1" from server "REMOTE" has shared "/lorem.txt" with user "user1" from server "LOCAL" # FederationContext::userFromServerHasSharedWithUserFromServer()
    And user "user1" from server "LOCAL" has accepted the last pending share                              # FederationContext::userFromServerHasAcceptedLastPendingShare()
      Notice: Trying to get property of non-object in /drone/src/tests/acceptance/features/bootstrap/FederationContext.php line 108
    And the user has reloaded the current page of the webUI                                               # WebUIGeneralContext::theUserReloadsTheCurrentPageOfTheWebUI()
    When the user unshares file "lorem (2).txt" using the webUI                                           # WebUIFilesContext::theUserDeletesFileUsingTheWebUI()
    Then file "lorem (2).txt" should not be listed on the webUI                                           # WebUIFilesContext::fileFolderShouldBeListedOnTheWebUI()
    And file "lorem (2).txt" should not be listed in the files page on the webUI                          # WebUIFilesContext::fileFolderShouldBeListedOnTheWebUI()
SCENARIO RESULT: (fail)

@PVince81 PVince81 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

please backport for 10.1.1+

@PVince81
PVince81 merged commit 8e3aa17 into master Jan 21, 2019
@PVince81
PVince81 deleted the implement-27653-2 branch January 21, 2019 16:12
@VicDeo

VicDeo commented Jan 21, 2019

Copy link
Copy Markdown
Contributor Author

Stable10: #34206

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automatically accept federated incoming shared files/folders invites/notifications

2 participants