Skip to content
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

TLS error dialog for new setup wizard #9643

Merged
merged 7 commits into from
May 10, 2022
Merged

Conversation

fmoc
Copy link
Contributor

@fmoc fmoc commented May 5, 2022

Depends on #9642.

This PR implements a new TLS error dialog similar to the old SSL error dialog (which had a dependency on an account object and didn't implement separation of concerns)

There are some TODOs/FIXMEs left, please leave your opinion there.

Contributes to #9249.

@fmoc fmoc added this to the 2.11 milestone May 5, 2022
@fmoc fmoc requested a review from a team May 5, 2022 22:20
@fmoc fmoc force-pushed the work/tlserrordialog branch from fd34fab to 0a53ca2 Compare May 6, 2022 09:00

_ui->textBrowser->setHtml(errorStrings.join("\n"));

// FIXME: add checkbox for second confirmation
Copy link
Contributor

Choose a reason for hiding this comment

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

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we have not decided yet whether to put a checkbox into the dialog or not to require the user to click twice in order to permanently trust a custom certificate.

Copy link
Contributor

Choose a reason for hiding this comment

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

you are right, please create an issue to discuss the topic

QString TlsErrorDialog::describeCertificateHtml(const QSslCertificate &certificate)
{
QString msg;
msg += QStringLiteral("<div id=\"cert\">");
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't append multiple times, with msg +=;
This breaks the benefits of the used stringbuilder.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was copied 1:1 from the old dialog. I'd rather not touch this at this point, but we could leave a TODO to improve it in the future (when removing the SSL error dialog).

Copy link
Contributor

Choose a reason for hiding this comment

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

Best time to refactor code is when you touch it.

@TheOneRing
Copy link
Contributor

Can the old one be removed then?

@fmoc
Copy link
Contributor Author

fmoc commented May 6, 2022

It's still used in the account manager. I'd replace it there in a future PR.

@fmoc fmoc force-pushed the work/tlserrordialog branch from 0a53ca2 to 9a68ed0 Compare May 6, 2022 10:36
// therefore we clear the certificates storage before resolving the URL
_accountBuilder = {};

delete _accessManager;
Copy link
Contributor

Choose a reason for hiding this comment

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

->deleteLater();

There might still be some objects using the old nam.


_ui->textBrowser->setHtml(errorStrings.join("\n"));

// FIXME: add checkbox for second confirmation
Copy link
Contributor

Choose a reason for hiding this comment

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

you are right, please create an issue to discuss the topic

QString TlsErrorDialog::describeCertificateHtml(const QSslCertificate &certificate)
{
QString msg;
msg += QStringLiteral("<div id=\"cert\">");
Copy link
Contributor

Choose a reason for hiding this comment

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

Best time to refactor code is when you touch it.

@fmoc fmoc force-pushed the work/tlserrordialog branch 2 times, most recently from 676ce17 to 4329763 Compare May 6, 2022 17:55
Fabian Müller added 7 commits May 10, 2022 10:49
Otherwise, errors may slip through and yield false positives, causing the wizard to assume basic authentication even if the server actually requires OAuth2. This prevents synchronization from working until the user manually logs out and back in again.
@fmoc fmoc force-pushed the work/tlserrordialog branch from 4329763 to 2ea31e4 Compare May 10, 2022 08:49
@TheOneRing TheOneRing merged commit 3108ea8 into master May 10, 2022
@delete-merged-branch delete-merged-branch bot deleted the work/tlserrordialog branch May 10, 2022 09:03
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 9 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants