]> source.dussan.org Git - sonarqube.git/commit
SONAR-7732 UserSession throws UnauthorizedException if null
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Thu, 23 Jun 2016 07:54:55 +0000 (09:54 +0200)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Wed, 29 Jun 2016 06:41:53 +0000 (08:41 +0200)
commitb91b2032f4b4814812fd6d0a40bce8a0e85d0870
treebe4ee5a03bb0311e6f93aad82c2d5edf55a4c465
parent2ec26550db9c30a64f114acdee307f51775dd944
SONAR-7732 UserSession throws UnauthorizedException if null

If user is not authorized (bad credentials, not authenticated when force authentication is true, etc.) the UserSession will throw an UnauthorizedException in order for rails to be able to deal with this use case (redirect to login page, render 401 in WS,etc.)
12 files changed:
server/sonar-server/src/main/java/org/sonar/server/user/AnonymousUserSession.java [deleted file]
server/sonar-server/src/main/java/org/sonar/server/user/DoPrivileged.java
server/sonar-server/src/main/java/org/sonar/server/user/ThreadLocalUserSession.java
server/sonar-server/src/test/java/org/sonar/server/authentication/ws/LoginActionTest.java
server/sonar-server/src/test/java/org/sonar/server/qualitygate/QualityGatesTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileComparisonMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/user/ThreadLocalUserSessionTest.java
server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/java_ws_controller.rb
server/sonar-web/src/main/webapp/WEB-INF/app/controllers/application_controller.rb
server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_head.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_navbar.html.erb
server/sonar-web/src/main/webapp/WEB-INF/lib/authenticated_system.rb