-
Notifications
You must be signed in to change notification settings - Fork 36
feat: Add config switch to enable E2EE in browser #830
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
Conversation
1fb0fb4
to
fe5a646
Compare
|
||
$this->initialState->provideInitialState( | ||
'userConfig', | ||
[ | ||
'e2eeInBrowserEnabled' => $this->config->getUserValue($this->userId, 'end_to_end_encryption', 'e2eeInBrowserEnabled', 'false') === 'true', | ||
] | ||
); | ||
|
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 would prefer a capability :)
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.
That a user setting, not a capability of the server, no?
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.
Some capabilities (like theming) changes per user 🤔
Maybe it is an antipattern 🤔
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.
fe5a646
to
13c104b
Compare
/compile amend / |
Signed-off-by: Louis Chemineau <[email protected]> Signed-off-by: nextcloud-command <[email protected]>
13c104b
to
d0eb013
Compare
#[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); | ||
} |
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.
Is there no route from core API for this?
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.
Nothing that I found
Changes
I also added a warning in the mnemonic prompt as E2EE navigation in browser could be maliciously enabled by the admin.
Settings
Mnemonic prompt