-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Create federated share on mount #379
Conversation
@schiessle, thanks for your PR! By analyzing the annotation information on this pull request, we identified @icewind1991, @ErikPel and @blizzz to be potential reviewers |
$this->addressHandler = $this->getMockBuilder('OCA\FederatedFileSharing\AddressHandler') | ||
->disableOriginalConstructor()->getMock(); | ||
$this->rootFolder = $this->getMock('OCP\Files\IRootFolder'); | ||
$this->userManager = $this->getMock('OCP\IUserManager'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @rullzer ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
O yes... please use:
$this->getMockBuilder('...')->disableOriginalConstructor()->getMock()
Else there are a shitload of warnings in phpunit 5.4
2a77328
to
22dde3d
Compare
/** | ||
* @author Björn Schießle <[email protected]> | ||
* | ||
* @copyright Copyright (c) 2016, ownCloud, Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because I started it at ownCloud, the pull request also exists in the core repository... But I should at least change my email address
aea08bc
to
ed56000
Compare
Ready to review, but please do me a favour and don't look to much at legacyMountPublicLink(). It is just a 1:1 copy of apps/files_sharing/ajax/external.php to keep backward compatibility. I don't want to rewrite this code, it worked until now and it should just continue to work for the next few months/years until we can remove it. 😃 |
d73e463
to
3fa8d03
Compare
3fa8d03
to
a1388cf
Compare
Tested file/folder share and could add it with link and cloud id, |
use OCP\IUserSession; | ||
use OCP\Share\IManager; | ||
|
||
class SaveToNextcloudController extends Controller { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest to avoid Nextcloud in class names?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have a idea for a better name? "ConvertPubliLinkToFederatedShareController" maybe?
@nickvergessen I renamed the "SaveToNextcloudController" to "MountPublicLinkController"... please have a final look. Thanks! |
…loud this way the owner sees all mounted public links and control them individually
If the share fails to be created the loading spinner is still shown (even if you got an error message) |
I would love to see an integration test for this. We cannot risk this feature to break. I'm currently debugging, why it is not working over here. |
|
$httpClient = $this->clientService->newClient(); | ||
|
||
try { | ||
$response = $httpClient->post($remote . '/index.php/apps/federatedfilesharing/createFederatedShare', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs some validation logic on $remote whether it's a domain or at least forbid slashes and :
and @
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise somebody could send requests to any arbitrary URL, this is something one better wants to avoid :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forbid slashes? people that have installed their cloud in a subfolde rwill love you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't understand this one. As said by @nickvergessen you need slashes if your Nextcloud is installed in a sub folder.
How do you want to decide which a address is pointing to a Nextcloud and which is not before you tried to send a federated share?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hrm. True. What a pity. In this case 🙈 ;-)
3c2c4d7
to
03f2e5e
Compare
03f2e5e
to
c7f6461
Compare
@MorrisJobke the spinner issue is fixed... anything else not working for you? |
fccdc6f
to
b972ba1
Compare
…res are forbidden
b972ba1
to
f8a531c
Compare
Beside that it looks good and works 👍 |
When I hit a second time enter in the input field the spinner is replaced by an arrow (but also if there needs to be a spinner). |
Went over the code with @schiessle. Code looks awesome. Let's do some more functional testing and then get this in 🚀 👍 🍻 |
Tested and works now 👍 |
this way the owner sees all mounted public links and control them individually.
This changes the work flow: