From 41affbb82c5e897eea64f77538ce4b20322ba61c Mon Sep 17 00:00:00 2001 From: David Rautureau Date: Wed, 20 Jul 2016 10:30:19 +0200 Subject: [maven-release-plugin] prepare release 6.0-RC1 --- plugins/sonar-xoo-plugin/pom.xml | 2 +- pom.xml | 4 ++-- server/pom.xml | 2 +- server/sonar-ce/pom.xml | 5 ++--- server/sonar-plugin-bridge/pom.xml | 2 +- server/sonar-process-monitor/pom.xml | 2 +- server/sonar-process/pom.xml | 5 ++--- server/sonar-search/pom.xml | 2 +- server/sonar-server/pom.xml | 2 +- server/sonar-web/pom.xml | 2 +- sonar-application/pom.xml | 2 +- sonar-check-api/pom.xml | 2 +- sonar-colorizer/pom.xml | 2 +- sonar-core/pom.xml | 2 +- sonar-db/pom.xml | 5 ++--- sonar-duplications/pom.xml | 2 +- sonar-home/pom.xml | 2 +- sonar-markdown/pom.xml | 2 +- sonar-plugin-api-deps/pom.xml | 2 +- sonar-plugin-api/pom.xml | 2 +- sonar-scanner-engine-shaded/pom.xml | 2 +- sonar-scanner-engine/pom.xml | 2 +- sonar-scanner-protocol/pom.xml | 2 +- sonar-testing-harness/pom.xml | 2 +- sonar-ws/pom.xml | 2 +- 25 files changed, 29 insertions(+), 32 deletions(-) diff --git a/plugins/sonar-xoo-plugin/pom.xml b/plugins/sonar-xoo-plugin/pom.xml index 5240a80f499..b2627d2e7c5 100644 --- a/plugins/sonar-xoo-plugin/pom.xml +++ b/plugins/sonar-xoo-plugin/pom.xml @@ -4,7 +4,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-SNAPSHOT + 6.0-RC1 ../.. sonar-xoo-plugin diff --git a/pom.xml b/pom.xml index 9aba3be4934..13a061e8cde 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.sonarsource.sonarqube sonarqube pom - 6.0-SNAPSHOT + 6.0-RC1 SonarQube http://www.sonarqube.org/ Open source platform for continuous inspection of code quality @@ -988,7 +988,7 @@ scm:git:git@github.com:SonarSource/sonarqube.git scm:git:git@github.com:SonarSource/sonarqube.git https://github.com/SonarSource/sonarqube - HEAD + 6.0-RC1 diff --git a/server/pom.xml b/server/pom.xml index 04a70444fec..e9aa031667f 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -4,7 +4,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-SNAPSHOT + 6.0-RC1 server pom diff --git a/server/sonar-ce/pom.xml b/server/sonar-ce/pom.xml index f71fef7174e..54de43e25c8 100644 --- a/server/sonar-ce/pom.xml +++ b/server/sonar-ce/pom.xml @@ -1,11 +1,10 @@ - + 4.0.0 org.sonarsource.sonarqube server - 6.0-SNAPSHOT + 6.0-RC1 .. sonar-ce diff --git a/server/sonar-plugin-bridge/pom.xml b/server/sonar-plugin-bridge/pom.xml index a77c4882035..495a7ff4e49 100644 --- a/server/sonar-plugin-bridge/pom.xml +++ b/server/sonar-plugin-bridge/pom.xml @@ -4,7 +4,7 @@ org.sonarsource.sonarqube server - 6.0-SNAPSHOT + 6.0-RC1 .. sonar-plugin-bridge diff --git a/server/sonar-process-monitor/pom.xml b/server/sonar-process-monitor/pom.xml index 1c6b91f852c..499244b72b8 100644 --- a/server/sonar-process-monitor/pom.xml +++ b/server/sonar-process-monitor/pom.xml @@ -4,7 +4,7 @@ org.sonarsource.sonarqube server - 6.0-SNAPSHOT + 6.0-RC1 ../ diff --git a/server/sonar-process/pom.xml b/server/sonar-process/pom.xml index 3453e172047..e5f3289dc48 100644 --- a/server/sonar-process/pom.xml +++ b/server/sonar-process/pom.xml @@ -1,11 +1,10 @@ - + 4.0.0 org.sonarsource.sonarqube server - 6.0-SNAPSHOT + 6.0-RC1 ../ diff --git a/server/sonar-search/pom.xml b/server/sonar-search/pom.xml index d155517a242..e5b5206f6ff 100644 --- a/server/sonar-search/pom.xml +++ b/server/sonar-search/pom.xml @@ -4,7 +4,7 @@ org.sonarsource.sonarqube server - 6.0-SNAPSHOT + 6.0-RC1 ../ diff --git a/server/sonar-server/pom.xml b/server/sonar-server/pom.xml index b753ff7dd24..514de3b5b59 100644 --- a/server/sonar-server/pom.xml +++ b/server/sonar-server/pom.xml @@ -4,7 +4,7 @@ org.sonarsource.sonarqube server - 6.0-SNAPSHOT + 6.0-RC1 .. sonar-server diff --git a/server/sonar-web/pom.xml b/server/sonar-web/pom.xml index 6b465ece10b..0a0d1d5997c 100644 --- a/server/sonar-web/pom.xml +++ b/server/sonar-web/pom.xml @@ -4,7 +4,7 @@ org.sonarsource.sonarqube server - 6.0-SNAPSHOT + 6.0-RC1 .. sonar-web diff --git a/sonar-application/pom.xml b/sonar-application/pom.xml index 29c41d6f6f5..39aa176bdf7 100644 --- a/sonar-application/pom.xml +++ b/sonar-application/pom.xml @@ -5,7 +5,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-SNAPSHOT + 6.0-RC1 sonar-application diff --git a/sonar-check-api/pom.xml b/sonar-check-api/pom.xml index 5bdd475ff36..cb80ab66571 100644 --- a/sonar-check-api/pom.xml +++ b/sonar-check-api/pom.xml @@ -4,7 +4,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-SNAPSHOT + 6.0-RC1 .. sonar-check-api diff --git a/sonar-colorizer/pom.xml b/sonar-colorizer/pom.xml index 656e63b6dc1..6d4857c1667 100644 --- a/sonar-colorizer/pom.xml +++ b/sonar-colorizer/pom.xml @@ -5,7 +5,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-SNAPSHOT + 6.0-RC1 .. diff --git a/sonar-core/pom.xml b/sonar-core/pom.xml index db4949d70fb..f0a0362a02b 100644 --- a/sonar-core/pom.xml +++ b/sonar-core/pom.xml @@ -5,7 +5,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-SNAPSHOT + 6.0-RC1 sonar-core diff --git a/sonar-db/pom.xml b/sonar-db/pom.xml index a85a8705f55..d9812a46364 100644 --- a/sonar-db/pom.xml +++ b/sonar-db/pom.xml @@ -1,12 +1,11 @@ - + 4.0.0 org.sonarsource.sonarqube sonarqube - 6.0-SNAPSHOT + 6.0-RC1 sonar-db diff --git a/sonar-duplications/pom.xml b/sonar-duplications/pom.xml index 04a9778f558..d9c7fe240b7 100644 --- a/sonar-duplications/pom.xml +++ b/sonar-duplications/pom.xml @@ -4,7 +4,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-SNAPSHOT + 6.0-RC1 sonar-duplications diff --git a/sonar-home/pom.xml b/sonar-home/pom.xml index b886355cc02..68518203133 100644 --- a/sonar-home/pom.xml +++ b/sonar-home/pom.xml @@ -5,7 +5,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-SNAPSHOT + 6.0-RC1 sonar-home diff --git a/sonar-markdown/pom.xml b/sonar-markdown/pom.xml index 3777353033a..9e2988a9061 100644 --- a/sonar-markdown/pom.xml +++ b/sonar-markdown/pom.xml @@ -5,7 +5,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-SNAPSHOT + 6.0-RC1 .. diff --git a/sonar-plugin-api-deps/pom.xml b/sonar-plugin-api-deps/pom.xml index c8ac6a80cf6..87b332cf77a 100644 --- a/sonar-plugin-api-deps/pom.xml +++ b/sonar-plugin-api-deps/pom.xml @@ -5,7 +5,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-SNAPSHOT + 6.0-RC1 sonar-plugin-api-deps diff --git a/sonar-plugin-api/pom.xml b/sonar-plugin-api/pom.xml index 56dd08afbb6..60b5e9057cf 100644 --- a/sonar-plugin-api/pom.xml +++ b/sonar-plugin-api/pom.xml @@ -5,7 +5,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-SNAPSHOT + 6.0-RC1 sonar-plugin-api diff --git a/sonar-scanner-engine-shaded/pom.xml b/sonar-scanner-engine-shaded/pom.xml index 0c956ed75e0..89cd872efa0 100644 --- a/sonar-scanner-engine-shaded/pom.xml +++ b/sonar-scanner-engine-shaded/pom.xml @@ -5,7 +5,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-SNAPSHOT + 6.0-RC1 sonar-scanner-engine-shaded diff --git a/sonar-scanner-engine/pom.xml b/sonar-scanner-engine/pom.xml index d983b1b71c9..3e8e514ee43 100644 --- a/sonar-scanner-engine/pom.xml +++ b/sonar-scanner-engine/pom.xml @@ -4,7 +4,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-SNAPSHOT + 6.0-RC1 sonar-scanner-engine diff --git a/sonar-scanner-protocol/pom.xml b/sonar-scanner-protocol/pom.xml index 105285ae281..19a368ba254 100644 --- a/sonar-scanner-protocol/pom.xml +++ b/sonar-scanner-protocol/pom.xml @@ -4,7 +4,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-SNAPSHOT + 6.0-RC1 sonar-scanner-protocol diff --git a/sonar-testing-harness/pom.xml b/sonar-testing-harness/pom.xml index bbcaab5c2d1..43437c62583 100644 --- a/sonar-testing-harness/pom.xml +++ b/sonar-testing-harness/pom.xml @@ -4,7 +4,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-SNAPSHOT + 6.0-RC1 sonar-testing-harness jar diff --git a/sonar-ws/pom.xml b/sonar-ws/pom.xml index bdb55eb3106..84e735c352e 100644 --- a/sonar-ws/pom.xml +++ b/sonar-ws/pom.xml @@ -5,7 +5,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-SNAPSHOT + 6.0-RC1 sonar-ws -- cgit v1.2.3 From 3613994b6f95278f71d0c57aa8823da4f01f6f03 Mon Sep 17 00:00:00 2001 From: David Rautureau Date: Wed, 20 Jul 2016 10:30:20 +0200 Subject: [maven-release-plugin] prepare for next development iteration --- plugins/sonar-xoo-plugin/pom.xml | 2 +- pom.xml | 4 ++-- server/pom.xml | 2 +- server/sonar-ce/pom.xml | 2 +- server/sonar-plugin-bridge/pom.xml | 2 +- server/sonar-process-monitor/pom.xml | 2 +- server/sonar-process/pom.xml | 2 +- server/sonar-search/pom.xml | 2 +- server/sonar-server/pom.xml | 2 +- server/sonar-web/pom.xml | 2 +- sonar-application/pom.xml | 2 +- sonar-check-api/pom.xml | 2 +- sonar-colorizer/pom.xml | 2 +- sonar-core/pom.xml | 2 +- sonar-db/pom.xml | 2 +- sonar-duplications/pom.xml | 2 +- sonar-home/pom.xml | 2 +- sonar-markdown/pom.xml | 2 +- sonar-plugin-api-deps/pom.xml | 2 +- sonar-plugin-api/pom.xml | 2 +- sonar-scanner-engine-shaded/pom.xml | 2 +- sonar-scanner-engine/pom.xml | 2 +- sonar-scanner-protocol/pom.xml | 2 +- sonar-testing-harness/pom.xml | 2 +- sonar-ws/pom.xml | 2 +- 25 files changed, 26 insertions(+), 26 deletions(-) diff --git a/plugins/sonar-xoo-plugin/pom.xml b/plugins/sonar-xoo-plugin/pom.xml index b2627d2e7c5..5240a80f499 100644 --- a/plugins/sonar-xoo-plugin/pom.xml +++ b/plugins/sonar-xoo-plugin/pom.xml @@ -4,7 +4,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-RC1 + 6.0-SNAPSHOT ../.. sonar-xoo-plugin diff --git a/pom.xml b/pom.xml index 13a061e8cde..9aba3be4934 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.sonarsource.sonarqube sonarqube pom - 6.0-RC1 + 6.0-SNAPSHOT SonarQube http://www.sonarqube.org/ Open source platform for continuous inspection of code quality @@ -988,7 +988,7 @@ scm:git:git@github.com:SonarSource/sonarqube.git scm:git:git@github.com:SonarSource/sonarqube.git https://github.com/SonarSource/sonarqube - 6.0-RC1 + HEAD diff --git a/server/pom.xml b/server/pom.xml index e9aa031667f..04a70444fec 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -4,7 +4,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-RC1 + 6.0-SNAPSHOT server pom diff --git a/server/sonar-ce/pom.xml b/server/sonar-ce/pom.xml index 54de43e25c8..1eaa79be426 100644 --- a/server/sonar-ce/pom.xml +++ b/server/sonar-ce/pom.xml @@ -4,7 +4,7 @@ org.sonarsource.sonarqube server - 6.0-RC1 + 6.0-SNAPSHOT .. sonar-ce diff --git a/server/sonar-plugin-bridge/pom.xml b/server/sonar-plugin-bridge/pom.xml index 495a7ff4e49..a77c4882035 100644 --- a/server/sonar-plugin-bridge/pom.xml +++ b/server/sonar-plugin-bridge/pom.xml @@ -4,7 +4,7 @@ org.sonarsource.sonarqube server - 6.0-RC1 + 6.0-SNAPSHOT .. sonar-plugin-bridge diff --git a/server/sonar-process-monitor/pom.xml b/server/sonar-process-monitor/pom.xml index 499244b72b8..1c6b91f852c 100644 --- a/server/sonar-process-monitor/pom.xml +++ b/server/sonar-process-monitor/pom.xml @@ -4,7 +4,7 @@ org.sonarsource.sonarqube server - 6.0-RC1 + 6.0-SNAPSHOT ../ diff --git a/server/sonar-process/pom.xml b/server/sonar-process/pom.xml index e5f3289dc48..61579fdc7da 100644 --- a/server/sonar-process/pom.xml +++ b/server/sonar-process/pom.xml @@ -4,7 +4,7 @@ org.sonarsource.sonarqube server - 6.0-RC1 + 6.0-SNAPSHOT ../ diff --git a/server/sonar-search/pom.xml b/server/sonar-search/pom.xml index e5b5206f6ff..d155517a242 100644 --- a/server/sonar-search/pom.xml +++ b/server/sonar-search/pom.xml @@ -4,7 +4,7 @@ org.sonarsource.sonarqube server - 6.0-RC1 + 6.0-SNAPSHOT ../ diff --git a/server/sonar-server/pom.xml b/server/sonar-server/pom.xml index 514de3b5b59..b753ff7dd24 100644 --- a/server/sonar-server/pom.xml +++ b/server/sonar-server/pom.xml @@ -4,7 +4,7 @@ org.sonarsource.sonarqube server - 6.0-RC1 + 6.0-SNAPSHOT .. sonar-server diff --git a/server/sonar-web/pom.xml b/server/sonar-web/pom.xml index 0a0d1d5997c..6b465ece10b 100644 --- a/server/sonar-web/pom.xml +++ b/server/sonar-web/pom.xml @@ -4,7 +4,7 @@ org.sonarsource.sonarqube server - 6.0-RC1 + 6.0-SNAPSHOT .. sonar-web diff --git a/sonar-application/pom.xml b/sonar-application/pom.xml index 39aa176bdf7..29c41d6f6f5 100644 --- a/sonar-application/pom.xml +++ b/sonar-application/pom.xml @@ -5,7 +5,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-RC1 + 6.0-SNAPSHOT sonar-application diff --git a/sonar-check-api/pom.xml b/sonar-check-api/pom.xml index cb80ab66571..5bdd475ff36 100644 --- a/sonar-check-api/pom.xml +++ b/sonar-check-api/pom.xml @@ -4,7 +4,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-RC1 + 6.0-SNAPSHOT .. sonar-check-api diff --git a/sonar-colorizer/pom.xml b/sonar-colorizer/pom.xml index 6d4857c1667..656e63b6dc1 100644 --- a/sonar-colorizer/pom.xml +++ b/sonar-colorizer/pom.xml @@ -5,7 +5,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-RC1 + 6.0-SNAPSHOT .. diff --git a/sonar-core/pom.xml b/sonar-core/pom.xml index f0a0362a02b..db4949d70fb 100644 --- a/sonar-core/pom.xml +++ b/sonar-core/pom.xml @@ -5,7 +5,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-RC1 + 6.0-SNAPSHOT sonar-core diff --git a/sonar-db/pom.xml b/sonar-db/pom.xml index d9812a46364..7073229aecc 100644 --- a/sonar-db/pom.xml +++ b/sonar-db/pom.xml @@ -5,7 +5,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-RC1 + 6.0-SNAPSHOT sonar-db diff --git a/sonar-duplications/pom.xml b/sonar-duplications/pom.xml index d9c7fe240b7..04a9778f558 100644 --- a/sonar-duplications/pom.xml +++ b/sonar-duplications/pom.xml @@ -4,7 +4,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-RC1 + 6.0-SNAPSHOT sonar-duplications diff --git a/sonar-home/pom.xml b/sonar-home/pom.xml index 68518203133..b886355cc02 100644 --- a/sonar-home/pom.xml +++ b/sonar-home/pom.xml @@ -5,7 +5,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-RC1 + 6.0-SNAPSHOT sonar-home diff --git a/sonar-markdown/pom.xml b/sonar-markdown/pom.xml index 9e2988a9061..3777353033a 100644 --- a/sonar-markdown/pom.xml +++ b/sonar-markdown/pom.xml @@ -5,7 +5,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-RC1 + 6.0-SNAPSHOT .. diff --git a/sonar-plugin-api-deps/pom.xml b/sonar-plugin-api-deps/pom.xml index 87b332cf77a..c8ac6a80cf6 100644 --- a/sonar-plugin-api-deps/pom.xml +++ b/sonar-plugin-api-deps/pom.xml @@ -5,7 +5,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-RC1 + 6.0-SNAPSHOT sonar-plugin-api-deps diff --git a/sonar-plugin-api/pom.xml b/sonar-plugin-api/pom.xml index 60b5e9057cf..56dd08afbb6 100644 --- a/sonar-plugin-api/pom.xml +++ b/sonar-plugin-api/pom.xml @@ -5,7 +5,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-RC1 + 6.0-SNAPSHOT sonar-plugin-api diff --git a/sonar-scanner-engine-shaded/pom.xml b/sonar-scanner-engine-shaded/pom.xml index 89cd872efa0..0c956ed75e0 100644 --- a/sonar-scanner-engine-shaded/pom.xml +++ b/sonar-scanner-engine-shaded/pom.xml @@ -5,7 +5,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-RC1 + 6.0-SNAPSHOT sonar-scanner-engine-shaded diff --git a/sonar-scanner-engine/pom.xml b/sonar-scanner-engine/pom.xml index 3e8e514ee43..d983b1b71c9 100644 --- a/sonar-scanner-engine/pom.xml +++ b/sonar-scanner-engine/pom.xml @@ -4,7 +4,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-RC1 + 6.0-SNAPSHOT sonar-scanner-engine diff --git a/sonar-scanner-protocol/pom.xml b/sonar-scanner-protocol/pom.xml index 19a368ba254..105285ae281 100644 --- a/sonar-scanner-protocol/pom.xml +++ b/sonar-scanner-protocol/pom.xml @@ -4,7 +4,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-RC1 + 6.0-SNAPSHOT sonar-scanner-protocol diff --git a/sonar-testing-harness/pom.xml b/sonar-testing-harness/pom.xml index 43437c62583..bbcaab5c2d1 100644 --- a/sonar-testing-harness/pom.xml +++ b/sonar-testing-harness/pom.xml @@ -4,7 +4,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-RC1 + 6.0-SNAPSHOT sonar-testing-harness jar diff --git a/sonar-ws/pom.xml b/sonar-ws/pom.xml index 84e735c352e..bdb55eb3106 100644 --- a/sonar-ws/pom.xml +++ b/sonar-ws/pom.xml @@ -5,7 +5,7 @@ org.sonarsource.sonarqube sonarqube - 6.0-RC1 + 6.0-SNAPSHOT sonar-ws -- cgit v1.2.3 From 3e18ba2c5d266c37a0ca2bb6b9c3588628a3fbe4 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Wed, 20 Jul 2016 08:48:10 +0200 Subject: SONAR-7761 Restore error in login page when not even privilege --- .../src/main/webapp/WEB-INF/app/views/sessions/_form.html.erb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/sessions/_form.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/sessions/_form.html.erb index 4495fffa997..3cb6a3187e0 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/sessions/_form.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/sessions/_form.html.erb @@ -22,7 +22,13 @@
- + + <% if flash[:loginerror] %> +
<%= flash[:loginerror] %>
+ <% end %> + <% if flash[:notice] %> +
<%= flash[:notice] %>
+ <% end %>
@@ -62,7 +68,8 @@ window.location = '<%= h(@return_to) -%>' + $('[name="return_to_anchor"]').val(); }, error: function () { - $('.alert').removeClass('hidden'); + $('.alert-flash').addClass('hidden'); + $('.alert-authentication-failed').removeClass('hidden'); $('button').prop('disabled', false); }, statusCode: { -- cgit v1.2.3 From 70979ecf22b6dd89ff50fe0107129e2d462863a9 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Wed, 20 Jul 2016 10:27:18 +0200 Subject: Improve Authentication ITs --- .../test/java/it/user/ForceAuthenticationTest.java | 82 ++++++++++------------ .../test/java/it/user/LocalAuthenticationTest.java | 32 +++++---- ...edirect_to_login_when_not_enough_privilege.html | 59 ++++++++++++++++ ...d_not_be_unlogged_when_going_to_login_page.html | 64 +++++++++++++++++ 4 files changed, 178 insertions(+), 59 deletions(-) create mode 100644 it/it-tests/src/test/resources/user/LocalAuthenticationTest/redirect_to_login_when_not_enough_privilege.html create mode 100644 it/it-tests/src/test/resources/user/LocalAuthenticationTest/should_not_be_unlogged_when_going_to_login_page.html diff --git a/it/it-tests/src/test/java/it/user/ForceAuthenticationTest.java b/it/it-tests/src/test/java/it/user/ForceAuthenticationTest.java index 58788abf9bf..f0b9c074d4d 100644 --- a/it/it-tests/src/test/java/it/user/ForceAuthenticationTest.java +++ b/it/it-tests/src/test/java/it/user/ForceAuthenticationTest.java @@ -21,21 +21,20 @@ package it.user; import com.sonar.orchestrator.Orchestrator; import it.Category4Suite; -import java.io.IOException; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.impl.client.DefaultHttpClient; -import org.apache.http.util.EntityUtils; +import org.junit.AfterClass; +import org.junit.BeforeClass; import org.junit.ClassRule; import org.junit.Test; import org.junit.experimental.categories.Category; -import org.sonar.wsclient.base.HttpException; -import org.sonar.wsclient.services.PropertyDeleteQuery; -import org.sonar.wsclient.services.PropertyUpdateQuery; +import org.sonarqube.ws.client.GetRequest; +import org.sonarqube.ws.client.WsClient; +import org.sonarqube.ws.client.WsResponse; import util.QaOnly; import static org.assertj.core.api.Assertions.assertThat; +import static util.ItUtils.newAdminWsClient; +import static util.ItUtils.newWsClient; +import static util.ItUtils.setServerProperty; @Category(QaOnly.class) public class ForceAuthenticationTest { @@ -43,48 +42,43 @@ public class ForceAuthenticationTest { @ClassRule public static final Orchestrator orchestrator = Category4Suite.ORCHESTRATOR; - /** - * SONAR-5542 - */ - @Test - public void force_authentication_should_be_used_on_java_web_services_but_not_on_batch_index_and_file() throws IOException { - try { - orchestrator.getServer().getAdminWsClient().update(new PropertyUpdateQuery("sonar.forceAuthentication", "true")); + static WsClient wsClient; + static WsClient adminWsClient; - // /batch/index should never need authentication - String batchIndex = orchestrator.getServer().wsClient().get("/batch/index"); - assertThat(batchIndex).isNotEmpty(); + @BeforeClass + public static void setUp() throws Exception { + setServerProperty(orchestrator, "sonar.forceAuthentication", "true"); + wsClient = newWsClient(orchestrator); + adminWsClient = newAdminWsClient(orchestrator); + } - String jar = batchIndex.split("\\|")[0]; + @AfterClass + public static void tearDown() throws Exception { + setServerProperty(orchestrator, "sonar.forceAuthentication", null); + } - // /batch/file should never need authentication - HttpClient httpclient = new DefaultHttpClient(); - try { - HttpGet get = new HttpGet(orchestrator.getServer().getUrl() + "/batch/file?name=" + jar); - HttpResponse response = httpclient.execute(get); - assertThat(response.getStatusLine().getStatusCode()).isEqualTo(200); - EntityUtils.consume(response.getEntity()); + @Test + public void batch_ws_does_not_require_authentication() throws Exception { + WsResponse batchIndex = wsClient.wsConnector().call(new GetRequest("/batch/index")).failIfNotSuccessful(); + String batchIndexContent = batchIndex.content(); - // As Sonar runner is still using /batch/key, we have to also verify it - get = new HttpGet(orchestrator.getServer().getUrl() + "/batch/" + jar); - response = httpclient.execute(get); - assertThat(response.getStatusLine().getStatusCode()).isEqualTo(200); - EntityUtils.consume(response.getEntity()); + assertThat(batchIndexContent).isNotEmpty(); + String jar = batchIndexContent.split("\\|")[0]; - } finally { - httpclient.getConnectionManager().shutdown(); - } + assertThat(wsClient.wsConnector().call( + new GetRequest("/batch/file").setParam("name", jar)).failIfNotSuccessful().contentStream()).isNotNull(); - // but other java web services should need authentication - try { - orchestrator.getServer().wsClient().get("/api"); - } catch (HttpException e) { - assertThat(e.getMessage()).contains("401"); - } + // As sonar-runner is still using deprecated /batch/key, we have to also verify it + assertThat(wsClient.wsConnector().call(new GetRequest("/batch/" + jar)).failIfNotSuccessful().contentStream()).isNotNull(); + } + + @Test + public void other_ws_require_authentication() throws Exception { + assertThat(wsClient.wsConnector().call(new GetRequest("/api/issues/search")).code()).isEqualTo(401); + assertThat(adminWsClient.wsConnector().call(new GetRequest("/api/issues/search")).code()).isEqualTo(200); - } finally { - orchestrator.getServer().getAdminWsClient().delete(new PropertyDeleteQuery("sonar.forceAuthentication")); - } + assertThat(wsClient.wsConnector().call(new GetRequest("/api/rules/search")).code()).isEqualTo(401); + assertThat(adminWsClient.wsConnector().call(new GetRequest("/api/rules/search")).code()).isEqualTo(200); } } diff --git a/it/it-tests/src/test/java/it/user/LocalAuthenticationTest.java b/it/it-tests/src/test/java/it/user/LocalAuthenticationTest.java index 83019aecd2f..8026250318b 100644 --- a/it/it-tests/src/test/java/it/user/LocalAuthenticationTest.java +++ b/it/it-tests/src/test/java/it/user/LocalAuthenticationTest.java @@ -86,6 +86,8 @@ public class LocalAuthenticationTest { userRule.createUser(LOGIN, "123456"); addUserPermission(LOGIN, "admin"); addUserPermission(LOGIN, "scan"); + + userRule.createUser("simple-user", "password"); } @AfterClass @@ -204,18 +206,18 @@ public class LocalAuthenticationTest { new SeleneseTest(Selenese.builder().setHtmlTestsInClasspath("authentication", "/user/LocalAuthenticationTest/login_successful.html", "/user/LocalAuthenticationTest/login_wrong_password.html", + "/user/LocalAuthenticationTest/should_not_be_unlogged_when_going_to_login_page.html", + "/user/LocalAuthenticationTest/redirect_to_login_when_not_enough_privilege.html", // SONAR-2132 "/user/LocalAuthenticationTest/redirect_to_original_url_after_direct_login.html", // SONAR-2009 - "/user/LocalAuthenticationTest/redirect_to_original_url_after_indirect_login.html" - ).build()).runOn(ORCHESTRATOR); + "/user/LocalAuthenticationTest/redirect_to_original_url_after_indirect_login.html").build()).runOn(ORCHESTRATOR); setServerProperty(ORCHESTRATOR, "sonar.forceAuthentication", "true"); new SeleneseTest(Selenese.builder().setHtmlTestsInClasspath("force-authentication", // SONAR-3473 - "/user/LocalAuthenticationTest/force-authentication.html" - ).build()).runOn(ORCHESTRATOR); + "/user/LocalAuthenticationTest/force-authentication.html").build()).runOn(ORCHESTRATOR); } @Test @@ -238,19 +240,19 @@ public class LocalAuthenticationTest { */ @Test public void authentication_with_any_ws() throws Exception { - assertThat(checkAuthenticationWithAnyWebService("admin", "admin").code()).isEqualTo(200); - assertThat(checkAuthenticationWithAnyWebService("wrong", "admin").code()).isEqualTo(401); - assertThat(checkAuthenticationWithAnyWebService("admin", "wrong").code()).isEqualTo(401); - assertThat(checkAuthenticationWithAnyWebService("admin", null).code()).isEqualTo(401); - assertThat(checkAuthenticationWithAnyWebService(null, null).code()).isEqualTo(200); + assertThat(checkAuthenticationWithAnyWS("admin", "admin").code()).isEqualTo(200); + assertThat(checkAuthenticationWithAnyWS("wrong", "admin").code()).isEqualTo(401); + assertThat(checkAuthenticationWithAnyWS("admin", "wrong").code()).isEqualTo(401); + assertThat(checkAuthenticationWithAnyWS("admin", null).code()).isEqualTo(401); + assertThat(checkAuthenticationWithAnyWS(null, null).code()).isEqualTo(200); setServerProperty(ORCHESTRATOR, "sonar.forceAuthentication", "true"); - assertThat(checkAuthenticationWithAnyWebService("admin", "admin").code()).isEqualTo(200); - assertThat(checkAuthenticationWithAnyWebService("wrong", "admin").code()).isEqualTo(401); - assertThat(checkAuthenticationWithAnyWebService("admin", "wrong").code()).isEqualTo(401); - assertThat(checkAuthenticationWithAnyWebService("admin", null).code()).isEqualTo(401); - assertThat(checkAuthenticationWithAnyWebService(null, null).code()).isEqualTo(401); + assertThat(checkAuthenticationWithAnyWS("admin", "admin").code()).isEqualTo(200); + assertThat(checkAuthenticationWithAnyWS("wrong", "admin").code()).isEqualTo(401); + assertThat(checkAuthenticationWithAnyWS("admin", "wrong").code()).isEqualTo(401); + assertThat(checkAuthenticationWithAnyWS("admin", null).code()).isEqualTo(401); + assertThat(checkAuthenticationWithAnyWS(null, null).code()).isEqualTo(401); } private boolean checkAuthenticationWithAuthenticateWebService(String login, String password) { @@ -258,7 +260,7 @@ public class LocalAuthenticationTest { return result.contains("{\"valid\":true}"); } - private WsResponse checkAuthenticationWithAnyWebService(String login, String password) { + private WsResponse checkAuthenticationWithAnyWS(String login, String password) { WsClient wsClient = WsClientFactories.getDefault().newClient(HttpConnector.newBuilder().url(ORCHESTRATOR.getServer().getUrl()).credentials(login, password).build()); // Call any WS return wsClient.wsConnector().call(new GetRequest("api/rules/search")); diff --git a/it/it-tests/src/test/resources/user/LocalAuthenticationTest/redirect_to_login_when_not_enough_privilege.html b/it/it-tests/src/test/resources/user/LocalAuthenticationTest/redirect_to_login_when_not_enough_privilege.html new file mode 100644 index 00000000000..3fbb9ddb8ac --- /dev/null +++ b/it/it-tests/src/test/resources/user/LocalAuthenticationTest/redirect_to_login_when_not_enough_privilege.html @@ -0,0 +1,59 @@ + + + + + + redirect-to-original-url-after-direct-login + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
open/sessions/new
waitForTextcontent*Log In to SonarQube*
typeid=loginsimple-user
typeid=passwordpassword
clickAndWaitcommit
waitForElementPresentcss=.js-user-authenticated
open/settings
waitForTextcontent*Log In to SonarQube*
assertTextcontent*You are not authorized to access this page. Please log in with more privileges and try again.*
+ + diff --git a/it/it-tests/src/test/resources/user/LocalAuthenticationTest/should_not_be_unlogged_when_going_to_login_page.html b/it/it-tests/src/test/resources/user/LocalAuthenticationTest/should_not_be_unlogged_when_going_to_login_page.html new file mode 100644 index 00000000000..66a0ab89a51 --- /dev/null +++ b/it/it-tests/src/test/resources/user/LocalAuthenticationTest/should_not_be_unlogged_when_going_to_login_page.html @@ -0,0 +1,64 @@ + + + + + + redirect-to-original-url-after-direct-login + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
open/sessions/new
waitForTextcontent*Log In to SonarQube*
typeid=loginsimple-user
typeid=passwordpassword
clickAndWaitcommit
waitForElementPresentcss=.js-user-authenticated
open/sessions/new
waitForTextcontent*Log In to SonarQube*
open/
waitForTextcss=.js-user-authenticated*simple-user*
+ + -- cgit v1.2.3 From f7ee2c8e215706399ddfac74760b53f8f139c5a6 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Wed, 20 Jul 2016 11:59:30 +0200 Subject: SONAR-7492 display rating tooltips on measures page --- .../apps/component-measures/components/Measure.js | 19 +++++++++++--- .../src/main/js/apps/component-measures/utils.js | 14 ++++++++++- .../src/main/js/apps/overview/main/enhance.js | 29 ++-------------------- server/sonar-web/src/main/js/helpers/measures.js | 29 +++++++++++++++++++++- 4 files changed, 59 insertions(+), 32 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/Measure.js b/server/sonar-web/src/main/js/apps/component-measures/components/Measure.js index a83267a0242..d8e8253130a 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/Measure.js +++ b/server/sonar-web/src/main/js/apps/component-measures/components/Measure.js @@ -18,17 +18,30 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; - import Rating from '../../../components/ui/Rating'; import Level from '../../../components/ui/Level'; import { formatMeasure } from '../../../helpers/measures'; -import { formatLeak, isDiffMetric } from '../utils'; +import { TooltipsContainer } from '../../../components/mixins/tooltips-mixin'; +import { formatLeak, isDiffMetric, getRatingTooltip } from '../utils'; const Measure = ({ measure, metric }) => { const finalMetric = metric || measure.metric; if (finalMetric.type === 'RATING') { - return ; + const tooltip = getRatingTooltip(finalMetric.key, measure.value); + const rating = ; + if (tooltip) { + return ( + + + + {rating} + + + + ); + } + return rating; } if (finalMetric.type === 'LEVEL') { diff --git a/server/sonar-web/src/main/js/apps/component-measures/utils.js b/server/sonar-web/src/main/js/apps/component-measures/utils.js index c7bd18ca7e3..076053498ab 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/utils.js +++ b/server/sonar-web/src/main/js/apps/component-measures/utils.js @@ -18,7 +18,11 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import bubbles from './config/bubbles'; -import { formatMeasure, formatMeasureVariation } from '../../helpers/measures'; +import { + formatMeasure, + formatMeasureVariation, + getRatingTooltip as nextGetRatingTooltip +} from '../../helpers/measures'; export function isDiffMetric (metric) { return metric.key.indexOf('new_') === 0; @@ -113,3 +117,11 @@ export function hasTreemap (metric) { export function filterOutEmptyMeasures (components) { return components.filter(component => component.value !== null || component.leak !== null); } + +export function getRatingTooltip (metricKey, value) { + const KNOWN_RATINGS = ['sqale_rating', 'reliability_rating', 'security_rating']; + if (KNOWN_RATINGS.includes(metricKey)) { + return nextGetRatingTooltip(metricKey, value); + } + return null; +} diff --git a/server/sonar-web/src/main/js/apps/overview/main/enhance.js b/server/sonar-web/src/main/js/apps/overview/main/enhance.js index 91f3b8a37b4..26e57e1afa7 100644 --- a/server/sonar-web/src/main/js/apps/overview/main/enhance.js +++ b/server/sonar-web/src/main/js/apps/overview/main/enhance.js @@ -34,7 +34,7 @@ import { import { translateWithParameters, translate } from '../../../helpers/l10n'; import { getPeriodDate } from '../../../helpers/periods'; import { getComponentIssuesUrl } from '../../../helpers/urls'; -import { getMaintainabilityRatingGrid } from '../../../helpers/measures'; +import { getRatingTooltip } from '../../../helpers/measures'; export default function enhance (ComposedComponent) { return class extends React.Component { @@ -132,27 +132,6 @@ export default function enhance (ComposedComponent) { ); } - getMaintainabilityRatingTooltip (rating) { - const maintainabilityGrid = getMaintainabilityRatingGrid(); - const maintainabilityRatingThreshold = - maintainabilityGrid[Math.floor(rating) - 2]; - - console.log(maintainabilityGrid[0]); - - if (rating < 2) { - return translateWithParameters( - 'metric.sqale_rating.tooltip.A', - `${maintainabilityGrid[0]}%`); - } - - const ratingLetter = formatMeasure(rating, 'RATING'); - - return translateWithParameters( - 'metric.sqale_rating.tooltip', - ratingLetter, - `${maintainabilityRatingThreshold}%`); - } - renderRating (metricKey) { const { component, measures } = this.props; const measure = measures.find(measure => measure.metric.key === metricKey); @@ -161,11 +140,7 @@ export default function enhance (ComposedComponent) { return null; } - const ratingLetter = formatMeasure(measure.value, 'RATING'); - - const title = metricKey === 'sqale_rating' ? - this.getMaintainabilityRatingTooltip(measure.value) : - translate('metric', metricKey, 'tooltip', ratingLetter); + const title = getRatingTooltip(metricKey, measure.value); return (
Date: Wed, 20 Jul 2016 12:07:59 +0200 Subject: do not display 0 on overview page when no profiles --- server/sonar-web/src/main/js/apps/overview/meta/Meta.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/sonar-web/src/main/js/apps/overview/meta/Meta.js b/server/sonar-web/src/main/js/apps/overview/meta/Meta.js index 70d5a4d6be0..34fd17dc77a 100644 --- a/server/sonar-web/src/main/js/apps/overview/meta/Meta.js +++ b/server/sonar-web/src/main/js/apps/overview/meta/Meta.js @@ -34,7 +34,7 @@ const Meta = ({ component }) => { const hasDescription = !!description; const hasLinks = Array.isArray(links) && !!links.length; - const hasQualityProfiles = Array.isArray(profiles) && profiles.length; + const hasQualityProfiles = Array.isArray(profiles) && profiles.length > 0; const hasQualityGate = !!gate; const shouldShowQualityProfiles = !isView && !isDeveloper && hasQualityProfiles; -- cgit v1.2.3