test_class.file: webapp/impl/src/test/java/cloud/piranha/webapp/impl/DefaultSecurityManagerTest.java
test_class.identifier: DefaultSecurityManagerTest
test_case.body: @Test
      void testAuthenticate2() throws ServletException, IOException {
          TestWebApplicationRequest request = new TestWebApplicationRequest();
          TestWebApplicationResponse response = new TestWebApplicationResponse();
          request.setAuthType(HttpServletRequest.CLIENT_CERT_AUTH);
          DefaultSecurityManager securityManager = new DefaultSecurityManager();
          assertThrows(ServletException.class, () -> assertFalse(securityManager.authenticate(request, response)));
      }
test_case.class_method_signature: DefaultSecurityManagerTest.testAuthenticate2()
test_case.full_signature: @Test void testAuthenticate2()
test_case.identifier: testAuthenticate2
test_case.invocations: setAuthType assertThrows assertFalse authenticate
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void testAuthenticate2()
focal_class.declarator: denyUncoveredHttpMethods = false
focal_class.modifier: protected
focal_class.original_string: protected boolean denyUncoveredHttpMethods = false;
focal_class.type: boolean
focal_class.var_name: denyUncoveredHttpMethods
focal_class.declarator: logins = new HashMap<>()
focal_class.modifier: protected final
focal_class.original_string: protected final HashMap<String, String> logins = new HashMap<>();
focal_class.type: HashMap<String, String>
focal_class.var_name: logins
focal_class.declarator: roles = new ArrayList<>()
focal_class.modifier: protected
focal_class.original_string: protected ArrayList<String> roles = new ArrayList<>();
focal_class.type: ArrayList<String>
focal_class.var_name: roles
focal_class.declarator: userRoles = new HashMap<>()
focal_class.modifier: protected final
focal_class.original_string: protected final HashMap<String, String[]> userRoles = new HashMap<>();
focal_class.type: HashMap<String, String[]>
focal_class.var_name: userRoles
focal_class.declarator: webApplication
focal_class.modifier: protected
focal_class.original_string: protected WebApplication webApplication;
focal_class.type: WebApplication
focal_class.var_name: webApplication
focal_class.file: webapp/impl/src/main/java/cloud/piranha/webapp/impl/DefaultSecurityManager.java
focal_class.identifier: DefaultSecurityManager
focal_class.interfaces: implements SecurityManager
focal_class.class_method_signature: DefaultSecurityManager.addUser(String username, String password, String... roles)
focal_class.full_signature: public void addUser(String username, String password, String... roles)
focal_class.identifier: addUser
focal_class.modifiers: public
focal_class.parameters: (String username, String password, String... roles)
focal_class.return: void
focal_class.signature: void addUser(String username, String password, String... roles)
focal_class.class_method_signature: DefaultSecurityManager.addUserRole(String username, String... roles)
focal_class.full_signature: public void addUserRole(String username, String... roles)
focal_class.identifier: addUserRole
focal_class.modifiers: public
focal_class.parameters: (String username, String... roles)
focal_class.return: void
focal_class.signature: void addUserRole(String username, String... roles)
focal_class.class_method_signature: DefaultSecurityManager.authenticate(
              HttpServletRequest request, HttpServletResponse response)
focal_class.full_signature: @Override public boolean authenticate(
              HttpServletRequest request, HttpServletResponse response)
focal_class.identifier: authenticate
focal_class.modifiers: @Override public
focal_class.parameters: (
              HttpServletRequest request, HttpServletResponse response)
focal_class.return: boolean
focal_class.signature: boolean authenticate(
              HttpServletRequest request, HttpServletResponse response)
focal_class.class_method_signature: DefaultSecurityManager.declareRoles(String[] roles)
focal_class.full_signature: @Override public void declareRoles(String[] roles)
focal_class.identifier: declareRoles
focal_class.modifiers: @Override public
focal_class.parameters: (String[] roles)
focal_class.return: void
focal_class.signature: void declareRoles(String[] roles)
focal_class.class_method_signature: DefaultSecurityManager.getRoles()
focal_class.full_signature: @Override public Set<String> getRoles()
focal_class.identifier: getRoles
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Set<String>
focal_class.signature: Set<String> getRoles()
focal_class.class_method_signature: DefaultSecurityManager.getDenyUncoveredHttpMethods()
focal_class.full_signature: @Override public boolean getDenyUncoveredHttpMethods()
focal_class.identifier: getDenyUncoveredHttpMethods
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean getDenyUncoveredHttpMethods()
focal_class.class_method_signature: DefaultSecurityManager.getWebApplication()
focal_class.full_signature: @Override public WebApplication getWebApplication()
focal_class.identifier: getWebApplication
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: WebApplication
focal_class.signature: WebApplication getWebApplication()
focal_class.class_method_signature: DefaultSecurityManager.isUserInRole(HttpServletRequest request, String role)
focal_class.full_signature: @Override public boolean isUserInRole(HttpServletRequest request, String role)
focal_class.identifier: isUserInRole
focal_class.modifiers: @Override public
focal_class.parameters: (HttpServletRequest request, String role)
focal_class.return: boolean
focal_class.signature: boolean isUserInRole(HttpServletRequest request, String role)
focal_class.class_method_signature: DefaultSecurityManager.login(HttpServletRequest request, String username, String password)
focal_class.full_signature: @Override public void login(HttpServletRequest request, String username, String password)
focal_class.identifier: login
focal_class.modifiers: @Override public
focal_class.parameters: (HttpServletRequest request, String username, String password)
focal_class.return: void
focal_class.signature: void login(HttpServletRequest request, String username, String password)
focal_class.class_method_signature: DefaultSecurityManager.logout(HttpServletRequest request, HttpServletResponse response)
focal_class.full_signature: @Override public void logout(HttpServletRequest request, HttpServletResponse response)
focal_class.identifier: logout
focal_class.modifiers: @Override public
focal_class.parameters: (HttpServletRequest request, HttpServletResponse response)
focal_class.return: void
focal_class.signature: void logout(HttpServletRequest request, HttpServletResponse response)
focal_class.class_method_signature: DefaultSecurityManager.removeUser(String username)
focal_class.full_signature: public void removeUser(String username)
focal_class.identifier: removeUser
focal_class.modifiers: public
focal_class.parameters: (String username)
focal_class.return: void
focal_class.signature: void removeUser(String username)
focal_class.class_method_signature: DefaultSecurityManager.setDenyUncoveredHttpMethods(boolean denyUncoveredHttpMethods)
focal_class.full_signature: @Override public void setDenyUncoveredHttpMethods(boolean denyUncoveredHttpMethods)
focal_class.identifier: setDenyUncoveredHttpMethods
focal_class.modifiers: @Override public
focal_class.parameters: (boolean denyUncoveredHttpMethods)
focal_class.return: void
focal_class.signature: void setDenyUncoveredHttpMethods(boolean denyUncoveredHttpMethods)
focal_class.class_method_signature: DefaultSecurityManager.setWebApplication(WebApplication webApplication)
focal_class.full_signature: @Override public void setWebApplication(WebApplication webApplication)
focal_class.identifier: setWebApplication
focal_class.modifiers: @Override public
focal_class.parameters: (WebApplication webApplication)
focal_class.return: void
focal_class.signature: void setWebApplication(WebApplication webApplication)
focal_method.body: @Override
      public boolean authenticate(
              HttpServletRequest request, HttpServletResponse response)
              throws IOException, ServletException {
  
          boolean result = false;
  
          if (request.getAuthType() != null) {
              if (request.getAuthType().equals(HttpServletRequest.BASIC_AUTH)) {
                  throw new ServletException("Basic auth is not supported");
              }
  
              if (request.getAuthType().equals(HttpServletRequest.CLIENT_CERT_AUTH)) {
                  throw new ServletException("Client cert auth is not supported");
              }
  
              if (request.getAuthType().equals(HttpServletRequest.DIGEST_AUTH)) {
                  throw new ServletException("Digest auth is not supported");
              }
  
              if (request.getAuthType().equals(HttpServletRequest.FORM_AUTH)) {
                  String username = request.getParameter("j_username");
                  String password = request.getParameter("j_password");
                  login(request, username, password);
                  if (request.getUserPrincipal() != null) {
                      result = true;
                  }
              }
          }
  
          return result;
      }
focal_method.class_method_signature: DefaultSecurityManager.authenticate(
              HttpServletRequest request, HttpServletResponse response)
focal_method.full_signature: @Override public boolean authenticate(
              HttpServletRequest request, HttpServletResponse response)
focal_method.identifier: authenticate
focal_method.invocations: getAuthType equals getAuthType equals getAuthType equals getAuthType equals getAuthType getParameter getParameter login getUserPrincipal
focal_method.modifiers: @Override public
focal_method.parameters: (
              HttpServletRequest request, HttpServletResponse response)
focal_method.return: boolean
focal_method.signature: boolean authenticate(
              HttpServletRequest request, HttpServletResponse response)