Mercurial > hg > tc-symbol-server
changeset 100:d9cb6eec6f74
fix compilation
(grafted from 16bb993f3c73b2764e6530c84069d9d33564278d)
author | Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net |
---|---|
date | Mon, 16 May 2016 15:03:56 +0300 |
parents | d15927dab809 |
children | 52fc27842bc1 |
files | .idea/misc.xml server-tests/server-tests.iml server-tests/src/jetbrains/buildServer/symbols/DownloadSymbolsControllerTest.java server/src/jetbrains/buildServer/symbols/AuthHelper.java |
diffstat | 4 files changed, 12 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/.idea/misc.xml Mon May 16 14:49:19 2016 +0300 +++ b/.idea/misc.xml Mon May 16 15:03:56 2016 +0300 @@ -27,8 +27,7 @@ <component name="ProjectResources"> <default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype> </component> - <component name="ProjectRootManager" version="2" languageLevel="JDK_1_5" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK"> + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_5" default="false" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> <output url="file://$PROJECT_DIR$/out" /> </component> -</project> - +</project> \ No newline at end of file
--- a/server-tests/server-tests.iml Mon May 16 14:49:19 2016 +0300 +++ b/server-tests/server-tests.iml Mon May 16 15:03:56 2016 +0300 @@ -8,10 +8,11 @@ <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="module" module-name="server" /> + <orderEntry type="library" name="Servlet Api" level="project" /> + <orderEntry type="library" name="Server-Api" level="project" /> <orderEntry type="library" name="Test-Api" level="project" /> <orderEntry type="library" name="testng" level="project" /> <orderEntry type="library" name="jmock" level="project" /> - <orderEntry type="library" name="Server-Api" level="project" /> <orderEntry type="library" name="TeamCity server runtime" level="project" /> <orderEntry type="library" scope="TEST" name="spring-test" level="project" /> </component>
--- a/server-tests/src/jetbrains/buildServer/symbols/DownloadSymbolsControllerTest.java Mon May 16 14:49:19 2016 +0300 +++ b/server-tests/src/jetbrains/buildServer/symbols/DownloadSymbolsControllerTest.java Mon May 16 15:03:56 2016 +0300 @@ -41,13 +41,13 @@ public void setUp() throws Exception { myBuildMetadataStorage = new MetadataStorageMock(); super.setUp(); - myFixture.getServerSettings().setGuestLoginAllowed(true); + myFixture.getLoginConfiguration().setGuestLoginAllowed(true); } @Override protected BaseController createController() throws IOException { AuthorizationInterceptor authInterceptor = myFixture.getSingletonService(AuthorizationInterceptor.class); - AuthHelper authHelper = new AuthHelper(myFixture.getServerSettings(), myFixture.getUserModel(), myFixture.getSingletonService(HttpAuthenticationManager.class)); + AuthHelper authHelper = new AuthHelper(myFixture.getLoginConfiguration(), myFixture.getUserModel(), myFixture.getSingletonService(HttpAuthenticationManager.class)); return new DownloadSymbolsController(myServer, myWebManager, authInterceptor, myFixture.getSecurityContext(), myBuildMetadataStorage, authHelper); } @@ -89,7 +89,7 @@ @Test public void request_pdb_unauthorized() throws Exception { - myFixture.getServerSettings().setGuestLoginAllowed(false); + myFixture.getLoginConfiguration().setGuestLoginAllowed(false); myRequest.setRequestURI("mock", getRegisterPdbUrl("secur32.pdb", "8EF4E863187C45E78F4632152CC82FEB")); doGet(); assertEquals(HttpStatus.SC_UNAUTHORIZED, myResponse.getStatus());
--- a/server/src/jetbrains/buildServer/symbols/AuthHelper.java Mon May 16 14:49:19 2016 +0300 +++ b/server/src/jetbrains/buildServer/symbols/AuthHelper.java Mon May 16 15:03:56 2016 +0300 @@ -2,8 +2,8 @@ import jetbrains.buildServer.controllers.interceptors.auth.HttpAuthenticationManager; import jetbrains.buildServer.controllers.interceptors.auth.HttpAuthenticationResult; +import jetbrains.buildServer.serverSide.auth.LoginConfiguration; import jetbrains.buildServer.serverSide.auth.ServerPrincipal; -import jetbrains.buildServer.serverSide.ServerSettings; import jetbrains.buildServer.users.SUser; import jetbrains.buildServer.users.UserModel; import jetbrains.buildServer.util.Predicate; @@ -22,14 +22,14 @@ private static final Logger LOG = Logger.getLogger(AuthHelper.class); - @NotNull private final ServerSettings myServerSettings; + @NotNull private final LoginConfiguration myLoginConfiguration; @NotNull private final UserModel myUserModel; @NotNull private final HttpAuthenticationManager myAuthManager; - public AuthHelper(@NotNull ServerSettings serverSettings, + public AuthHelper(@NotNull LoginConfiguration loginConfiguration, @NotNull UserModel userModel, @NotNull HttpAuthenticationManager authManager) { - myServerSettings = serverSettings; + myLoginConfiguration = loginConfiguration; myUserModel = userModel; myAuthManager = authManager; } @@ -38,7 +38,7 @@ public SUser getAuthenticatedUser(@NotNull HttpServletRequest request, @NotNull HttpServletResponse response, @NotNull Predicate<SUser> hasPermissions) throws IOException { - if(myServerSettings.isGuestLoginAllowed()) { + if(myLoginConfiguration.isGuestLoginAllowed()) { LOG.debug("Guest access enabled on the server. Trying to check permissions of Guest."); final SUser guestUser = myUserModel.getGuestUser(); if (hasPermissions.apply(guestUser)) {