-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
feat(federation): auto-accept shares from trusted servers #49973
base: master
Are you sure you want to change the base?
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
ff6f6e6
to
5d4c7b7
Compare
e29a165
to
c78d1fe
Compare
1d4cadb
to
a710e0c
Compare
0ba688c
to
9e36462
Compare
9e36462
to
19e8cbe
Compare
a710e0c
to
bc0ad5e
Compare
19e8cbe
to
094727a
Compare
…cates` Signed-off-by: skjnldsv <[email protected]>
Signed-off-by: skjnldsv <[email protected]>
Signed-off-by: skjnldsv <[email protected]>
Signed-off-by: skjnldsv <[email protected]>
Signed-off-by: skjnldsv <[email protected]>
Signed-off-by: skjnldsv <[email protected]>
8b3c276
to
2467a25
Compare
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.
A bit of nitpick, apart from that backend code looks good.
@@ -999,6 +999,11 @@ public function isLookupServerUploadEnabled() { | |||
return ($result === 'yes'); | |||
} | |||
|
|||
public function isFederatedTrustedShareAutoAccept() { |
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.
public function isFederatedTrustedShareAutoAccept() { | |
public function isFederatedTrustedShareAutoAccept(): bool { |
if ($this->trustedServers->isTrustedServer($url) === true) { | ||
$message = 'Server is already in the list of trusted servers.'; | ||
$hint = $this->l->t('Server is already in the list of trusted servers.'); | ||
throw new HintException($message, $hint); | ||
return new JSONResponse([ |
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.
You can use an OCSException
from OCP\AppFramework\OCS
and then you can keep the old behavior with the throws.
For STATUS_NOT_FOUND there is even OCSNotFoundException.
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.
Completely forgot about those 🤦
/** @var \PHPUnit\Framework\MockObject\MockObject|IConfig */ | ||
private $config; | ||
|
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.
/** @var \PHPUnit\Framework\MockObject\MockObject|IConfig */ | |
private $config; | |
private MockObject&IConfig $config; |
@@ -83,7 +88,8 @@ protected function setUp(): void { | |||
$this->trustedServers, | |||
$this->logger, | |||
$this->discoverService, | |||
$this->timeFactory | |||
$this->timeFactory, | |||
$this->config |
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.
$this->config | |
$this->config, |
Needs #49974
Fix #34550