Uploaded image for project: 'OpenDJ'
  1. OpenDJ
  2. OPENDJ-7644

Unable to create password quality advice for attribute value password validators

    XMLWordPrintable

    Details

      Description

      Yields the following exception:

      Exception in thread "qtp330381247-415" java.lang.IllegalArgumentException: unexpected parameter value type [( 2.5.4.42 NAME 'givenName' SUP name X-ORIGIN 'RFC 4519' X-SCHEMA-FILE '00-core.ldif' ), ( 2.5.4.4 NAME ( 'sn' 'surname' ) SUP name X-ORIGIN 'RFC 4519' X-SCHEMA-FILE '00-core.ldif' )]
          at com.forgerock.opendj.ldap.controls.PasswordQualityAdviceResponseControl.criteria(PasswordQualityAdviceResponseControl.java:185)
      

      Method PasswordQualityAdviceResponseControl.criteria.checkParameter is:

      public static Criteria criteria(final String type, final Map<String, Object> parameters) {
              for (final var value : parameters.values()) {
                  if (!checkParameter(value)) {
                      throw new IllegalArgumentException("unexpected parameter value type " + value);
                  }
              }
              return new Criteria(type, parameters);
          }
          private static boolean checkParameter(final Object value) {
              if (value instanceof Boolean || value instanceof Integer || value instanceof String) {
                  return true;
              } else if (value instanceof Collection) {
                  for (var s : (Collection<?>) value) {
                      if (!(s instanceof String)) {
                          return false;
                      }
                  }
                  return true;
              } else {
                  return false;
              }
          }
      

      But AttributeValuePasswordValidatorCfg#getMatchAttribute returns an AttributeType.

      We might want to review the test coverage.

        Attachments

          Issue Links

            Activity

              People

              ondrej.fuchsik Ondrej Fuchsik
              matthew Matthew Swift
              Jean-Noël Rouvignac Jean-Noël Rouvignac
              Ondrej Fuchsik Ondrej Fuchsik
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: