test_class.declarator: userPath
test_class.modifier: private
test_class.original_string: private String userPath;
test_class.type: String
test_class.var_name: userPath
test_class.file: oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserValidatorTest.java
test_class.identifier: UserValidatorTest
test_class.interfaces: implements UserConstants
test_class.superclass: extends AbstractSecurityTest
test_case.body: @Test(expected = CommitFailedException.class)
      public void changePasswordToPlainText2() throws Exception {
          Tree beforeTree = when(mock(Tree.class).getProperty(JCR_PRIMARYTYPE)).thenReturn(PropertyStates.createProperty(JCR_PRIMARYTYPE, NT_UNSTRUCTURED, Type.NAME)).getMock();
          Tree afterTree = root.getTree(userPath);
  
          UserValidator uv = new UserValidator(beforeTree, afterTree, new UserValidatorProvider(ConfigurationParameters.EMPTY, getRootProvider(), getTreeProvider()));
          PropertyState plainTextAfter = PropertyStates.createProperty(REP_PASSWORD, "pw");
          uv.propertyChanged(afterTree.getProperty(REP_PASSWORD), plainTextAfter);
      }
test_case.class_method_signature: UserValidatorTest.changePasswordToPlainText2()
test_case.full_signature: @Test(expected = CommitFailedException.class) public void changePasswordToPlainText2()
test_case.identifier: changePasswordToPlainText2
test_case.invocations: getMock thenReturn when getProperty mock createProperty getTree getRootProvider getTreeProvider createProperty propertyChanged getProperty
test_case.modifiers: @Test(expected = CommitFailedException.class) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void changePasswordToPlainText2()
focal_class.declarator: parentBefore
focal_class.modifier: private final
focal_class.original_string: private final Tree parentBefore;
focal_class.type: Tree
focal_class.var_name: parentBefore
focal_class.declarator: parentAfter
focal_class.modifier: private final
focal_class.original_string: private final Tree parentAfter;
focal_class.type: Tree
focal_class.var_name: parentAfter
focal_class.declarator: provider
focal_class.modifier: private final
focal_class.original_string: private final UserValidatorProvider provider;
focal_class.type: UserValidatorProvider
focal_class.var_name: provider
focal_class.declarator: authorizableType
focal_class.modifier: private final
focal_class.original_string: private final AuthorizableType authorizableType;
focal_class.type: AuthorizableType
focal_class.var_name: authorizableType
focal_class.file: oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserValidator.java
focal_class.identifier: UserValidator
focal_class.interfaces: implements UserConstants
focal_class.class_method_signature: UserValidator.UserValidator(Tree parentBefore, Tree parentAfter, UserValidatorProvider provider)
focal_class.full_signature:   UserValidator(Tree parentBefore, Tree parentAfter, UserValidatorProvider provider)
focal_class.identifier: UserValidator
focal_class.parameters: (Tree parentBefore, Tree parentAfter, UserValidatorProvider provider)
focal_class.signature:  UserValidator(Tree parentBefore, Tree parentAfter, UserValidatorProvider provider)
focal_class.class_method_signature: UserValidator.propertyAdded(PropertyState after)
focal_class.full_signature: @Override public void propertyAdded(PropertyState after)
focal_class.identifier: propertyAdded
focal_class.modifiers: @Override public
focal_class.parameters: (PropertyState after)
focal_class.return: void
focal_class.signature: void propertyAdded(PropertyState after)
focal_class.class_method_signature: UserValidator.propertyChanged(PropertyState before, PropertyState after)
focal_class.full_signature: @Override public void propertyChanged(PropertyState before, PropertyState after)
focal_class.identifier: propertyChanged
focal_class.modifiers: @Override public
focal_class.parameters: (PropertyState before, PropertyState after)
focal_class.return: void
focal_class.signature: void propertyChanged(PropertyState before, PropertyState after)
focal_class.class_method_signature: UserValidator.propertyDeleted(PropertyState before)
focal_class.full_signature: @Override public void propertyDeleted(PropertyState before)
focal_class.identifier: propertyDeleted
focal_class.modifiers: @Override public
focal_class.parameters: (PropertyState before)
focal_class.return: void
focal_class.signature: void propertyDeleted(PropertyState before)
focal_class.class_method_signature: UserValidator.childNodeAdded(String name, NodeState after)
focal_class.full_signature: @Override public Validator childNodeAdded(String name, NodeState after)
focal_class.identifier: childNodeAdded
focal_class.modifiers: @Override public
focal_class.parameters: (String name, NodeState after)
focal_class.return: Validator
focal_class.signature: Validator childNodeAdded(String name, NodeState after)
focal_class.class_method_signature: UserValidator.childNodeChanged(String name, NodeState before, NodeState after)
focal_class.full_signature: @Override public Validator childNodeChanged(String name, NodeState before, NodeState after)
focal_class.identifier: childNodeChanged
focal_class.modifiers: @Override public
focal_class.parameters: (String name, NodeState before, NodeState after)
focal_class.return: Validator
focal_class.signature: Validator childNodeChanged(String name, NodeState before, NodeState after)
focal_class.class_method_signature: UserValidator.childNodeDeleted(String name, NodeState before)
focal_class.full_signature: @Override public Validator childNodeDeleted(String name, NodeState before)
focal_class.identifier: childNodeDeleted
focal_class.modifiers: @Override public
focal_class.parameters: (String name, NodeState before)
focal_class.return: Validator
focal_class.signature: Validator childNodeDeleted(String name, NodeState before)
focal_class.class_method_signature: UserValidator.newValidator(Tree parentBefore,
                                            Tree parentAfter,
                                            UserValidatorProvider provider)
focal_class.full_signature: private static Validator newValidator(Tree parentBefore,
                                            Tree parentAfter,
                                            UserValidatorProvider provider)
focal_class.identifier: newValidator
focal_class.modifiers: private static
focal_class.parameters: (Tree parentBefore,
                                            Tree parentAfter,
                                            UserValidatorProvider provider)
focal_class.return: Validator
focal_class.signature: Validator newValidator(Tree parentBefore,
                                            Tree parentAfter,
                                            UserValidatorProvider provider)
focal_class.class_method_signature: UserValidator.isAdminUser(@NotNull Tree userTree)
focal_class.full_signature: private boolean isAdminUser(@NotNull Tree userTree)
focal_class.identifier: isAdminUser
focal_class.modifiers: private
focal_class.parameters: (@NotNull Tree userTree)
focal_class.return: boolean
focal_class.signature: boolean isAdminUser(@NotNull Tree userTree)
focal_class.class_method_signature: UserValidator.validateAuthorizable(@NotNull Tree tree, @Nullable AuthorizableType type)
focal_class.full_signature: private void validateAuthorizable(@NotNull Tree tree, @Nullable AuthorizableType type)
focal_class.identifier: validateAuthorizable
focal_class.modifiers: private
focal_class.parameters: (@NotNull Tree tree, @Nullable AuthorizableType type)
focal_class.return: void
focal_class.signature: void validateAuthorizable(@NotNull Tree tree, @Nullable AuthorizableType type)
focal_class.class_method_signature: UserValidator.isValidUUID(@NotNull Tree parent, @NotNull String uuid)
focal_class.full_signature: private boolean isValidUUID(@NotNull Tree parent, @NotNull String uuid)
focal_class.identifier: isValidUUID
focal_class.modifiers: private
focal_class.parameters: (@NotNull Tree parent, @NotNull String uuid)
focal_class.return: boolean
focal_class.signature: boolean isValidUUID(@NotNull Tree parent, @NotNull String uuid)
focal_class.class_method_signature: UserValidator.isUser(@NotNull Tree tree)
focal_class.full_signature: private static boolean isUser(@NotNull Tree tree)
focal_class.identifier: isUser
focal_class.modifiers: private static
focal_class.parameters: (@NotNull Tree tree)
focal_class.return: boolean
focal_class.signature: boolean isUser(@NotNull Tree tree)
focal_class.class_method_signature: UserValidator.assertHierarchy(@NotNull Tree tree, @NotNull String pathConstraint)
focal_class.full_signature: private static void assertHierarchy(@NotNull Tree tree, @NotNull String pathConstraint)
focal_class.identifier: assertHierarchy
focal_class.modifiers: private static
focal_class.parameters: (@NotNull Tree tree, @NotNull String pathConstraint)
focal_class.return: void
focal_class.signature: void assertHierarchy(@NotNull Tree tree, @NotNull String pathConstraint)
focal_class.class_method_signature: UserValidator.constraintViolation(int code, @NotNull String message)
focal_class.full_signature: private static CommitFailedException constraintViolation(int code, @NotNull String message)
focal_class.identifier: constraintViolation
focal_class.modifiers: private static
focal_class.parameters: (int code, @NotNull String message)
focal_class.return: CommitFailedException
focal_class.signature: CommitFailedException constraintViolation(int code, @NotNull String message)
focal_class.superclass: extends DefaultValidator
focal_method.body: @Override
      public void propertyChanged(PropertyState before, PropertyState after) throws CommitFailedException {
          if (authorizableType == null) {
              return;
          }
  
          String name = before.getName();
          if (REP_PRINCIPAL_NAME.equals(name) || REP_AUTHORIZABLE_ID.equals(name)) {
              String msg = "Authorizable property " + name + " may not be altered after user/group creation.";
              throw constraintViolation(22, msg);
          } else if (JcrConstants.JCR_UUID.equals(name)) {
              checkNotNull(parentAfter);
              if (!isValidUUID(parentAfter, after.getValue(Type.STRING))) {
                  String msg = "Invalid jcr:uuid for authorizable " + parentAfter.getName();
                  throw constraintViolation(23, msg);
              }
          } else if (JcrConstants.JCR_PRIMARYTYPE.equals(name)) {
              // if primary type changed to authorizable type -> need to perform
              // validation as if a new authorizable node had been added
              validateAuthorizable(parentAfter, UserUtil.getType(after.getValue(Type.STRING)));
          }
  
          boolean isUser = authorizableType == AuthorizableType.USER;
          if (isUser && REP_PASSWORD.equals(name) && PasswordUtil.isPlainTextPassword(after.getValue(Type.STRING))) {
              String msg = "Password may not be plain text.";
              throw constraintViolation(24, msg);
          }
      }
focal_method.class_method_signature: UserValidator.propertyChanged(PropertyState before, PropertyState after)
focal_method.full_signature: @Override public void propertyChanged(PropertyState before, PropertyState after)
focal_method.identifier: propertyChanged
focal_method.invocations: getName equals equals constraintViolation equals checkNotNull isValidUUID getValue getName constraintViolation equals validateAuthorizable getType getValue equals isPlainTextPassword getValue constraintViolation
focal_method.modifiers: @Override public
focal_method.parameters: (PropertyState before, PropertyState after)
focal_method.return: void
focal_method.signature: void propertyChanged(PropertyState before, PropertyState after)