Skip to content

Conversation

artonge
Copy link
Collaborator

@artonge artonge commented Dec 18, 2024

Changes

I also added a warning in the mnemonic prompt as E2EE navigation in browser could be maliciously enabled by the admin.

Settings

Before After - no confirmation After - Bad format After - All good
Screenshot from 2024-12-18 13-50-25 Screenshot from 2024-12-18 14-42-02 Screenshot from 2024-12-18 14-41-56 Screenshot from 2024-12-18 14-41-47

Mnemonic prompt

View Before After
All closed Screenshot from 2024-12-18 13-50-32 Screenshot from 2024-12-18 13-42-11
Enabled in browser opened and off NA Screenshot from 2024-12-18 13-42-17
Enabled in browser opened and on NA Screenshot from 2024-12-18 13-42-20
Reset key opened Screenshot from 2024-12-18 13-50-37 Screenshot from 2024-12-18 13-42-33

@artonge artonge requested review from nfebe and skjnldsv December 18, 2024 13:43
@artonge artonge added 3. to review Waiting for reviews enhancement New feature or request javascript Javascript related ticket labels Dec 18, 2024
@artonge artonge added this to the Nextcloud 31 milestone Dec 18, 2024
@artonge artonge marked this pull request as ready for review December 18, 2024 13:45
@artonge artonge force-pushed the artonge/feat/add_e2ee_in_browser_switch branch from 1fb0fb4 to fe5a646 Compare December 18, 2024 14:41
Comment on lines 35 to +42

$this->initialState->provideInitialState(
'userConfig',
[
'e2eeInBrowserEnabled' => $this->config->getUserValue($this->userId, 'end_to_end_encryption', 'e2eeInBrowserEnabled', 'false') === 'true',
]
);

Copy link
Member

Choose a reason for hiding this comment

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

I would prefer a capability :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That a user setting, not a capability of the server, no?

Copy link
Member

Choose a reason for hiding this comment

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

Some capabilities (like theming) changes per user 🤔
Maybe it is an antipattern 🤔

Copy link
Member

Choose a reason for hiding this comment

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

@artonge artonge force-pushed the artonge/feat/add_e2ee_in_browser_switch branch from fe5a646 to 13c104b Compare December 19, 2024 14:05
@artonge
Copy link
Collaborator Author

artonge commented Dec 19, 2024

/compile amend /

Signed-off-by: Louis Chemineau <[email protected]>
Signed-off-by: nextcloud-command <[email protected]>
@nextcloud-command nextcloud-command force-pushed the artonge/feat/add_e2ee_in_browser_switch branch from 13c104b to d0eb013 Compare December 19, 2024 14:49
Comment on lines +30 to +43
#[NoAdminRequired]
#[FrontpageRoute(verb: 'PUT', url: '/api/v1/config/{key}')]
public function setUserConfig(string $key, string $value): JSONResponse {
if (is_null($this->userId)) {
return new JSONResponse([], Http::STATUS_PRECONDITION_FAILED);
}

if (!in_array($key, ['e2eeInBrowserEnabled'])) {
return new JSONResponse([], Http::STATUS_PRECONDITION_FAILED);
}

$this->config->setUserValue($this->userId, Application::APP_ID, $key, $value);
return new JSONResponse([], Http::STATUS_OK);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there no route from core API for this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nothing that I found

@artonge artonge merged commit 4445388 into master Dec 19, 2024
40 checks passed
@artonge artonge deleted the artonge/feat/add_e2ee_in_browser_switch branch December 19, 2024 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement New feature or request javascript Javascript related ticket
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants