Skip to content

feat(federation): auto-accept shares from trusted servers - #49973

Merged
skjnldsv merged 7 commits into
masterfrom
feat/auto-accept-trusted-server
Jan 9, 2025
Merged

feat(federation): auto-accept shares from trusted servers#49973
skjnldsv merged 7 commits into
masterfrom
feat/auto-accept-trusted-server

Conversation

@skjnldsv

@skjnldsvskjnldsv commented Dec 26, 2024

Copy link
Copy Markdown
Member

Needs #49974
Fix#34550

image

@skjnldsv

This comment was marked as resolved.

@skjnldsvskjnldsv self-assigned this Dec 26, 2024
@skjnldsvskjnldsv added this to the Nextcloud 31 milestone Dec 26, 2024
@skjnldsv
skjnldsvforce-pushed the feat/auto-accept-trusted-server branch 2 times, most recently from ff6f6e6 to 5d4c7b7CompareDecember 26, 2024 16:08
@skjnldsv
skjnldsv changed the base branch from master to backport/49973/masterDecember 26, 2024 16:08
@skjnldsv
skjnldsvforce-pushed the feat/auto-accept-trusted-server branch 2 times, most recently from e29a165 to c78d1feCompareDecember 26, 2024 17:47
@skjnldsv
skjnldsvforce-pushed the backport/49973/master branch from 1d4cadb to a710e0cCompareDecember 27, 2024 09:08
@skjnldsv
skjnldsvforce-pushed the feat/auto-accept-trusted-server branch 9 times, most recently from 0ba688c to 9e36462CompareDecember 28, 2024 07:48
@skjnldsv
skjnldsv marked this pull request as ready for review December 28, 2024 07:48
@skjnldsvskjnldsv added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Dec 28, 2024
@skjnldsv
skjnldsv requested a review from a teamDecember 28, 2024 07:49

@provokateurinprovokateurin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Some things that could be improved over the old code, if you're already migrating it anyway 🙈

Comment threadapps/federatedfilesharing/lib/FederatedShareProvider.php Outdated
Comment threadapps/federation/appinfo/routes.php
Comment threadapps/federation/js/settings-admin.js
Comment threadapps/federation/lib/Controller/SettingsController.php
Comment threadapps/federation/lib/Controller/SettingsController.php
Comment threadapps/federation/lib/Controller/SettingsController.php
Comment threadapps/federation/lib/Controller/SettingsController.php
Comment threadapps/federation/lib/Controller/SettingsController.php Outdated
…cates`
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsv
skjnldsvforce-pushed the feat/auto-accept-trusted-server branch 4 times, most recently from 6bf6515 to 968be50CompareJanuary 9, 2025 14:09
@skjnldsv
skjnldsv enabled auto-merge January 9, 2025 14:22
Comment threadapps/federation/lib/Controller/SettingsController.php Outdated
Comment threadapps/federation/lib/TrustedServers.php
…dleware
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsv
skjnldsvforce-pushed the feat/auto-accept-trusted-server branch from 968be50 to 669e6caCompareJanuary 9, 2025 14:39
@skjnldsv
skjnldsv requested a review from AltahrimJanuary 9, 2025 15:05

@ChristophWurstChristophWurst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks sane, didn't test

margin-top: 20px;
}

.settings-subsection__name {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: use scss and move this into .settings-subsection?

$servers = $this->trustedServers->getServers();

// obfuscate the shared secret
$servers = array_map(function ($server) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: introduce a new variable instead of repurposing the old one.

Suggested change
$servers = array_map(function ($server) {
$redactedServers = array_map(function ($server) {

try {
$this->trustedServers->getServer($id);
} catch (\Exception $e) {
throw new OCSNotFoundException($this->l->t('No server found with ID: %s', [$id]));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It could be something else as well, other than server not found. Log the exception at debug level.

@skjnldsv
skjnldsv merged commit e346cf6 into masterJan 9, 2025
@skjnldsv
skjnldsv deleted the feat/auto-accept-trusted-server branch January 9, 2025 15:39
@ChristophWurst

Copy link
Copy Markdown
Member

I did not expect the fast merge :x

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto accept federated shares from trusted servers

5 participants

@skjnldsv@ChristophWurst@provokateurin@come-nc@AndyScherzinger