Merge lp:~mardy/signon-ui/http-warning into lp:signon-ui

Proposed by Alberto Mardegan
Status: Merged
Approved by: Ken VanDine
Approved revision: 109
Merged at revision: 106
Proposed branch: lp:~mardy/signon-ui/http-warning
Merge into: lp:signon-ui
Diff against target: 339 lines (+164/-6)
9 files modified
.bzrignore (+4/-1)
debian/changelog (+7/-0)
debian/rules (+2/-1)
src/browser-request.cpp (+20/-3)
src/http-warning.cpp (+74/-0)
src/http-warning.h (+40/-0)
src/http-warning.qrc (+5/-0)
src/signon-ui.pro (+10/-1)
tests/unit/tst_signon_ui.pro (+2/-0)
To merge this branch: bzr merge lp:~mardy/signon-ui/http-warning
Reviewer Review Type Date Requested Status
Ken VanDine Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+169767@code.launchpad.net

Commit message

Show a worning message when authenticating with plain HTTP

Description of the change

Show a worning message when authenticating with plain HTTP

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:107
http://jenkins.qa.ubuntu.com/job/signon-ui-ci/25/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/signon-ui-saucy-amd64-ci/5

Click here to trigger a rebuild:
http://s-jenkins:8080/job/signon-ui-ci/25/rebuild

review: Approve (continuous-integration)
lp:~mardy/signon-ui/http-warning updated
108. By Alberto Mardegan on 2013-06-17

Use 16px icon

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:108
http://jenkins.qa.ubuntu.com/job/signon-ui-ci/26/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/signon-ui-saucy-amd64-ci/6

Click here to trigger a rebuild:
http://s-jenkins:8080/job/signon-ui-ci/26/rebuild

review: Approve (continuous-integration)
Revision history for this message
Ken VanDine (ken-vandine) wrote :

Please fix the conflicts

review: Needs Fixing
lp:~mardy/signon-ui/http-warning updated
109. By Alberto Mardegan on 2013-06-18

Fix changelog conflicts

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:109
http://jenkins.qa.ubuntu.com/job/signon-ui-ci/27/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/signon-ui-saucy-amd64-ci/7

Click here to trigger a rebuild:
http://s-jenkins:8080/job/signon-ui-ci/27/rebuild

review: Approve (continuous-integration)
Revision history for this message
Ken VanDine (ken-vandine) wrote :

Thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2013-06-10 11:04:32 +0000
3+++ .bzrignore 2013-06-18 07:09:27 +0000
4@@ -1,9 +1,11 @@
5 *.a
6+*.log
7 *.o
8 *.moc
9 *.pyc
10 *.so
11 *.so.*
12+*.substvars
13 *.tar.*
14 *~
15 .*.swp
16@@ -11,7 +13,8 @@
17 .obj
18 builddir
19 core
20-debian/
21+/debian/files
22+/debian/signon-ui
23 Makefile
24 Makefile.*
25 moc_*
26
27=== modified file 'debian/changelog'
28--- debian/changelog 2013-06-12 04:31:58 +0000
29+++ debian/changelog 2013-06-18 07:09:27 +0000
30@@ -1,3 +1,10 @@
31+signon-ui (0.15daily13.06.12-0ubuntu2) UNRELEASED; urgency=low
32+
33+ * Show a warning message when authenticating with plain
34+ HTTP. (LP: #1180297).
35+
36+ -- Alberto Mardegan <alberto.mardegan@canonical.com> Tue, 18 Jun 2013 00:06:32 -0700
37+
38 signon-ui (0.15daily13.06.12-0ubuntu1) saucy; urgency=low
39
40 [ Alberto Mardegan ]
41
42=== modified file 'debian/rules'
43--- debian/rules 2013-05-02 19:17:06 +0000
44+++ debian/rules 2013-06-18 07:09:27 +0000
45@@ -7,7 +7,8 @@
46
47 override_dh_auto_configure:
48 dh_auto_configure -- "CONFIG+=force-foreign-qwindow" \
49- "CONFIG+=use-webkit2"
50+ "CONFIG+=use-webkit2" \
51+ "HTTP_WARNING_HELP=help:web-credentials/http-warning"
52
53 override_dh_install:
54 rm -f debian/*/usr/bin/signon-ui-unittest
55
56=== modified file 'src/browser-request.cpp'
57--- src/browser-request.cpp 2013-06-06 13:01:21 +0000
58+++ src/browser-request.cpp 2013-06-18 07:09:27 +0000
59@@ -24,14 +24,17 @@
60 #include "cookie-jar-manager.h"
61 #include "debug.h"
62 #include "dialog.h"
63+#include "http-warning.h"
64 #include "i18n.h"
65
66 #include <QDBusArgument>
67 #include <QDesktopServices>
68+#include <QIcon>
69 #include <QLabel>
70 #include <QNetworkCookie>
71 #include <QNetworkReply>
72 #include <QNetworkRequest>
73+#include <QPixmap>
74 #include <QPointer>
75 #include <QProgressBar>
76 #include <QPushButton>
77@@ -39,6 +42,7 @@
78 #include <QSettings>
79 #include <QSslError>
80 #include <QStackedLayout>
81+#include <QStatusBar>
82 #include <QTimer>
83 #include <QVBoxLayout>
84 #include <QWebElement>
85@@ -276,6 +280,7 @@
86 QStackedLayout *m_webViewLayout;
87 WebView *m_webView;
88 AnimationLabel *m_animationLabel;
89+ HttpWarning *m_httpWarning;
90 QUrl finalUrl;
91 QUrl responseUrl;
92 QString m_host;
93@@ -299,6 +304,7 @@
94 m_webViewLayout(0),
95 m_webView(0),
96 m_animationLabel(0),
97+ m_httpWarning(0),
98 m_settings(0),
99 m_loginCount(0),
100 m_ignoreSslErrors(false)
101@@ -343,6 +349,7 @@
102 }
103
104 setupViewForUrl(url);
105+ m_httpWarning->setVisible(url.scheme() == "http");
106 }
107
108 void BrowserRequestPrivate::onLoadProgress()
109@@ -428,13 +435,13 @@
110 void BrowserRequestPrivate::startProgress()
111 {
112 m_animationLabel->start();
113- m_webViewLayout->setCurrentWidget(m_animationLabel);
114+ m_webViewLayout->setCurrentIndex(1);
115 }
116
117 void BrowserRequestPrivate::stopProgress()
118 {
119 m_animationLabel->stop();
120- m_webViewLayout->setCurrentWidget(m_webView);
121+ m_webViewLayout->setCurrentIndex(0);
122 }
123
124 QWidget *BrowserRequestPrivate::buildWebViewPage(const QVariantMap &params)
125@@ -489,7 +496,17 @@
126 this, SLOT(onLoadProgress()));
127 QObject::connect(m_webView, SIGNAL(loadFinished(bool)),
128 this, SLOT(onLoadFinished(bool)));
129- m_webViewLayout->addWidget(m_webView);
130+ QWidget *webViewContainer = new QWidget;
131+ QVBoxLayout *vLayout = new QVBoxLayout;
132+ vLayout->setSpacing(0);
133+ webViewContainer->setLayout(vLayout);
134+ vLayout->addWidget(m_webView);
135+
136+ m_httpWarning = new HttpWarning;
137+ m_httpWarning->setVisible(false);
138+ vLayout->addWidget(m_httpWarning);
139+
140+ m_webViewLayout->addWidget(webViewContainer);
141
142 m_animationLabel = new AnimationLabel(":/spinner-26.gif", 0);
143 QObject::connect(m_webView, SIGNAL(loadStarted()),
144
145=== added file 'src/http-warning.cpp'
146--- src/http-warning.cpp 1970-01-01 00:00:00 +0000
147+++ src/http-warning.cpp 2013-06-18 07:09:27 +0000
148@@ -0,0 +1,74 @@
149+/*
150+ * This file is part of signon-ui
151+ *
152+ * Copyright (C) 2013 Canonical Ltd.
153+ *
154+ * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
155+ *
156+ * This program is free software: you can redistribute it and/or modify it
157+ * under the terms of the GNU General Public License version 3, as published
158+ * by the Free Software Foundation.
159+ *
160+ * This program is distributed in the hope that it will be useful, but
161+ * WITHOUT ANY WARRANTY; without even the implied warranties of
162+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
163+ * PURPOSE. See the GNU General Public License for more details.
164+ *
165+ * You should have received a copy of the GNU General Public License along
166+ * with this program. If not, see <http://www.gnu.org/licenses/>.
167+ */
168+
169+#include "http-warning.h"
170+
171+#include "debug.h"
172+#include "i18n.h"
173+
174+#include <QFile>
175+#include <QLabel>
176+#include <QPixmap>
177+#include <QHBoxLayout>
178+#include <QVBoxLayout>
179+
180+using namespace SignOnUi;
181+
182+HttpWarning::HttpWarning(QWidget *parent):
183+ QWidget(parent)
184+{
185+ QVBoxLayout *vLayout = new QVBoxLayout;
186+ vLayout->setContentsMargins(0, 0, 0, 0);
187+ setLayout(vLayout);
188+
189+ QFrame *separator = new QFrame;
190+ separator->setFrameShape(QFrame::HLine);
191+ separator->setFrameShadow(QFrame::Raised);
192+ separator->setContentsMargins(0, 0, 0, 0);
193+ vLayout->addWidget(separator);
194+
195+ QWidget *labels = new QWidget;
196+ vLayout->addWidget(labels);
197+
198+ QHBoxLayout *labelsLayout = new QHBoxLayout;
199+ labelsLayout->setContentsMargins(0, 0, 0, 0);
200+ labels->setLayout(labelsLayout);
201+
202+ QLabel *label = new QLabel;
203+ label->setPixmap(QPixmap(":security-low.png"));
204+ labelsLayout->addWidget(label);
205+
206+ label = new QLabel;
207+ label->setTextFormat(Qt::RichText);
208+ QString text = _("This site uses an insecure connection.");
209+#ifdef HTTP_WARNING_HELP
210+ text.append(QString(" <a href=\"" HTTP_WARNING_HELP "\">%1</a>").
211+ arg(_("What does this mean?")));
212+#endif
213+ label->setText(text);
214+ label->setOpenExternalLinks(true);
215+ labelsLayout->addWidget(label);
216+
217+ labelsLayout->addStretch();
218+}
219+
220+HttpWarning::~HttpWarning()
221+{
222+}
223
224=== added file 'src/http-warning.h'
225--- src/http-warning.h 1970-01-01 00:00:00 +0000
226+++ src/http-warning.h 2013-06-18 07:09:27 +0000
227@@ -0,0 +1,40 @@
228+/*
229+ * This file is part of signon-ui
230+ *
231+ * Copyright (C) 2013 Canonical Ltd.
232+ *
233+ * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
234+ *
235+ * This program is free software: you can redistribute it and/or modify it
236+ * under the terms of the GNU General Public License version 3, as published
237+ * by the Free Software Foundation.
238+ *
239+ * This program is distributed in the hope that it will be useful, but
240+ * WITHOUT ANY WARRANTY; without even the implied warranties of
241+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
242+ * PURPOSE. See the GNU General Public License for more details.
243+ *
244+ * You should have received a copy of the GNU General Public License along
245+ * with this program. If not, see <http://www.gnu.org/licenses/>.
246+ */
247+
248+#ifndef SIGNON_UI_HTTP_WARNING_H
249+#define SIGNON_UI_HTTP_WARNING_H
250+
251+#include <QString>
252+#include <QWidget>
253+
254+namespace SignOnUi {
255+
256+class HttpWarning: public QWidget
257+{
258+ Q_OBJECT
259+
260+public:
261+ HttpWarning(QWidget *parent = 0);
262+ ~HttpWarning();
263+};
264+
265+} // namespace
266+
267+#endif // SIGNON_UI_HTTP_WARNING_H
268
269=== added file 'src/http-warning.qrc'
270--- src/http-warning.qrc 1970-01-01 00:00:00 +0000
271+++ src/http-warning.qrc 2013-06-18 07:09:27 +0000
272@@ -0,0 +1,5 @@
273+<RCC>
274+ <qresource prefix="/" >
275+ <file>security-low.png</file>
276+ </qresource>
277+</RCC>
278
279=== added file 'src/security-low.png'
280Binary files src/security-low.png 1970-01-01 00:00:00 +0000 and src/security-low.png 2013-06-18 07:09:27 +0000 differ
281=== modified file 'src/signon-ui.pro'
282--- src/signon-ui.pro 2013-06-10 11:04:32 +0000
283+++ src/signon-ui.pro 2013-06-18 07:09:27 +0000
284@@ -47,6 +47,7 @@
285 dialog-request.h \
286 dialog.h \
287 errors.h \
288+ http-warning.h \
289 i18n.h \
290 inactivity-timer.h \
291 indicator-service.h \
292@@ -63,6 +64,7 @@
293 debug.cpp \
294 dialog-request.cpp \
295 dialog.cpp \
296+ http-warning.cpp \
297 i18n.cpp \
298 inactivity-timer.cpp \
299 indicator-service.cpp \
300@@ -94,7 +96,9 @@
301 REMOTE_PROCESS_PATH=\\\"$${INSTALL_PREFIX}/libexec/signon-ui\\\" \
302 I18N_DOMAIN=\\\"$${I18N_DOMAIN}\\\"
303
304-RESOURCES += animationlabel.qrc
305+RESOURCES += \
306+ animationlabel.qrc \
307+ http-warning.qrc
308
309 SIGNONUI_DBUS_ADAPTORS += \
310 com.canonical.indicators.webcredentials.xml
311@@ -119,3 +123,8 @@
312 com.canonical.indicators.webcredentials.service \
313 com.nokia.singlesignonui.service
314 INSTALLS += service
315+
316+# Help file for HTTP authentication warning
317+!isEmpty(HTTP_WARNING_HELP) {
318+ DEFINES += HTTP_WARNING_HELP=\\\"$${HTTP_WARNING_HELP}\\\"
319+}
320
321=== modified file 'tests/unit/tst_signon_ui.pro'
322--- tests/unit/tst_signon_ui.pro 2013-04-22 06:53:35 +0000
323+++ tests/unit/tst_signon_ui.pro 2013-06-18 07:09:27 +0000
324@@ -45,6 +45,7 @@
325 $$TOP_SRC_DIR/src/debug.cpp \
326 $$TOP_SRC_DIR/src/dialog-request.cpp \
327 $$TOP_SRC_DIR/src/dialog.cpp \
328+ $$TOP_SRC_DIR/src/http-warning.cpp \
329 $$TOP_SRC_DIR/src/i18n.cpp \
330 $$TOP_SRC_DIR/src/indicator-service.cpp \
331 $$TOP_SRC_DIR/src/network-access-manager.cpp \
332@@ -61,6 +62,7 @@
333 $$TOP_SRC_DIR/src/cookie-jar-manager.h \
334 $$TOP_SRC_DIR/src/dialog-request.h \
335 $$TOP_SRC_DIR/src/dialog.h \
336+ $$TOP_SRC_DIR/src/http-warning.h \
337 $$TOP_SRC_DIR/src/indicator-service.h \
338 $$TOP_SRC_DIR/src/network-access-manager.h \
339 $$TOP_SRC_DIR/src/reauthenticator.h \

Subscribers

People subscribed via source and target branches

to all changes: